}
self = oldself;
-
+
// TODO spawn particle effects and sounds based on w_deathtype
+ if(DEATH_ISTURRET(w_deathtype))
+ {
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ if(trace_plane_normal != '0 0 0')
+ w_backoff = trace_plane_normal;
+ else
+ w_backoff = -1 * normalize(w_org - (w_org + normalize(force) * 16));
+
+ setorigin(self, w_org + w_backoff * 2); // for sound() calls
+
+ switch(w_deathtype)
+ {
+ case DEATH_TURRET_EWHEEL:
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
+ pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
+ break;
+
+ case DEATH_TURRET_FLAC:
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if (w_random<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
+ else if (w_random<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
+
+ break;
+
+ case DEATH_TURRET_MLRS:
+ case DEATH_TURRET_HK:
+ case DEATH_TURRET_WALKER_ROCKET:
+ case DEATH_TURRET_HELLION:
+ sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
+ break;
+
+ case DEATH_TURRET_MACHINEGUN:
+ case DEATH_TURRET_WALKER_GUN:
+ string _snd;
+ _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
+ sound(self, CHAN_PROJECTILE, _snd, VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
+ break;
+
+ case DEATH_TURRET_PLASMA:
+ sound(self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_MIN);
+ pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
+ break;
+
+ case DEATH_TURRET_WALKER_MEELE:
+ sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_MIN);
+ pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
+ break;
+
+ case DEATH_TURRET_PHASER:
+ break;
+
+ case DEATH_TURRET_TESLA:
+ te_smallflash(self.origin);
+ break;
+
+ }
+ }
if(!DEATH_ISSPECIAL(w_deathtype))
{
float DEATH_TOUCHEXPLODE = 10015;
float DEATH_CHEAT = 10016;
float DEATH_FIRE = 10017;
-float DEATH_TURRET = 10020;
float DEATH_QUIET = 10021;
float DEATH_HEADSHOT = 10022;
float DEATH_CUSTOM = 10300;
+float DEATH_TURRET = 10500;
+float DEATH_TURRET_EWHEEL = 10501;
+float DEATH_TURRET_FLAC = 10502;
+float DEATH_TURRET_MACHINEGUN = 10503;
+float DEATH_TURRET_WALKER_GUN = 10504;
+float DEATH_TURRET_WALKER_MEELE = 10505;
+float DEATH_TURRET_WALKER_ROCKET = 10506;
+float DEATH_TURRET_HELLION = 10507;
+float DEATH_TURRET_HK = 10508;
+float DEATH_TURRET_MLRS = 10509;
+float DEATH_TURRET_PLASMA = 10510;
+float DEATH_TURRET_PHASER = 10511;
+float DEATH_TURRET_TESLA = 10512;
+float DEATH_TURRET_LAST = 10512;
float DEATH_WEAPONMASK = 0xFF;
float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
float HITTYPE_RESERVED = 0x1000; // unused yet
// macros to access these
+#define DEATH_ISTURRET(t) ((t) >= DEATH_TURRET && (t) <= DEATH_TURRET_LAST)
#define DEATH_ISSPECIAL(t) ((t) >= DEATH_SPECIAL_START)
#define DEATH_WEAPONOFWEAPONDEATH(t) ((t) & DEATH_WEAPONMASK)
#define DEATH_ISWEAPON(t,w) (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
void turret_ewheel_projectile_explode()
{
- vector org2;
-
- org2 = findbetterlocation (self.origin, 8);
- pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
- //w_deathtypestring = "saw the eweel. to late.";
#ifdef TURRET_DEBUG
float d;
- d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_EWHEEL, world);
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
#else
- RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_EWHEEL, world);
#endif
- sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
remove (self);
}
void turret_flac_projectile_explode()
{
- float ftmp;
-
if( (self.enemy != world) &&
(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3) )
{
// OMG HAXX!
setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
}
-
- te_explosion (self.origin);
-
- ftmp = crandom();
- if (ftmp<-0.7)
- sound (self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
- else if (ftmp<0.4)
- sound (self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
- else if (ftmp<1)
- sound (self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
-
-
self.event_damage = SUB_Null;
-
#ifdef TURRET_DEBUG
- ftmp = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ float ftmp;
+ ftmp = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_FLAC, world);
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + ftmp; //self.owner.shot_dmg;
self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
#else
- RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_FLAC, world);
#endif
remove (self);
void turret_hellion_missile_explode()
{
- vector org2;
float d;
if(self.event_damage != SUB_Null)
return;
}
- sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = findbetterlocation (self.origin, 16);
-
- // LordHavoc: TE_TEI_BIGEXPLOSION
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, 78);
- WriteCoord (MSG_BROADCAST, org2_x);
- WriteCoord (MSG_BROADCAST, org2_y);
- WriteCoord (MSG_BROADCAST, org2_z);
-
- //w_deathtypestring = "could not dodge the twin missiles.";
self.event_damage = SUB_Null;
- d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_HELLION, world);
#ifdef TURRET_DEBUG
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
void turret_hk_missile_explode()
{
- vector org2;
float d;
if(self.event_damage != SUB_Null)
if ((other == self.owner)||(other == self.owner.tur_head))
return;
- //w_deathtypestring = "got hunted to extinction";
- //vector org2;
- sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = findbetterlocation (self.origin, 16);
-
- // LordHavoc: TE_TEI_BIGEXPLOSION
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, 78);
- WriteCoord (MSG_BROADCAST, org2_x);
- WriteCoord (MSG_BROADCAST, org2_y);
- WriteCoord (MSG_BROADCAST, org2_z);
-
self.event_damage = SUB_Null;
- d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_HK, world);
#ifdef TURRET_DEBUG
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
//.float bulletcounter;
void turret_machinegun_attack()
{
- sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
- //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
- te_smallflash(self.tur_shotorg);
-
UziFlash();
setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
}
void turret_mlrs_rocket_explode()
{
- vector org2;
if(self.event_damage != SUB_Null)
{
return;
}
-
- sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = findbetterlocation (self.origin, 16);
- pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
- //w_deathtypestring = "dident escape the rocket barrage";
#ifdef TURRET_DEBUG
float d;
- d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
#else
- RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg * 0.5, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_MLRS, world);
#endif
// Target dead, Tell turret.
self.shot_force,
oldself.shot_dmg,
0.75,
- DEATH_TURRET);
+ DEATH_TURRET_PHASER);
self = oldself;
self.scale = vlen(self.owner.tur_shotorg - trace_endpos) / 256;
void turret_plasma_projectile_explode()
{
- vector org2;
-
- org2 = findbetterlocation (self.origin, 8);
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, 79);
- WriteCoord (MSG_BROADCAST, org2_x);
- WriteCoord (MSG_BROADCAST, org2_y);
- WriteCoord (MSG_BROADCAST, org2_z);
- WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter
- WriteCoord (MSG_BROADCAST, 0);
- WriteCoord (MSG_BROADCAST, 0);
- WriteByte (MSG_BROADCAST, 155);
-
self.event_damage = SUB_Null;
//w_deathtypestring = "ate to much plasma";
#ifdef TURRET_DEBUG
float d;
- d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d; //self.owner.shot_dmg;
self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
#else
- RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
+ RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET_PLASMA, world);
#endif
- sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
remove (self);
}
}
if (etarget)
- {
- te_smallflash(etarget.origin);
+ {
te_csqc_lightningarc(from.origin,etarget.origin);
- dprint("DMG:",ftos(damage),"\n");
- Damage(etarget, self, self, damage, DEATH_TURRET, etarget.origin, '0 0 0');
+ Damage(etarget, self, self, damage, DEATH_TURRET_TESLA, etarget.origin, '0 0 0');
etarget.railgunhit = 1;
}
{
if (turret_validate_target(self,e,self.target_validate_flags))
if (e != self && e.owner != self)
- Damage(e, self, self, autocvar_g_turrets_unit_walker_std_meele_dmg ,DEATH_TURRET,'0 0 0', v_forward * autocvar_g_turrets_unit_walker_std_meele_force);
+ Damage(e, self, self, autocvar_g_turrets_unit_walker_std_meele_dmg ,DEATH_TURRET_WALKER_MEELE,'0 0 0', v_forward * autocvar_g_turrets_unit_walker_std_meele_force);
e = e.chain;
}
}
void walker_rocket_explode()
{
- vector org2;
-
if (self.event_damage != SUB_Null)
{
self.event_damage = SUB_Null;
return;
}
- sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = findbetterlocation (self.origin, 16);
-
- pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
- RadiusDamage (self, self.owner, autocvar_g_turrets_unit_walker_std_rocket_dmg, 0, autocvar_g_turrets_unit_walker_std_rocket_radius, world,autocvar_g_turrets_unit_walker_std_rocket_force, DEATH_TURRET, world);
+ RadiusDamage (self, self.owner, autocvar_g_turrets_unit_walker_std_rocket_dmg, 0, autocvar_g_turrets_unit_walker_std_rocket_radius, world,autocvar_g_turrets_unit_walker_std_rocket_force, DEATH_TURRET_WALKER_ROCKET, world);
remove (self);
}
void walker_attack()
{
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
- fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
+ fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET_WALKER_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
}