if(inflictor.owner == this.owner)
return;
- TakeResource(this, RESOURCE_HEALTH, damage);
+ TakeResource(this, RES_HEALTH, damage);
this.velocity += force;
- if(GetResourceAmount(this, RESOURCE_HEALTH) < 1)
+ if(GetResourceAmount(this, RES_HEALTH) < 1)
{
this.takedamage = DAMAGE_NO;
this.event_damage = func_null;
{
proj.takedamage = DAMAGE_AIM;
proj.event_damage = vehicles_projectile_damage;
- SetResourceAmount(proj, RESOURCE_HEALTH, _health);
+ SetResourceAmount(proj, RES_HEALTH, _health);
}
else
proj.flags |= FL_NOTARGET;
if(timer + rpause < time)
{
if(_healthscale)
- regen = regen * (GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health);
+ regen = regen * (GetResourceAmount(this, RES_HEALTH) / this.max_health);
this.(regen_field) = min(this.(regen_field) + regen * delta_time, field_max);
void vehicles_painframe(entity this)
{
- int myhealth = ((this.owner) ? this.owner.vehicle_health : ((GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health) * 100));
+ int myhealth = ((this.owner) ? this.owner.vehicle_health : ((GetResourceAmount(this, RES_HEALTH) / this.max_health) * 100));
if(myhealth <= 50)
if(this.pain_frame < time)
if(this.vehicle_shield < 0)
{
- TakeResource(this, RESOURCE_HEALTH, fabs(this.vehicle_shield));
+ TakeResource(this, RES_HEALTH, fabs(this.vehicle_shield));
this.vehicle_shieldent.colormod = '2 0 0';
this.vehicle_shield = 0;
this.vehicle_shieldent.alpha = 0.75;
}
else
{
- TakeResource(this, RESOURCE_HEALTH, damage);
+ TakeResource(this, RES_HEALTH, damage);
if(sound_allowed(MSG_BROADCAST, attacker))
spamsound (this, CH_PAIN, SND_ONS_HIT2, VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
else
this.velocity += force;
- if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
+ if(GetResourceAmount(this, RES_HEALTH) <= 0)
{
if(this.owner)
{
bool vehicles_heal(entity targ, entity inflictor, float amount, float limit)
{
- float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
- if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
+ float true_limit = ((limit != RES_LIMIT_NONE) ? limit : targ.max_health);
+ if(GetResourceAmount(targ, RES_HEALTH) <= 0 || GetResourceAmount(targ, RES_HEALTH) >= true_limit)
return false;
- GiveResourceWithLimit(targ, RESOURCE_HEALTH, amount, true_limit);
+ GiveResourceWithLimit(targ, RES_HEALTH, amount, true_limit);
if(targ.owner)
- targ.owner.vehicle_health = (GetResourceAmount(targ, RESOURCE_HEALTH) / targ.max_health) * 100;
+ targ.owner.vehicle_health = (GetResourceAmount(targ, RES_HEALTH) / targ.max_health) * 100;
return true;
}