5 .float touchexplode_time;
7 void PlayerTouchExplode(entity p1, entity p2)
10 org = (p1.origin + p2.origin) * 0.5;
11 org.z += (p1.mins.z + p2.mins.z) * 0.5;
13 sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
14 Send_Effect("explosion_small", org, '0 0 0', 1);
19 RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE, world);
23 MUTATOR_HOOKFUNCTION(touchexplode_PlayerThink)
25 if(time > self.touchexplode_time)
29 if(self.deadflag == DEAD_NO)
30 if (!IS_INDEPENDENT_PLAYER(self))
31 FOR_EACH_PLAYER(other) if(self != other)
33 if(time > other.touchexplode_time)
35 if(other.deadflag == DEAD_NO)
36 if (!IS_INDEPENDENT_PLAYER(other))
37 if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax))
39 PlayerTouchExplode(self, other);
40 self.touchexplode_time = other.touchexplode_time = time + 0.2;
47 MUTATOR_DEFINITION(mutator_touchexplode)
49 MUTATOR_HOOK(PlayerPreThink, touchexplode_PlayerThink, CBC_ORDER_ANY);