2 float autocvar_g_touchexplode_radius;
3 float autocvar_g_touchexplode_damage;
4 float autocvar_g_touchexplode_edgedamage;
5 float autocvar_g_touchexplode_force;
7 REGISTER_MUTATOR(touchexplode, cvar("g_touchexplode"));
9 .float touchexplode_time;
11 void PlayerTouchExplode(entity p1, entity p2)
13 vector org = (p1.origin + p2.origin) * 0.5;
14 org.z += (p1.mins.z + p2.mins.z) * 0.5;
16 sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
17 Send_Effect(EFFECT_EXPLOSION_SMALL, org, '0 0 0', 1);
21 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);
25 MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
27 if(time > self.touchexplode_time)
29 if(!STAT(FROZEN, self))
32 if(!IS_INDEPENDENT_PLAYER(self))
33 FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
34 if(time > it.touchexplode_time)
37 if (!IS_INDEPENDENT_PLAYER(it))
38 if(boxesoverlap(self.absmin, self.absmax, it.absmin, it.absmax))
40 PlayerTouchExplode(self, it);
41 self.touchexplode_time = it.touchexplode_time = time + 0.2;