2 void trigger_hurt_use()
4 if(IS_PLAYER(activator))
5 self.enemy = activator;
7 self.enemy = world; // let's just destroy it, if taking over is too much work
10 .float triggerhurttime;
11 void trigger_hurt_touch()
13 if (self.active != ACTIVE_ACTIVE)
17 if(((self.spawnflags & 4) == 0) == (self.team != other.team))
20 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
24 if (other.triggerhurttime < time)
27 other.triggerhurttime = time + 1;
34 self.enemy = world; // I still hate you all
37 Damage (other, self, own, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
40 else if(other.damagedbytriggers)
45 Damage(other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
52 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
53 Any object touching this will be hurt
54 set dmg to damage amount
57 .entity trigger_hurt_next;
58 entity trigger_hurt_last;
59 entity trigger_hurt_first;
60 void spawnfunc_trigger_hurt()
63 self.active = ACTIVE_ACTIVE;
64 self.touch = trigger_hurt_touch;
65 self.use = trigger_hurt_use;
66 self.enemy = world; // I hate you all
69 if (self.message == "")
70 self.message = "was in the wrong place";
71 if (self.message2 == "")
72 self.message2 = "was thrown into a world of hurt by";
73 // self.message = "someone like %s always gets wrongplaced";
75 if(!trigger_hurt_first)
76 trigger_hurt_first = self;
78 trigger_hurt_last.trigger_hurt_next = self;
79 trigger_hurt_last = self;
82 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end)
86 for(th = trigger_hurt_first; th; th = th.trigger_hurt_next)
87 if(tracebox_hits_box(start, mi, ma, end, th.absmin, th.absmax))