#ifdef SVQC
spawnfunc(trigger_swamp);
#endif
-void swamp_touch();
-void swampslug_think();
+void swamp_touch(entity this);
+void swampslug_think(entity this);
/*
*
* I do it this way becuz there is no "untouch" event.
*/
-void swampslug_think()
-{SELFPARAM();
+void swampslug_think(entity this)
+{
//Slowly kill the slug
- self.health = self.health - 1;
+ this.health = this.health - 1;
//Slug dead? then remove curses.
- if(self.health <= 0)
+ if(this.health <= 0)
{
- self.owner.in_swamp = 0;
- remove(self);
- //centerprint(self.owner,"Killing slug...\n");
+ this.owner.in_swamp = 0;
+ remove(this);
+ //centerprint(this.owner,"Killing slug...\n");
return;
}
// Or we have exited it very recently.
// Do the damage and renew the timer.
#ifdef SVQC
- Damage (self.owner, self, self, self.dmg, DEATH_SWAMP.m_id, other.origin, '0 0 0');
+ Damage (this.owner, this, this, this.dmg, DEATH_SWAMP.m_id, other.origin, '0 0 0');
#endif
- self.nextthink = time + self.swamp_interval;
+ this.nextthink = time + this.swamp_interval;
}
-void swamp_touch()
-{SELFPARAM();
+void swamp_touch(entity this)
+{
// If whatever thats touching the swamp is not a player
// or if its a dead player, just dont care abt it.
if(!IS_PLAYER(other) || IS_DEAD(other))
//centerprint(other,"Entering swamp!\n");
other.swampslug = spawn();
other.swampslug.health = 2;
- other.swampslug.think = swampslug_think;
+ setthink(other.swampslug, swampslug_think);
other.swampslug.nextthink = time;
other.swampslug.owner = other;
- other.swampslug.dmg = self.dmg;
- other.swampslug.swamp_interval = self.swamp_interval;
- other.swamp_slowdown = self.swamp_slowdown;
+ other.swampslug.dmg = this.dmg;
+ other.swampslug.swamp_interval = this.swamp_interval;
+ other.swamp_slowdown = this.swamp_slowdown;
other.in_swamp = 1;
return;
}
return true;
}
-void swamp_link()
-{SELFPARAM();
- trigger_link(self, swamp_send);
+void swamp_link(entity this)
+{
+ trigger_link(this, swamp_send);
}
/*QUAKED spawnfunc_trigger_swamp (.5 .5 .5) ?
spawnfunc(trigger_swamp)
{
// Init stuff
- trigger_init(self);
- self.touch = swamp_touch;
+ trigger_init(this);
+ settouch(this, swamp_touch);
// Setup default keys, if missing
- if(self.dmg <= 0)
- self.dmg = 5;
- if(self.swamp_interval <= 0)
- self.swamp_interval = 1;
- if(self.swamp_slowdown <= 0)
- self.swamp_slowdown = 0.5;
-
- swamp_link();
+ if(this.dmg <= 0)
+ this.dmg = 5;
+ if(this.swamp_interval <= 0)
+ this.swamp_interval = 1;
+ if(this.swamp_slowdown <= 0)
+ this.swamp_slowdown = 0.5;
+
+ swamp_link(this);
}
#elif defined(CSQC)
NET_HANDLE(ENT_CLIENT_SWAMP, bool isnew)
{
- self.dmg = ReadByte();
- self.swamp_slowdown = ReadByte();
- self.swamp_interval = ReadByte();
+ this.dmg = ReadByte();
+ this.swamp_slowdown = ReadByte();
+ this.swamp_interval = ReadByte();
- trigger_common_read(false);
+ trigger_common_read(this, false);
return = true;
- self.classname = "trigger_swamp";
- self.solid = SOLID_TRIGGER;
- self.move_touch = swamp_touch;
- self.drawmask = MASK_NORMAL;
- self.move_time = time;
- self.entremove = trigger_remove_generic;
+ this.classname = "trigger_swamp";
+ this.solid = SOLID_TRIGGER;
+ settouch(this, swamp_touch);
+ this.drawmask = MASK_NORMAL;
+ this.move_time = time;
+ this.entremove = trigger_remove_generic;
}
#endif