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 (!toucher.takedamage)
16 if (this.active != ACTIVE_ACTIVE)
20 if(((this.spawnflags & INVERT_TEAMS) == 0) == (this.team != toucher.team))
23 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
24 if (toucher.iscreature)
26 if (time >= toucher.triggerhurttime + ((q3compat && !(this.spawnflags & HURT_SLOW)) ? autocvar_sys_ticrate : 1))
28 EXACTTRIGGER_TOUCH(this, toucher);
29 toucher.triggerhurttime = time;
36 this.enemy = NULL; // I still hate you all
39 Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
42 else if(toucher.damagedbytriggers)
44 EXACTTRIGGER_TOUCH(this, toucher);
45 Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
49 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
50 Any object touching this will be hurt
51 set dmg to damage amount
54 .entity trigger_hurt_next;
55 entity trigger_hurt_last;
56 entity trigger_hurt_first;
57 spawnfunc(trigger_hurt)
60 this.active = ACTIVE_ACTIVE;
61 settouch(this, trigger_hurt_touch);
62 this.use = trigger_hurt_use;
63 this.enemy = world; // I hate you all
65 this.dmg = ((q3compat) ? 5 : 10000);
66 if (this.message == "")
67 this.message = "was in the wrong place";
68 if (this.message2 == "")
69 this.message2 = "was thrown into a world of hurt by";
70 // this.message = "someone like %s always gets wrongplaced";
72 if(!trigger_hurt_first)
73 trigger_hurt_first = this;
75 trigger_hurt_last.trigger_hurt_next = this;
76 trigger_hurt_last = this;
79 bool tracebox_hits_trigger_hurt(vector start, vector e_min, vector e_max, vector end)
83 for(th = trigger_hurt_first; th; th = th.trigger_hurt_next)
84 if(tracebox_hits_box(start, e_min, e_max, end, th.absmin, th.absmax))