float h;
if (!(this.spawnflags & BREAKABLE_INDICATE_DAMAGE))
return;
- h = GetResourceAmount(this, RES_HEALTH) / this.max_health;
+ h = GetResource(this, RES_HEALTH) / this.max_health;
if(h < 0.25)
this.colormod = '1 0 0';
else if(h <= 0.75)
void func_breakable_behave_destroyed(entity this)
{
- SetResourceAmount(this, RES_HEALTH, this.max_health);
+ SetResource(this, RES_HEALTH, this.max_health);
this.takedamage = DAMAGE_NO;
if(this.bot_attack)
IL_REMOVE(g_bot_targets, this);
void func_breakable_destroy(entity this, entity actor, entity trigger);
void func_breakable_behave_restore(entity this)
{
- SetResourceAmount(this, RES_HEALTH, this.max_health);
+ SetResource(this, RES_HEALTH, this.max_health);
if(this.sprite)
{
WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
- WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RES_HEALTH));
+ WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH));
}
if(!(this.spawnflags & BREAKABLE_NODAMAGE))
{
if(this.sprite)
{
WaypointSprite_Ping(this.sprite);
- WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RES_HEALTH));
+ WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH));
}
func_breakable_colormod(this);
- if(GetResourceAmount(this, RES_HEALTH) <= 0)
+ if(GetResource(this, RES_HEALTH) <= 0)
{
debrisforce = force;
spawnfunc(func_breakable)
{
float n, i;
- if(!GetResourceAmount(this, RES_HEALTH))
- SetResourceAmount(this, RES_HEALTH, 100);
- this.max_health = GetResourceAmount(this, RES_HEALTH);
+ if(!GetResource(this, RES_HEALTH))
+ SetResource(this, RES_HEALTH, 100);
+ this.max_health = GetResource(this, RES_HEALTH);
// yes, I know, MOVETYPE_NONE is not available here, not that one would want it here anyway
if(!this.debrismovetype) this.debrismovetype = MOVETYPE_BOUNCE;