- if(g_minstagib)
- if(self.ammo_cells <= 0)
- return;
-
- if(g_pinata)
- {
- float j;
- for(j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- if(WEPSET_CONTAINS_EW(self, j))
- if(W_IsWeaponThrowable(j))
- W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
- }
- }
- else
- {
+ if(self.weapons & WepSet_FromWeapon(self.weapon))
if(W_IsWeaponThrowable(self.weapon))
W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
if(W_IsWeaponThrowable(self.weapon))
W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
}
void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
}
void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
// damage resistance (ignore most of the damage from a bullet or similar)
damage = max(damage - 5, 1);
// damage resistance (ignore most of the damage from a bullet or similar)
damage = max(damage - 5, 1);
- v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+ v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
- sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
- sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
- sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM);
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
dh = max(self.health, 0);
da = max(self.armorvalue, 0);
dh = max(self.health, 0);
da = max(self.armorvalue, 0);
force = v_right * vlen(force);
Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
Violence_GibSplash_At(ear2, force, 2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
force = v_right * vlen(force);
Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), self, attacker);
Violence_GibSplash_At(ear2, force, 2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), self, attacker);
else
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
else
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
- if (!g_minstagib)
- {
- v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
- take = v_x;
- save = v_y;
- }
- else
- {
- save = 0;
- take = damage;
- }
+
+ v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
+ take = v_x;
+ save = v_y;
- sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
- sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
- sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM); // FIXME possibly remove them?
+ sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME possibly remove them?
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
// print an obituary message
Obituary (attacker, inflictor, self, deathtype);
race_PreDie();
// print an obituary message
Obituary (attacker, inflictor, self, deathtype);
race_PreDie();
if(accuracy_isgooddamage(attacker, self))
attacker.accuracy.(accuracy_frags[w-1]) += 1;
if(accuracy_isgooddamage(attacker, self))
attacker.accuracy.(accuracy_frags[w-1]) += 1;
weapon_action(self.weapon, WR_PLAYERDEATH);
RemoveGrapplingHook(self);
Portal_ClearAllLater(self);
weapon_action(self.weapon, WR_PLAYERDEATH);
RemoveGrapplingHook(self);
Portal_ClearAllLater(self);
- if(defer_ClientKill_Now_TeamChange) // TODO does this work with FreezeTag?
- ClientKill_Now_TeamChange();
+ if(defer_ClientKill_Now_TeamChange)
+ ClientKill_Now_TeamChange(); // can turn player into spectator
- if(g_arena)
- Spawnqueue_Unmark(self);
-
- if(g_freezetag)
+ // player could have been miraculously resuscitated ;)
+ // e.g. players in freezetag get frozen, they don't really die
+ if(self.health >= 1 || !IS_PLAYER(self))
self.solid = SOLID_CORPSE;
self.ballistics_density = autocvar_g_ballistics_density_corpse;
// don't stick to the floor
self.solid = SOLID_CORPSE;
self.ballistics_density = autocvar_g_ballistics_density_corpse;
// don't stick to the floor
self.respawn_countdown = 10; // first number to count down from is 10
else
self.respawn_countdown = -1; // do not count down
self.respawn_countdown = 10; // first number to count down from is 10
else
self.respawn_countdown = -1; // do not count down
{
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
{
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
- if(clienttype(msg_entity) == CLIENTTYPE_REAL)
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+ if(IS_REAL_CLIENT(msg_entity))
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
if(self.deadflag == DEAD_NO)
animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
if(self.deadflag == DEAD_NO)
animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NORM);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NORM);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- if(clienttype(msg_entity) == CLIENTTYPE_REAL)
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+ if(IS_REAL_CLIENT(msg_entity))
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
if(self.deadflag == DEAD_NO)
animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
if(self.deadflag == DEAD_NO)
animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
if(!sv_taunt)
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
- soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
- sound(self, chan, sample, VOL_BASE, ATTN_NORM);
+ sound(self, chan, sample, VOL_BASE, ATTEN_NORM);