From: Mario Date: Thu, 11 Feb 2016 11:24:25 +0000 (+1000) Subject: Add an option to use the old small nade size X-Git-Tag: xonotic-v0.8.2~1191 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6360ce6aa7653b5d289be3151c715dcd56593903;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to use the old small nade size --- diff --git a/mutators.cfg b/mutators.cfg index dd8d96a56..e5285923e 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -214,6 +214,7 @@ set g_nades_bonus_type 2 "Type of the bonus grenade. 1:normal 2:napalm 3:ice 4:t set g_nades_bonus_onstrength 1 "Always give bonus grenades to players that have the strength powerup" set g_nades_bonus_max 3 "Maximum number of bonus grenades" set g_nades_bonus_only 0 "Disallow regular nades, only bonus nades can be used" +set g_nades_nade_small 0 "Use smaller nade size, makes shooting them harder, legacy setting" // Bonus score set g_nades_bonus_score_max 120 "Score value that will give a bonus nade" set g_nades_bonus_score_minor 5 "Score given for minor actions (pickups, regular frags etc.)" diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index fcfce9ab7..3464a7cb3 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -2,6 +2,12 @@ #ifdef IMPLEMENTATION +#ifdef SVQC +bool autocvar_g_nades_nade_small; +#endif + +REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small) + #ifndef MENUQC entity Nade_TrailEffect(int proj, int nade_team) { @@ -63,8 +69,16 @@ MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile) entity nade_type = Nade_FromProjectile(self.cnt); if (nade_type == NADE_TYPE_Null) return; - self.mins = '-16 -16 -16'; - self.maxs = '16 16 16'; + if(STAT(NADES_SMALL, NULL)) + { + self.mins = '-8 -8 -8'; + self.maxs = '8 8 8'; + } + else + { + self.mins = '-16 -16 -16'; + self.maxs = '16 16 16'; + } self.colormod = nade_type.m_color; self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = func_null; @@ -793,7 +807,10 @@ void toss_nade(entity e, vector _velocity, float _time) //setmodel(_nade, MDL_PROJECTILE_NADE); //setattachment(_nade, world, ""); PROJECTILE_MAKETRIGGER(_nade); - setsize(_nade, '-16 -16 -16', '16 16 16'); + if(STAT(NADES_SMALL, e)) + setsize(_nade, '-8 -8 -8', '8 8 8'); + else + setsize(_nade, '-16 -16 -16', '16 16 16'); _nade.movetype = MOVETYPE_BOUNCE; tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);