1 .float touchexplode_time;
3 void PlayerTouchExplode(entity p1, entity p2)
6 org = (p1.origin + p2.origin) * 0.5;
7 org_z += (p1.mins_z + p2.mins_z) * 0.5;
9 sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
10 pointparticles(particleeffectnum("explosion_small"), org, '0 0 0', 1);
15 RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE, world);
19 MUTATOR_HOOKFUNCTION(touchexplode_PlayerThink)
21 if(time > self.touchexplode_time)
24 if(self.deadflag == DEAD_NO)
25 if (!IS_INDEPENDENT_PLAYER(self))
26 FOR_EACH_PLAYER(other) if(self != other)
28 if(time > other.touchexplode_time)
29 if(other.deadflag == DEAD_NO)
30 if (!IS_INDEPENDENT_PLAYER(other))
31 if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax))
33 PlayerTouchExplode(self, other);
34 self.touchexplode_time = other.touchexplode_time = time + 0.2;
41 MUTATOR_DEFINITION(mutator_touchexplode)
43 MUTATOR_HOOK(PlayerPreThink, touchexplode_PlayerThink, CBC_ORDER_ANY);