3 void trigger_hurt_use(entity this, entity actor, entity trigger)
8 this.enemy = NULL; // let's just destroy it, if taking over is too much work
11 .float triggerhurttime;
12 void trigger_hurt_touch(entity this, entity toucher)
14 if (this.active != ACTIVE_ACTIVE)
18 if(((this.spawnflags & INVERT_TEAMS) == 0) == (this.team != toucher.team))
21 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
22 if (toucher.iscreature)
24 if (toucher.takedamage)
25 if (toucher.triggerhurttime < time)
27 EXACTTRIGGER_TOUCH(this, toucher);
28 toucher.triggerhurttime = time + ((q3compat && !(this.spawnflags & HURT_SLOW)) ? 0.1 : 1);
35 this.enemy = NULL; // I still hate you all
38 Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
41 else if(toucher.damagedbytriggers)
43 if(toucher.takedamage)
45 EXACTTRIGGER_TOUCH(this, toucher);
46 Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
53 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
54 Any object touching this will be hurt
55 set dmg to damage amount
58 .entity trigger_hurt_next;
59 entity trigger_hurt_last;
60 entity trigger_hurt_first;
61 spawnfunc(trigger_hurt)
64 this.active = ACTIVE_ACTIVE;
65 settouch(this, trigger_hurt_touch);
66 this.use = trigger_hurt_use;
67 this.enemy = world; // I hate you all
69 this.dmg = ((q3compat) ? 5 : 10000);
70 if (this.message == "")
71 this.message = "was in the wrong place";
72 if (this.message2 == "")
73 this.message2 = "was thrown into a world of hurt by";
74 // this.message = "someone like %s always gets wrongplaced";
76 if(!trigger_hurt_first)
77 trigger_hurt_first = this;
79 trigger_hurt_last.trigger_hurt_next = this;
80 trigger_hurt_last = this;
83 bool tracebox_hits_trigger_hurt(vector start, vector e_min, vector e_max, vector end)
87 for(th = trigger_hurt_first; th; th = th.trigger_hurt_next)
88 if(tracebox_hits_box(start, e_min, e_max, end, th.absmin, th.absmax))