home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-20 | 21.8 KB | 1,020 lines |
- void (entity targ, entity inflictor, entity attacker, float damage) T_Damage;
- void () player_run;
- void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
- void(vector org, vector vel, float damage) SpawnBlood;
- void() SuperDamageSound;
-
-
- // called by worldspawn
- void() W_Precache =
- {
- precache_model ("progs/v_spike.mdl");
- precache_sound ("shalrath/attack2.wav");
- precache_sound ("shalrath/attack.wav");
-
- precache_sound ("shalrath/pain.wav");
- precache_sound ("shalrath/death.wav");
- precache_model ("progs/shalrath.mdl");
- precache_sound ("hknight/attack1.wav");
- precache_model ("progs/k_spike.mdl");
- precache_model ("progs/hknight.mdl");
- precache_sound ("hknight/death1.wav");
- precache_sound ("hknight/pain1.wav");
- precache_sound ("knight/sword2.wav");
-
- precache_sound ("enforcer/enfire.wav");
- precache_sound ("enforcer/death1.wav");
- precache_sound ("enforcer/pain1.wav");
- precache_sound ("enforcer/enfstop.wav");
- precache_model ("progs/laser.mdl");
- precache_model ("progs/enforcer.mdl");
- precache_sound ("demon/ddeath.wav");
- precache_sound ("soldier/death1.wav");
- precache_sound ("knight/kdeath.wav");
- precache_sound ("wizard/wdeath.wav");
- precache_sound ("ogre/ogdth.wav");
-
- precache_sound ("wizard/wpain.wav");
- precache_sound ("wizard/wdeath.wav");
- precache_sound ("wizard/wattack.wav");
- precache_model ("progs/w_spike.mdl");
- precache_sound ("ogre/ogsawatk.wav");
- precache_sound ("ogre/ogpain1.wav");
- precache_sound ("demon/dpain1.wav");
- precache_sound ("demon/ddeath.wav");
- precache_sound ("soldier/pain1.wav");
- precache_sound ("soldier/death1.wav");
- precache_sound ("knight/khurt.wav");
- precache_sound ("knight/kdeath.wav");
-
- precache_model ("progs/ogre.mdl");
- precache_model ("progs/wizard.mdl");
- precache_model ("progs/soldier.mdl");
- precache_sound ("demon/dhit2.wav");
- precache_sound ("demon/djump.wav");
- precache_model ("progs/demon.mdl");
- precache_model ("progs/knight.mdl");
- precache_sound ("knight/sword1.wav");
- precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
- precache_sound ("weapons/rocket1i.wav"); // spike gun
- precache_sound ("weapons/sgun1.wav");
- precache_sound ("weapons/guncock.wav"); // player shotgun
- precache_sound ("weapons/ric1.wav"); // ricochet (used in c code)
- precache_sound ("weapons/ric2.wav"); // ricochet (used in c code)
- precache_sound ("weapons/ric3.wav"); // ricochet (used in c code)
- precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code)
- precache_sound ("weapons/grenade.wav"); // grenade launcher
- precache_sound ("weapons/bounce.wav"); // grenade bounce
- };
-
- float() crandom =
- {
- return 2*(random() - 0.5);
- };
-
- //============================================================================
-
-
- vector() wall_velocity =
- {
- local vector vel;
-
- vel = normalize (self.velocity);
- vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5));
- vel = vel + 2*trace_plane_normal;
- vel = vel * 200;
-
- return vel;
- };
-
-
- /*
- ================
- SpawnMeatSpray
- ================
- */
- void(vector org, vector vel) SpawnMeatSpray =
- {
- local entity missile, mpuff;
- local vector org;
-
- missile = spawn ();
- missile.owner = self;
- missile.movetype = MOVETYPE_BOUNCE;
- missile.solid = SOLID_NOT;
-
- makevectors (self.angles);
-
- missile.velocity = vel;
- missile.velocity_z = missile.velocity_z + 250 + 50*random();
-
- missile.avelocity = '3000 1000 2000';
-
- // set missile duration
- missile.nextthink = time + 1;
- missile.think = SUB_Remove;
-
- setmodel (missile, "progs/zom_gib.mdl");
- setsize (missile, '0 0 0', '0 0 0');
- setorigin (missile, org);
- };
-
- /*
- ================
- SpawnBlood
- ================
- */
- void(vector org, vector vel, float damage) SpawnBlood =
- {
- particle (org, vel*0.1, 73, damage*2);
- };
-
- /*
- ================
- spawn_touchblood
- ================
- */
- void(float damage) spawn_touchblood =
- {
- local vector vel;
-
- vel = wall_velocity () * 0.2;
- SpawnBlood (self.origin + vel*0.01, vel, damage);
- };
-
-
- /*
- ================
- SpawnChunk
- ================
- */
- void(vector org, vector vel) SpawnChunk =
- {
- particle (org, vel*0.02, 0, 10);
- };
-
- /*
- ==============================================================================
-
- MULTI-DAMAGE
-
- Collects multiple small damages into a single damage
-
- ==============================================================================
- */
-
- entity multi_ent;
- float multi_damage;
-
- void() ClearMultiDamage =
- {
- multi_ent = world;
- multi_damage = 0;
- };
-
- void() ApplyMultiDamage =
- {
- if (!multi_ent)
- return;
- T_Damage (multi_ent, self, self, multi_damage);
- };
-
- void(entity hit, float damage) AddMultiDamage =
- {
- if (!hit)
- return;
-
- if (hit != multi_ent)
- {
- ApplyMultiDamage ();
- multi_damage = damage;
- multi_ent = hit;
- }
- else
- multi_damage = multi_damage + damage;
- };
-
- /*
- ==============================================================================
-
- BULLETS
-
- ==============================================================================
- */
-
- /*
- ================
- TraceAttack
- ================
- */
- void(float damage, vector dir) TraceAttack =
- {
- local vector vel, org;
-
- vel = normalize(dir + v_up*crandom() + v_right*crandom());
- vel = vel + 2*trace_plane_normal;
- vel = vel * 200;
-
- org = trace_endpos - dir*4;
-
- if (trace_ent.takedamage)
- {
- SpawnBlood (org, vel*0.2, damage);
- AddMultiDamage (trace_ent, damage);
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_GUNSHOT);
- WriteCoord (MSG_BROADCAST, org_x);
- WriteCoord (MSG_BROADCAST, org_y);
- WriteCoord (MSG_BROADCAST, org_z);
- }
- };
-
- /*
- ================
- FireBullets
-
- Used by shotgun, super shotgun, and enemy soldier firing
- Go to the trouble of combining multiple pellets into a single damage call.
- ================
- */
- void(float shotcount, vector dir, vector spread) FireBullets =
- {
- local vector direction;
- local vector src;
-
- makevectors(self.v_angle);
-
- src = self.origin + v_forward*10;
- src_z = self.absmin_z + self.size_z * 0.7;
-
- ClearMultiDamage ();
- while (shotcount > 0)
- {
- direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up;
-
- traceline (src, src + direction*2048, FALSE, self);
- if (trace_fraction != 1.0)
- TraceAttack (4, direction);
-
- shotcount = shotcount - 1;
- }
- ApplyMultiDamage ();
- };
-
-
- //=============================================================================
-
- void() s_explode1 = [0, s_explode2] {};
- void() s_explode2 = [1, s_explode3] {};
- void() s_explode3 = [2, s_explode4] {};
- void() s_explode4 = [3, s_explode5] {};
- void() s_explode5 = [4, s_explode6] {};
- void() s_explode6 = [5, SUB_Remove] {};
-
- void() BecomeExplosion =
- {
- self.movetype = MOVETYPE_NONE;
- self.velocity = '0 0 0';
- self.touch = SUB_Null;
- setmodel (self, "progs/s_explod.spr");
- self.solid = SOLID_NOT;
- s_explode1 ();
- };
-
- void() T_MissileTouch =
- {
- local float damg;
-
- if (other == self.owner)
- return; // don't explode on owner
-
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
-
- damg = 100 + random()*20;
-
- if (other.health)
- {
- if (other.classname == "monster_shambler")
- damg = damg * 0.5; // mostly immune
- T_Damage (other, self, self.owner, damg );
- }
-
- // don't do radius damage to the other, because all the damage
- // was done in the impact
- T_RadiusDamage (self, self.owner, 120, other);
-
- // sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
- self.origin = self.origin - 8*normalize(self.velocity);
-
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_EXPLOSION);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
-
- BecomeExplosion ();
- };
-
- void() spike_touch;
-
-
- /*
- ===============
- launch_spike
-
- Used for both the player and the ogre
- ===============
- */
- void(vector org, vector dir) launch_spike =
- {
- newmis = spawn ();
- newmis.owner = self;
- newmis.movetype = MOVETYPE_FLYMISSILE;
- newmis.solid = SOLID_BBOX;
-
- newmis.angles = vectoangles(dir);
-
- newmis.touch = spike_touch;
- newmis.classname = "spike";
- newmis.think = SUB_Remove;
- newmis.nextthink = time + 6;
- setmodel (newmis, "progs/spike.mdl");
- setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
- setorigin (newmis, org);
-
- newmis.velocity = dir * 1000;
- };
-
- void(float ox) W_FireSpikes =
- {
- local vector dir;
- local entity old;
-
- makevectors (self.v_angle);
-
-
- if (self.ammo_nails < 1)
- {
- W_SetCurrentAmmo ();
- return;
- }
-
- sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
- self.attack_finished = time + 0.2;
- self.currentammo = self.ammo_nails = self.ammo_nails - 1;
- dir = aim (self, 1000);
- launch_spike (self.origin + '0 0 16' + v_right*ox, dir);
-
- self.punchangle_x = -2;
- };
-
-
-
- .float hit_z;
- void() spike_touch =
- {
- local float rand;
- if (other == self.owner)
- return;
-
- if (other.solid == SOLID_TRIGGER)
- return; // trigger field, do nothing
-
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
-
- // hit something that bleeds
- if (other.takedamage)
- {
- spawn_touchblood (9);
- T_Damage (other, self, self.owner, 9);
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
-
- if (self.classname == "wizspike")
- WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
- else if (self.classname == "knightspike")
- WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
- else
- WriteByte (MSG_BROADCAST, TE_SPIKE);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- }
-
- remove(self);
-
- };
- void() superspike_touch =
- {
- local float rand;
- if (other == self.owner)
- return;
-
- if (other.solid == SOLID_TRIGGER)
- return; // trigger field, do nothing
-
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
-
- // hit something that bleeds
- if (other.takedamage)
- {
- spawn_touchblood (18);
- T_Damage (other, self, self.owner, 18);
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_SUPERSPIKE);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- }
-
- remove(self);
-
- };
-
-
- /*
- ===============
- launch_magic (Scrag)
- ===============
- */
- void(vector org, vector dir) launch_magic =
- {
- newmis = spawn ();
- newmis.owner = self;
- newmis.movetype = MOVETYPE_FLYMISSILE;
- newmis.solid = SOLID_BBOX;
-
- newmis.angles = vectoangles(dir);
-
- newmis.touch = spike_touch;
- newmis.classname = "wizspike";
- newmis.think = SUB_Remove;
- newmis.nextthink = time + 6;
- setmodel (newmis, "progs/w_spike.mdl");
- setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
- setorigin (newmis, org);
-
- newmis.velocity = dir * 1400;
- };
-
- void(vector arm) FireMagic =
- {
- local vector dir, arm;
- local entity old;
-
- makevectors (self.v_angle);
-
- self.attack_finished = time + 0.2;
- dir = aim (self, 1000);
- launch_magic (self.origin + arm, dir);
-
- self.punchangle_x = -2;
- };
-
-
-
- .float hit_z;
- void() magic_touch =
- {
- local float rand;
- if (other == self.owner)
- return;
-
- if (other.solid == SOLID_TRIGGER)
- return; // trigger field, do nothing
-
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
-
- // hit something that bleeds
- if (other.takedamage)
- {
- spawn_touchblood (9);
- T_Damage (other, self, self.owner, 9);
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
-
- WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- }
-
- remove(self);
-
- };
- void() laser_touch;
-
- /*
- ===============
- launch_laser (Enforcer)
-
- ===============
- */
- void(vector org, vector dir) launch_laser =
- {
- newmis = spawn ();
- newmis.owner = self;
- newmis.movetype = MOVETYPE_FLYMISSILE;
- newmis.solid = SOLID_BBOX;
-
- newmis.angles = vectoangles(dir);
-
- newmis.touch = laser_touch;
- newmis.classname = "spike";
- newmis.think = SUB_Remove;
- newmis.nextthink = time + 6;
- setmodel (newmis, "progs/laser.mdl");
- setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
- setorigin (newmis, org);
-
- newmis.velocity = dir * 2000;
- };
-
- void() FireLaser =
- {
- local vector dir, arm;
- local entity old;
-
- makevectors (self.v_angle);
-
- self.attack_finished = time + 0.2;
- dir = aim (self, 1000);
- sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
- launch_laser (self.origin + '0 0 16', dir);
-
- self.punchangle_x = -3;
- };
-
-
-
- .float hit_z;
- void() laser_touch =
- {
- local float rand;
- if (other == self.owner)
- return;
-
- if (other.solid == SOLID_TRIGGER)
- return; // trigger field, do nothing
-
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
-
- sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC);
-
- // hit something that bleeds
- if (other.takedamage)
- {
- spawn_touchblood (15);
- T_Damage (other, self, self.owner, 15);
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
-
- WriteByte (MSG_BROADCAST, TE_GUNSHOT);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- }
-
- remove(self);
-
- };
- /*
- ===============================================================================
-
- LIGHTNING
-
- ===============================================================================
- */
-
- /*
- =================
- LightningDamage
- =================
- */
- void(vector p1, vector p2, entity from, float damage) LightningDamage =
- {
- local entity e1, e2;
- local vector f;
-
- f = p2 - p1;
- normalize (f);
- f_x = 0 - f_y;
- f_y = f_x;
- f_z = 0;
- f = f*16;
-
- e1 = e2 = world;
-
- traceline (p1, p2, FALSE, self);
- if (trace_ent.takedamage)
- {
- particle (trace_endpos, '0 0 100', 225, damage*4);
- T_Damage (trace_ent, from, from, damage);
- if (self.classname == "player")
- {
- if (other.classname == "player")
- trace_ent.velocity_z = trace_ent.velocity_z + 400;
- }
- }
- e1 = trace_ent;
-
- traceline (p1 + f, p2 + f, FALSE, self);
- if (trace_ent != e1 && trace_ent.takedamage)
- {
- particle (trace_endpos, '0 0 100', 225, damage*4);
- T_Damage (trace_ent, from, from, damage);
- }
- e2 = trace_ent;
-
- traceline (p1 - f, p2 - f, FALSE, self);
- if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage)
- {
- particle (trace_endpos, '0 0 100', 225, damage*4);
- T_Damage (trace_ent, from, from, damage);
- }
- };
-
-
- void() W_FireLightning =
- {
- local vector org;
-
- if (self.ammo_cells < 1)
- {
- self.weapon = W_BestWeapon ();
- W_SetCurrentAmmo ();
- return;
- }
-
- // explode if under water
- if (self.waterlevel > 1)
- {
- T_RadiusDamage (self, self, 35*self.ammo_cells, world);
- self.ammo_cells = 0;
- W_SetCurrentAmmo ();
- return;
- }
-
- if (self.t_width < time)
- {
- sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
- self.t_width = time + 0.6;
- }
- self.punchangle_x = -2;
-
- self.currentammo = self.ammo_cells = self.ammo_cells - 1;
-
- org = self.origin + '0 0 16';
-
- traceline (org, org + v_forward*600, TRUE, self);
-
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
- WriteEntity (MSG_BROADCAST, self);
- WriteCoord (MSG_BROADCAST, org_x);
- WriteCoord (MSG_BROADCAST, org_y);
- WriteCoord (MSG_BROADCAST, org_z);
- WriteCoord (MSG_BROADCAST, trace_endpos_x);
- WriteCoord (MSG_BROADCAST, trace_endpos_y);
- WriteCoord (MSG_BROADCAST, trace_endpos_z);
-
- LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);
- };
-
-
-
-
- /*
- ===============================================================================
-
- PLAYER WEAPON USE
-
- ===============================================================================
- */
-
- void() W_SetCurrentAmmo =
- {
- player_run (); // get out of any weapon firing states
-
- if (self.effects & EF_WIZARD)
- {
- self.currentammo = 0;
- self.weaponmodel = "";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_DEMON)
- {
- self.currentammo = 0;
- self.weaponmodel = "";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_GRUNT)
- {
- self.currentammo = 0;
- self.weaponmodel = "progs/v_shot.mdl";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_ENFORCER)
- {
- self.currentammo = 0;
- self.weaponmodel = "progs/v_nail2.mdl";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_KNIGHT)
- {
- self.currentammo = 0;
- self.weaponmodel = "progs/v_axe.mdl";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_HKNIGHT)
- {
- self.currentammo = 0;
- self.weaponmodel = "progs/v_axe.mdl";
- self.weaponframe = 0;
- }
- else if (self.effects & EF_OGRE)
- {
- self.currentammo = 0;
- self.weaponmodel = "progs/v_rock.mdl";
- self.weaponframe = 0;
- }
-
- else
- {
- self.currentammo = 0;
- self.weaponmodel = "";
- self.weaponframe = 0;
- }
- };
-
- float() W_BestWeapon =
- {
- return IT_AXE;
- };
-
-
- float() W_CheckNoAmmo =
- {
- if (self.currentammo > 0)
- return TRUE;
-
- if (self.weapon == IT_AXE)
- return TRUE;
-
- W_SetCurrentAmmo ();
-
- // drop the weapon down
- return FALSE;
- };
-
- /*
- ============
- W_Attack
-
- An attack impulse can be triggered now
- ============
- */
- void() player_dattack;
- void() player_gattack;
- void() player_kattack;
- void() player_oattack;
- void() player_ogren;
- void() player_wattack;
- void() player_eattack;
- void() player_hkattack;
- void() player_hksword;
- void() player_sattack;
-
-
- void() W_Attack =
- {
- local float r;
-
- makevectors (self.v_angle); // calculate forward angle for velocity
- self.show_hostile = time + 1; // wake monsters up
-
- if (self.effects & EF_DEMON)
- {
- player_dattack();
- self.attack_finished = time + 1.0;
- }
- else if (self.effects & EF_WIZARD)
- {
- player_wattack();
- self.attack_finished = time + 1.9;
- }
- else if (self.effects & EF_SHALRATH)
- {
- player_sattack();
- self.attack_finished = time + 2.0;
- }
- else if (self.effects & EF_GRUNT)
- {
- player_gattack();
- self.attack_finished = time + 0.7;
- }
- else if (self.effects & EF_ENFORCER)
- {
- player_eattack();
- self.attack_finished = time + 0.5;
- }
- else if (self.effects & EF_KNIGHT)
- {
- player_kattack();
- self.attack_finished = time + 1.0;
- }
- else if (self.effects & EF_HKNIGHT)
- {
- player_hksword();
- self.attack_finished = time + 1.0;
- }
- else if (self.effects & EF_OGRE)
- {
- player_oattack();
- self.attack_finished = time + 1.0;
- }
- };
-
- /*
- ============
- W_ChangeWeapon
-
- ============
- */
- void() W_ChangeWeapon =
- {
- return; // don't need it
- };
-
- /*
- ============
- CheatCommand
- ============
- */
- void() CheatCommand =
- {
- if (deathmatch || coop)
- return;
-
- self.items = self.items | IT_KEY1 | IT_KEY2;
- self.impulse = 0;
- W_SetCurrentAmmo ();
- };
-
- /*
- ============
- CycleWeaponCommand
-
- Go to the next weapon with ammo
- ============
- */
- void() CycleWeaponCommand =
- {
- return;
- };
-
- /*
- ============
- ServerflagsCommand
-
- Just for development
- ============
- */
- void() ServerflagsCommand =
- {
- serverflags = serverflags * 2 + 1;
- };
-
- void() QuadCheat =
- {
- if (deathmatch || coop)
- return;
- self.super_time = 1;
- self.super_damage_finished = time + 30;
- self.items = self.items | IT_QUAD;
- dprint ("quad cheat\n");
- };
-
- /*
- ==================
- FireAlternate
- ==================
- */
- void() FireAlternate =
- {
- if(self.effects & EF_OGRE)
- {
- player_ogren();
- self.attack_finished = time + 1.0;
- }
- else if(self.effects & EF_HKNIGHT)
- {
- player_hkattack();
- self.attack_finished = time + 1.0;
- }
-
- };
-
-
- /*
- ============
- ImpulseCommands
-
- ============
- */
- void() ImpulseCommands =
- {
- if (self.impulse >= 1 && self.impulse <= 8)
- W_ChangeWeapon ();
-
- if (self.impulse == 9)
- CheatCommand ();
- if (self.impulse == 11)
- ServerflagsCommand ();
-
- if (self.impulse == 20)
- FireAlternate();
-
- if (self.impulse == 255)
- QuadCheat ();
-
- self.impulse = 0;
- };
-
- /*
- ============
- W_WeaponFrame
-
- Called every frame so impulse events can be handled as well as possible
- ============
- */
- void() W_WeaponFrame =
- {
- if (time < self.attack_finished)
- return;
-
- ImpulseCommands ();
-
- // check for attack
- if (self.button0)
- {
- SuperDamageSound ();
- W_Attack ();
- }
- };
-
- /*
- ========
- SuperDamageSound
-
- Plays sound if needed
- ========
- */
- void() SuperDamageSound =
- {
- if (self.super_damage_finished > time)
- {
- if (self.super_sound < time)
- {
- self.super_sound = time + 1;
- sound (self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM);
- }
- }
- return;
- };
-
-
-
-