-
-/*
-* Uses a entity calld swampslug to handle players in the swamp
-* It works like this: When the plyer enters teh swamp the spawnfunc_trigger_swamp
-* attaches a new "swampslug" to the player. As long as the plyer is inside
-* the swamp the swamp gives the slug new health. But the slug slowly kills itself
-* so when the player goes outside the swamp, it dies and releases the player from the
-* swamps curses (dmg/slowdown)
-*
-* I do it this way becuz there is no "untouch" event.
-*/
-void swampslug_think(entity this)
-{
- //Slowly kill the slug
- this.swamp_lifetime -= 1;
-
- //Slug dead? then remove curses.
- if(this.swamp_lifetime <= 0)
- {
- if(this.owner.swampslug == this)
- {
- this.owner.in_swamp = false;
- this.owner.swampslug = NULL;
- }
- delete(this);
- //centerprint(this.owner,"Killing slug...\n");
- return;
- }
-
- // Slug still alive, so we are still in the swamp
- // Or we have exited it very recently.
- // Do the damage and renew the timer.