.float swamp_interval; //Hurt players in swamp with this interval
.float swamp_slowdown; //Players in swamp get slowd down by this mutch 0-1 is slowdown 1-~ is speedup (!?)
+.float swamp_lifetime; // holds the points remaining until slug dies (not quite health!)
.entity swampslug;
#ifdef SVQC
void swampslug_think(entity this)
{
//Slowly kill the slug
- SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) - 1);
+ this.swamp_lifetime -= 1;
//Slug dead? then remove curses.
if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
// If not attach one.
//centerprint(toucher,"Entering swamp!\n");
toucher.swampslug = spawn();
- SetResourceAmountExplicit(toucher.swampslug, RESOURCE_HEALTH, 2);
+ toucher.swampslug.swamp_lifetime = 2;
setthink(toucher.swampslug, swampslug_think);
toucher.swampslug.nextthink = time;
toucher.swampslug.owner = toucher;
//toucher.in_swamp = 1;
//Revitalize players swampslug
- SetResourceAmountExplicit(toucher.swampslug, RESOURCE_HEALTH, 2);
+ toucher.swampslug.swamp_lifetime = 2;
}
REGISTER_NET_LINKED(ENT_CLIENT_SWAMP)