2 REGISTER_MUTATOR(touchexplode, cvar("g_touchexplode"));
4 .float touchexplode_time;
6 void PlayerTouchExplode(entity p1, entity p2)
8 vector org = (p1.origin + p2.origin) * 0.5;
9 org.z += (p1.mins.z + p2.mins.z) * 0.5;
11 sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
12 Send_Effect(EFFECT_EXPLOSION_SMALL, org, '0 0 0', 1);
16 RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, world);
20 MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
22 if(time > self.touchexplode_time)
26 if(self.deadflag == DEAD_NO)
27 if (!IS_INDEPENDENT_PLAYER(self))
28 FOR_EACH_PLAYER(other) if(self != other)
30 if(time > other.touchexplode_time)
32 if(other.deadflag == DEAD_NO)
33 if (!IS_INDEPENDENT_PLAYER(other))
34 if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax))
36 PlayerTouchExplode(self, other);
37 self.touchexplode_time = other.touchexplode_time = time + 0.2;