if(time < this.move_time)
return;
- if(GetResourceAmount(this, RES_HEALTH) > 0)
+ if(GetResource(this, RES_HEALTH) > 0)
{
// damaged fx (less probable the more damaged is the generator)
- if(random() < 0.9 - GetResourceAmount(this, RES_HEALTH) / this.max_health)
+ if(random() < 0.9 - GetResource(this, RES_HEALTH) / this.max_health)
if(random() < 0.01)
{
pointparticles(EFFECT_ELECTRO_BALLEXPLODE, this.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
this.origin = ReadVector();
setorigin(this, this.origin);
- SetResourceAmount(this, RES_HEALTH, ReadByte());
+ SetResource(this, RES_HEALTH, ReadByte());
this.max_health = ReadByte();
this.count = ReadByte();
this.team = ReadByte();
_tmp = ReadByte();
- if(_tmp != GetResourceAmount(this, RES_HEALTH))
+ if(_tmp != GetResource(this, RES_HEALTH))
generator_damage(this, _tmp);
- SetResourceAmount(this, RES_HEALTH, _tmp);
+ SetResource(this, RES_HEALTH, _tmp);
}
}