5 #include <lib/warpzone/util_server.qh>
6 #include <common/weapons/_all.qh>
7 #include <common/weapons/_all.qh>
8 #include <common/stats.qh>
9 #include <common/deathtypes/all.qh>
14 * Adds spawnfunc_trigger_swamp and support routines for nexuiz 1.2.1+ and xonotic
15 * Author tZork (Jakob MG)
21 void swamp_think(entity this)
23 // set myself as current swampslug where possible
24 IL_EACH(g_swamped, it.swampslug == this,
27 IL_REMOVE(g_swamped, it);
30 if(this.active == ACTIVE_ACTIVE)
32 FOREACH_ENTITY_RADIUS((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1, it.swampslug.active == ACTIVE_NOT && IS_PLAYER(it) && !IS_DEAD(it),
34 if (WarpZoneLib_ExactTrigger_Touch(this, it, false))
37 IL_PUSH(g_swamped, it);
42 IL_EACH(g_swamped, it.swampslug == this,
44 if(time > it.swamp_interval)
46 Damage (it, this, this, this.dmg, DEATH_SWAMP.m_id, DMG_NOWEP, it.origin, '0 0 0');
47 it.swamp_interval = time + this.swamp_interval;
52 this.nextthink = time;
55 /*QUAKED spawnfunc_trigger_swamp (.5 .5 .5) ?
56 Players in the swamp will be
57 slowed down and damaged over time
59 spawnfunc(trigger_swamp)
63 this.active = ACTIVE_ACTIVE;
64 setthink(this, swamp_think);
65 this.nextthink = time;
67 // Setup default keys, if missing
70 if(!this.swamp_interval)
71 this.swamp_interval = 1;
72 if(!this.swamp_slowdown)
73 this.swamp_slowdown = 0.5;