]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to use the old small nade size
authorMario <mario@smbclan.net>
Thu, 11 Feb 2016 11:24:25 +0000 (21:24 +1000)
committerMario <mario@smbclan.net>
Thu, 11 Feb 2016 11:24:25 +0000 (21:24 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/nades/nades.qc

index dd8d96a5670fbd35ac9ddd0a7d6a10af5a497f12..e5285923e103c4cae9204a0b74cd21f81d467bbc 100644 (file)
@@ -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.)"
index fcfce9ab77fb5f686013e9d162b874ec618c10ae..3464a7cb349ed824c06b338668b23bfca087467d 100644 (file)
@@ -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);