// only for Porto
float angles_held_status;
vector angles_held;
+
+// weapons
+.float silent;
+
+float w_deathtype, w_issilent, w_random;
+string w_deathtypestring;
+vector w_org, w_backoff;
+
-.float silent;
-
-float w_deathtype, w_issilent, w_random;
-vector w_org, w_backoff;
-
void Ent_DamageInfo(float isNew)
{
float dmg, rad, edge, thisdmg, forcemul;
string Weapon_SuicideMessage(float deathtype)
{
- float w;
- w = DEATH_WEAPONOF(deathtype);
-
- switch (w)
- {
- case 1:
- return "lasered himself to hell";
- case 2:
- return "did the impossible";
- case 3:
- return "did the impossible";
- case 4:
- if(deathtype & HITTYPE_SECONDARY)
- return "tried out his own grenade";
- return "detonated";
- }
- // TODO: was blasted by?
- return strcat("[no kill message for weapon ", ftos(w), "!]");
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_SUICIDEMESSAGE);
+ return w_deathtypestring;
}
string Weapon_KillMessage(float deathtype)
{
- float w;
- w = DEATH_WEAPONOF(deathtype);
-
- switch (w)
- {
- case 1:
- return "was lasered to death by";
- case 2:
- return "was gunned by";
- case 3:
- if(deathtype & HITTYPE_SECONDARY)
- return "was sniped by";
- return "was riddled full of holes by";
- case 4:
- if(deathtype & HITTYPE_BOUNCE)
- return "didn't see #'s grenade";
- return "almost dodged #'s grenade";
- }
- return strcat("[no suicide message for weapon ", ftos(w), "!]");
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_KILLMESSAGE);
+ return w_deathtypestring;
}
float killnotify_times[10];
return self.ammo_nails >= cvar("g_balance_campingrifle_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_nails >= cvar("g_balance_campingrifle_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "shot themself automatically";
- else
- w_deathtypestring = "sniped themself somehow";
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- w_deathtypestring = "failed to hide from #'s bullet hail";
- else
- w_deathtypestring = "died in #'s bullet hail";
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- {
- // TODO special headshot message here too?
- w_deathtypestring = "failed to hide from #'s rifle";
- }
- else
- {
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = "got hit in the head by #";
- else
- w_deathtypestring = "was sniped by #";
- }
- }
- }
else if (req == WR_RELOAD)
{
W_CampingRifle_Reload();
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "shot themself automatically";
+ else
+ w_deathtypestring = "sniped themself somehow";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ w_deathtypestring = "failed to hide from #'s bullet hail";
+ else
+ w_deathtypestring = "died in #'s bullet hail";
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ // TODO special headshot message here too?
+ w_deathtypestring = "failed to hide from #'s rifle";
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_HEADSHOT)
+ w_deathtypestring = "got hit in the head by #";
+ else
+ w_deathtypestring = "was sniped by #";
+ }
+ }
+ }
return TRUE;
}
#endif
return self.ammo_cells >= cvar("g_balance_crylink_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- {
- w_deathtypestring = "succeeded at self-destructing themself with the Crylink";
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- w_deathtypestring = "could not hide from #'s Crylink"; // unchecked: SPLASH (SECONDARY can't be)
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = "was too close to #'s Crylink"; // unchecked: SECONDARY
- else
- w_deathtypestring = "took a close look at #'s Crylink"; // unchecked: SECONDARY
- }
return TRUE;
};
#endif
precache_sound("weapons/crylink_impact2.wav");
precache_sound("weapons/crylink_impact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ w_deathtypestring = "succeeded at self-destructing themself with the Crylink";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ w_deathtypestring = "could not hide from #'s Crylink"; // unchecked: SPLASH (SECONDARY can't be)
+ else if(w_deathtype & HITTYPE_SPLASH)
+ w_deathtypestring = "was too close to #'s Crylink"; // unchecked: SECONDARY
+ else
+ w_deathtypestring = "took a close look at #'s Crylink"; // unchecked: SECONDARY
+ }
return TRUE;
}
#endif
return self.ammo_cells >= cvar("g_balance_electro_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_electro_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "could not remember where they put plasma";
- else
- w_deathtypestring = "played with plasma";
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
- w_deathtypestring = "just noticed #'s blue ball";
- else // unchecked: BOUNCE
- w_deathtypestring = "got in touch with #'s blue ball";
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE) // combo
- w_deathtypestring = "felt the electrifying air of #'s combo";
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = "got too close to #'s blue beam";
- else
- w_deathtypestring = "was blasted by #'s blue beam";
- }
- }
else if (req == WR_RESETPLAYER)
{
self.electro_secondarytime = time;
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "could not remember where they put plasma";
+ else
+ w_deathtypestring = "played with plasma";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
+ w_deathtypestring = "just noticed #'s blue ball";
+ else // unchecked: BOUNCE
+ w_deathtypestring = "got in touch with #'s blue ball";
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE) // combo
+ w_deathtypestring = "felt the electrifying air of #'s combo";
+ else if(w_deathtype & HITTYPE_SPLASH)
+ w_deathtypestring = "got too close to #'s blue beam";
+ else
+ w_deathtypestring = "was blasted by #'s blue beam";
+ }
+ }
return TRUE;
}
#endif
return self.ammo_fuel >= cvar("g_balance_fireball_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_fuel >= cvar("g_balance_fireball_secondary_ammo");
+ else if (req == WR_RESETPLAYER)
+ {
+ self.fireball_primarytime = time;
+ }
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_fireball(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ // firemine goes out silently
+ }
+ else
+ {
+ org2 = w_org + w_backoff * 16;
+ pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+ }
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/fireball_impact.wav");
+ precache_sound("weapons/fireball_impact2.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
{
if(w_deathtype & HITTYPE_SECONDARY)
w_deathtypestring = "tasted #'s fireball";
}
}
- else if (req == WR_RESETPLAYER)
- {
- self.fireball_primarytime = time;
- }
- return TRUE;
-};
-#endif
-#ifdef CSQC
-float w_fireball(float req)
-{
- if(req == WR_IMPACTEFFECT)
- {
- vector org2;
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- // firemine goes out silently
- }
- else
- {
- org2 = w_org + w_backoff * 16;
- pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
- if(!w_issilent)
- sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
- }
- }
- else if(req == WR_PRECACHE)
- {
- precache_sound("weapons/fireball_impact.wav");
- precache_sound("weapons/fireball_impact2.wav");
- }
return TRUE;
}
#endif
return self.ammo_rockets >= cvar("g_balance_grenadelauncher_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_rockets >= cvar("g_balance_grenadelauncher_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "tried out his own grenade";
- else
- w_deathtypestring = "detonated";
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SPLASH)
- if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
- w_deathtypestring = "didn't see #'s grenade";
- else // unchecked: SECONDARY
- w_deathtypestring = "almost dodged #'s grenade";
- else // unchecked: SECONDARY, BOUNCE
- w_deathtypestring = "ate #'s grenade";
- }
return TRUE;
};
#endif
{
precache_sound("weapons/grenade_impact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "tried out his own grenade";
+ else
+ w_deathtypestring = "detonated";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SPLASH)
+ if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
+ w_deathtypestring = "didn't see #'s grenade";
+ else // unchecked: SECONDARY
+ w_deathtypestring = "almost dodged #'s grenade";
+ else // unchecked: SECONDARY, BOUNCE
+ w_deathtypestring = "ate #'s grenade";
+ }
return TRUE;
}
#endif
return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "played with tiny rockets";
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
- w_deathtypestring = "hoped #'s missiles wouldn't bounce";
- else // unchecked: SPLASH, SECONDARY
- w_deathtypestring = "was pummeled by";
- }
return TRUE;
};
#endif
precache_sound("weapons/hagexp2.wav");
precache_sound("weapons/hagexp3.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "played with tiny rockets";
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
+ w_deathtypestring = "hoped #'s missiles wouldn't bounce";
+ else // unchecked: SPLASH, SECONDARY
+ w_deathtypestring = "was pummeled by";
+ }
return TRUE;
}
#endif
return self.ammo_cells >= cvar("g_balance_hlac_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_cells >= cvar("g_balance_hlac_secondary_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "should have used a smaller gun";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "was cut down by";
return TRUE;
};
#endif
{
precache_sound("weapons/laserimpact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "should have used a smaller gun";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "was cut down by";
return TRUE;
}
#endif
{
return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has run into #'s gravity bomb";
else if (req == WR_RESETPLAYER)
{
self.hook_refire = time;
{
precache_sound("weapons/hookbomb_impact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "has run into #'s gravity bomb";
return TRUE;
}
#endif
return TRUE;
else if (req == WR_CHECKAMMO2)
return TRUE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "lasered themself to hell";
- else if (req == WR_KILLMESSAGE)
- {
- w_deathtypestring = "was lasered to death by"; // unchecked: SPLASH
- }
return TRUE;
};
#endif
{
precache_sound("weapons/laserimpact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "lasered themself to hell";
+ else if (req == WR_KILLMESSAGE)
+ {
+ w_deathtypestring = "was lasered to death by"; // unchecked: SPLASH
+ }
return TRUE;
}
#endif
}
else if (req == WR_CHECKAMMO2)
return TRUE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has been vaporized by";
else if (req == WR_RESETPLAYER)
{
self.minstanex_lasthit = 0;
{
precache_sound("weapons/neximpact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "has been vaporized by";
return TRUE;
}
#endif
return self.ammo_cells >= cvar("g_balance_nex_ammo");
else if (req == WR_CHECKAMMO2)
return FALSE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "has been vaporized by";
return TRUE;
};
#endif
{
precache_sound("weapons/neximpact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "has been vaporized by";
return TRUE;
}
#endif
}
else if (req == WR_SETUP)
weapon_setup(WEP_PORTO);
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "felt # doing the impossible to him";
else if (req == WR_RESETPLAYER)
{
self.porto_current = world;
{
// nothing to do
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ w_deathtypestring = "felt # doing the impossible to him";
return TRUE;
}
#endif
}
else if (req == WR_CHECKAMMO2)
return FALSE;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "exploded";
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
- w_deathtypestring = "got too close to #'s rocket";
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = "almost dodged #'s rocket";
- else
- w_deathtypestring = "ate #'s rocket";
- }
else if (req == WR_RESETPLAYER)
{
self.rl_release = 0;
{
precache_sound("weapons/rocket_impact.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "exploded";
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
+ w_deathtypestring = "got too close to #'s rocket";
+ else if(w_deathtype & HITTYPE_SPLASH)
+ w_deathtypestring = "almost dodged #'s rocket";
+ else
+ w_deathtypestring = "ate #'s rocket";
+ }
return TRUE;
}
#endif
return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3;
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- {
- w_deathtypestring = "was gunned by"; // unchecked: SECONDARY
- }
return TRUE;
};
#endif
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ {
+ w_deathtypestring = "was gunned by"; // unchecked: SECONDARY
+ }
return TRUE;
}
#endif
return TRUE; // TODO use fuel?
else if (req == WR_CHECKAMMO2)
return TRUE; // TODO use fuel?
- else if (req == WR_SUICIDEMESSAGE)
- {
- w_deathtypestring = "hurt his own ears with the @!#%'n Tuba";
- }
- else if (req == WR_KILLMESSAGE)
- {
- w_deathtypestring = "died of #'s great playing on the @!#%'n Tuba";
- }
return TRUE;
};
#endif
{
// nothing to do
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ w_deathtypestring = "hurt his own ears with the @!#%'n Tuba";
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ w_deathtypestring = "died of #'s great playing on the @!#%'n Tuba";
+ }
return TRUE;
}
#endif
return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
else if (req == WR_CHECKAMMO2)
return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "did the impossible";
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = "was sniped by";
- else
- w_deathtypestring = "was riddled full of holes by";
- }
return TRUE;
};
#endif
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "did the impossible";
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "was sniped by";
+ else
+ w_deathtypestring = "was riddled full of holes by";
+ }
return TRUE;
}
#endif