UpdateFrags(attacker, f);
}
-.entity kh_next;
-
string AppendItemcodes(string s, entity player)
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
s = strcat(s, "S");
if(time < player.invincible_finished)
s = strcat(s, "I");
- if(player.flagcarried != NULL)
- s = strcat(s, "F");
if(PHYS_INPUT_BUTTON_CHAT(player))
s = strcat(s, "T");
- if(player.kh_next)
- s = strcat(s, "K");
+ // TODO: include these codes as a flag on the item itself
+ MUTATOR_CALLHOOK(LogDeath_AppendItemCodes, player, s);
+ s = M_ARGV(1, string);
return s;
}
// These are ALWAYS lethal
// No damage modification here
// Instead, prepare the victim for his death...
- SetResource(targ, RES_ARMOR, 0);
+ SetResourceExplicit(targ, RES_ARMOR, 0);
targ.spawnshieldtime = 0;
- SetResource(targ, RES_HEALTH, 0.9); // this is < 1
+ SetResourceExplicit(targ, RES_HEALTH, 0.9); // this is < 1
targ.flags -= targ.flags & FL_GODMODE;
damage = 100000;
}
damage = 0;
force = '0 0 0';
}
- else if(SAME_TEAM(attacker, targ))
+ else if(!STAT(FROZEN, targ) && SAME_TEAM(attacker, targ))
{
if(autocvar_teamplay_mode == 1)
damage = 0;
if(IS_PLAYER(victim) || (IS_TURRET(victim) && victim.active == ACTIVE_ACTIVE) || IS_MONSTER(victim) || MUTATOR_CALLHOOK(PlayHitsound, victim, attacker))
{
- if(DIFF_TEAM(victim, attacker) && !STAT(FROZEN, victim))
+ if (DIFF_TEAM(victim, attacker))
{
if(damage > 0)
{
}
}
}
- else if(IS_PLAYER(attacker))
+ else if (IS_PLAYER(attacker) && !STAT(FROZEN, victim)) // same team
{
- // if enemy gets frozen in this frame and receives other damage don't
- // play the typehitsound e.g. when hit by multiple bullets of the shotgun
- if (deathtype != DEATH_FIRE.m_id && (!STAT(FROZEN, victim) || time > victim.freeze_time))
+ if (deathtype != DEATH_FIRE.m_id)
{
attacker.typehitsound += 1;
}
}
float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe,
- float inflictorselfdamage, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
+ float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity)
// Returns total damage applies to creatures
{
entity targ;
force = force * (finaldmg / coredamage) * forceintensity;
hitloc = nearest;
- if(deathtype & WEP_BLASTER.m_id)
- force *= WEP_CVAR_BOTH(blaster, !(deathtype & HITTYPE_SECONDARY), force_zscale);
+ // apply special scaling along the z axis if set
+ // NOTE: 0 value is not allowed for compatibility, in the case of weapon cvars not being set
+ if(forcezscale)
+ force.z *= forcezscale;
if(targ != directhitentity)
{
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
{
- return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, weaponentity, directhitentity);
+ return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad,
+ cantbe, mustbe, false, forceintensity, 1, deathtype, weaponentity, directhitentity);
}
bool Heal(entity targ, entity inflictor, float amount, float limit)