void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint)
{
- float monster = (targ.flags & FL_MONSTER);
- float player = (targ.flags & FL_CLIENT);
-
- if(!player && !monster) // only specified entities can be freezed
+ if(!IS_PLAYER(targ) && !(targ.flags & FL_MONSTER)) // only specified entities can be freezed
return;
if(targ.frozen)
ice.frame = floor(random() * 21); // ice model has 20 different looking frames
setmodel(ice, "models/ice/ice.md3");
ice.alpha = 1;
- ice.colormod = Team_ColorRGB(self.team);
+ ice.colormod = Team_ColorRGB(targ.team);
ice.glowmod = ice.colormod;
targ.iceblock = ice;
void Unfreeze (entity targ)
{
- if not(targ.frozen)
- return; // not even frozen?
-
+ if(targ.frozen) // only reset health if target was frozen
+ targ.health = ((IS_PLAYER(targ)) ? autocvar_g_balance_health_start : targ.max_health);
targ.frozen = 0;
targ.revive_progress = 0;
- targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health);
WaypointSprite_Kill(targ.waypointsprite_attached);
// remove the ice block
- remove(targ.iceblock);
- targ.iceblock = world;
+ if(targ.iceblock)
+ {
+ remove(targ.iceblock);
+ targ.iceblock = world;
+ }
}
// these are updated by each Damage call for use in button triggering and such
{
attacker.dmg_team = attacker.dmg_team + damage;
complainteamdamage = attacker.dmg_team - autocvar_g_teamdamage_threshold;
- if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers?
+ if(complainteamdamage > 0)
mirrordamage = autocvar_g_mirrordamage * complainteamdamage;
mirrorforce = autocvar_g_mirrordamage * vlen(force);
- if(g_ca)
- damage = 0;
- else
- damage = autocvar_g_friendlyfire * damage;
+ damage = autocvar_g_friendlyfire * damage;
// mirrordamage will be used LATER
if(autocvar_g_mirrordamage_virtual)
mirrorforce *= g_weaponforcefactor;
}
- if(((targ.frozen == 2 && attacker.monsterid != MONSTER_SPIDER) || (targ.frozen == 1)) && deathtype != DEATH_HURTTRIGGER)
+ if(((targ.frozen == 2 && attacker.monsterid != MON_SPIDER) || (targ.frozen == 1)) && deathtype != DEATH_HURTTRIGGER)
{
damage = 0;
force *= 0.2;
if (targ == attacker)
{
- if(g_ca || (g_cts && !autocvar_g_cts_selfdamage))
+ if(g_cts && !autocvar_g_cts_selfdamage)
damage = 0;
else
damage = damage * autocvar_g_balance_selfdamagepercent; // Partial damage if the attacker hits himself
// apply push
if (self.damageforcescale)
if (vlen(force))
- if (!IS_PLAYER(self) || time >= self.spawnshieldtime || g_midair)
+ if (!IS_PLAYER(self) || time >= self.spawnshieldtime)
{
vector farce = damage_explosion_calcpush(self.damageforcescale * force, self.velocity, autocvar_g_balance_damagepush_speedfactor);
if(self.movetype == MOVETYPE_PHYSICS)