this.state = STATE_DOWN;
SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, button_done);
this.frame = 0; // use normal textures
- if (GetResourceAmount(this, RESOURCE_HEALTH))
+ if (GetResourceAmount(this, RES_HEALTH))
this.takedamage = DAMAGE_YES; // can be shot again
this.wait_remaining = -1;
this.activation_time = -1;
void button_fire(entity this)
{
- SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
+ SetResourceAmount(this, RES_HEALTH, this.max_health);
this.takedamage = DAMAGE_NO; // will be reset upon return
if (this.state == STATE_UP || this.state == STATE_TOP)
void button_reset(entity this)
{
- SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
+ SetResourceAmount(this, RES_HEALTH, this.max_health);
setorigin(this, this.pos1);
this.frame = 0; // use normal textures
this.state = STATE_BOTTOM;
this.active = ACTIVE_ACTIVE;
setthink(this, func_null);
this.nextthink = 0;
- if (GetResourceAmount(this, RESOURCE_HEALTH))
+ if (GetResourceAmount(this, RES_HEALTH))
this.takedamage = DAMAGE_YES; // can be shot again
}
return;
if (this.spawnflags & BUTTON_DONTACCUMULATEDMG)
{
- if (GetResourceAmount(this, RESOURCE_HEALTH) <= damage)
+ if (GetResourceAmount(this, RES_HEALTH) <= damage)
{
this.enemy = attacker;
button_fire(this);
}
else
{
- TakeResource(this, RESOURCE_HEALTH, damage);
- if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
+ TakeResource(this, RES_HEALTH, damage);
+ if (GetResourceAmount(this, RES_HEALTH) <= 0)
{
this.enemy = attacker;
button_fire(this);
// if (this.health == 0) // all buttons are now shootable
// this.health = 10;
- if (GetResourceAmount(this, RESOURCE_HEALTH))
+ if (GetResourceAmount(this, RES_HEALTH))
{
- this.max_health = GetResourceAmount(this, RESOURCE_HEALTH);
+ this.max_health = GetResourceAmount(this, RES_HEALTH);
this.event_damage = button_damage;
this.takedamage = DAMAGE_YES;
}