2 void trigger_hurt_use(entity this, entity actor, entity trigger)
7 this.enemy = NULL; // let's just destroy it, if taking over is too much work
10 .float triggerhurttime;
11 void trigger_hurt_touch(entity this, entity toucher)
13 if (this.active != ACTIVE_ACTIVE)
17 if(((this.spawnflags & 4) == 0) == (this.team != toucher.team))
20 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
21 if (toucher.iscreature)
23 if (toucher.takedamage)
24 if (toucher.triggerhurttime < time)
26 EXACTTRIGGER_TOUCH(this, toucher);
27 toucher.triggerhurttime = time + 1;
34 this.enemy = NULL; // I still hate you all
37 Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.origin, '0 0 0');
40 else if(toucher.damagedbytriggers)
42 if(toucher.takedamage)
44 EXACTTRIGGER_TOUCH(this, toucher);
45 Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.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 spawnfunc(trigger_hurt)
63 this.active = ACTIVE_ACTIVE;
64 settouch(this, trigger_hurt_touch);
65 this.use = trigger_hurt_use;
66 this.enemy = world; // I hate you all
69 if (this.message == "")
70 this.message = "was in the wrong place";
71 if (this.message2 == "")
72 this.message2 = "was thrown into a world of hurt by";
73 // this.message = "someone like %s always gets wrongplaced";
75 if(!trigger_hurt_first)
76 trigger_hurt_first = this;
78 trigger_hurt_last.trigger_hurt_next = this;
79 trigger_hurt_last = this;
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))