ons_notification_time[this.team] = time;
}
- SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) - damage);
+ TakeResource(this, RESOURCE_HEALTH, damage);
if(this.owner.iscaptured)
WaypointSprite_UpdateHealth(this.owner.sprite, GetResourceAmount(this, RESOURCE_HEALTH));
else
{
if(GetResourceAmount(this, RESOURCE_HEALTH) < this.max_health)
{
- SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) + this.count);
- if (GetResourceAmount(this, RESOURCE_HEALTH) >= this.max_health)
- SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+ GiveResourceWithLimit(this, RESOURCE_HEALTH, this.count, this.max_health);
WaypointSprite_UpdateHealth(this.owner.sprite, GetResourceAmount(this, RESOURCE_HEALTH));
}
}
play2team(this.team, SND(ONS_GENERATOR_UNDERATTACK));
}
}
- SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) - damage);
+ TakeResource(this, RESOURCE_HEALTH, damage);
WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RESOURCE_HEALTH));
// choose an animation frame based on health
this.frame = 10 * bound(0, (1 - GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health), 1);