void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
- if(this.health <= 0)
+ if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
return;
if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
- this.health = this.health - damage;
+ TakeResource(this, RESOURCE_HEALTH, damage);
this.angles = vectoangles(this.velocity);
- if(this.health <= 0)
+ if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
W_PrepareExplosionByDamage(this, attacker, W_Devastator_Explode_think);
}
missile.takedamage = DAMAGE_YES;
missile.damageforcescale = WEP_CVAR(devastator, damageforcescale);
- missile.health = WEP_CVAR(devastator, health);
+ SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR(devastator, health));
missile.event_damage = W_Devastator_Damage;
missile.damagedbycontents = true;
IL_PUSH(g_damagedbycontents, missile);
// but don't fire a new shot at the same time!
if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
PHYS_INPUT_BUTTON_ATCK2(actor) = true;
- if((skill > 6.5) && (selfdamage > actor.health))
+ if((skill > 6.5) && (selfdamage > GetResourceAmount(actor, RESOURCE_HEALTH)))
PHYS_INPUT_BUTTON_ATCK2(actor) = false;
//if(PHYS_INPUT_BUTTON_ATCK2(actor) == true)
// dprint(ftos(desirabledamage),"\n");