]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
added a seperate offswitch for this new time based spread decay
authordrjaska <drjaska83@gmail.com>
Sun, 5 Sep 2021 12:46:25 +0000 (15:46 +0300)
committerdrjaska <drjaska83@gmail.com>
Sun, 5 Sep 2021 12:46:25 +0000 (15:46 +0300)
spread_offswitchfortimebaseddecay 1 gives back the old instant spread removal

bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/machinegun.qh

index 936c39289b9f3a3a149f9a39b93012a3d1712d8b..84856ebf9e0609adf6f6350b81e31b42a22074f0 100644 (file)
@@ -86,6 +86,7 @@ set g_balance_machinegun_spread_add 0.012
 set g_balance_machinegun_spread_decay 0.036
 set g_balance_machinegun_spread_max 0.05
 set g_balance_machinegun_spread_min 0.02
+set g_balance_machinegun_spread_offswitchfortimebaseddecay 0
 set g_balance_machinegun_sustained_ammo 1
 set g_balance_machinegun_sustained_damage 10
 set g_balance_machinegun_sustained_force 3
index 3d665371c10eed34d66bf39a4677ad14f85d13da..dd2c36da9660444c373445792e1faf8556e2cc09 100644 (file)
@@ -86,6 +86,7 @@ set g_balance_machinegun_spread_add 0.02
 set g_balance_machinegun_spread_decay -666
 set g_balance_machinegun_spread_max 0.6
 set g_balance_machinegun_spread_min 0.02
+set g_balance_machinegun_spread_offswitchfortimebaseddecay 1
 set g_balance_machinegun_sustained_ammo 1
 set g_balance_machinegun_sustained_damage 15
 set g_balance_machinegun_sustained_force 27
index 27856dfe8b999cd047f7b79db146c19a0b6e70f4..3526ed6baa47831981b22ca9b9b0be3c19ca081b 100644 (file)
@@ -86,6 +86,7 @@ set g_balance_machinegun_spread_add 0.012
 set g_balance_machinegun_spread_decay 0.036
 set g_balance_machinegun_spread_max 0.05
 set g_balance_machinegun_spread_min 0.02
+set g_balance_machinegun_spread_offswitchfortimebaseddecay 0
 set g_balance_machinegun_sustained_ammo 1
 set g_balance_machinegun_sustained_damage 10
 set g_balance_machinegun_sustained_force 5
index 9e09801aead280607d9e680cd28afeb30fa532f7..ffce4dceec8a891808cfdb85ff4d7d73b66b75fe 100644 (file)
@@ -86,6 +86,7 @@ set g_balance_machinegun_spread_add 0
 set g_balance_machinegun_spread_decay 0
 set g_balance_machinegun_spread_max 0
 set g_balance_machinegun_spread_min 0
+set g_balance_machinegun_spread_offswitchfortimebaseddecay 0
 set g_balance_machinegun_sustained_ammo 1
 set g_balance_machinegun_sustained_damage 10
 set g_balance_machinegun_sustained_force 3
index a5423be50076b5de48db57d696a99f9a058ca9c5..ce0ab38c3a826e1683e1f5c9b9edc3032a7cdb3e 100644 (file)
@@ -86,6 +86,7 @@ set g_balance_machinegun_spread_add 0.012
 set g_balance_machinegun_spread_decay 0.036
 set g_balance_machinegun_spread_max 0.05
 set g_balance_machinegun_spread_min 0
+set g_balance_machinegun_spread_offswitchfortimebaseddecay 0
 set g_balance_machinegun_sustained_ammo 1
 set g_balance_machinegun_sustained_damage 10
 set g_balance_machinegun_sustained_force 3
index 9bda0713a7ce9b9597914f68e8efef71a507d1b4..a2b055ea1877ca7cdc60b584be8932990e3b490e 100644 (file)
@@ -126,7 +126,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity
 
        actor.(weaponentity).machinegun_spread_accumulation = max(actor.(weaponentity).machinegun_spread_accumulation - ((time - actor.(weaponentity).oldTime) * WEP_CVAR(machinegun, spread_decay)), 0);
        actor.(weaponentity).oldTime = time;
-       if(WEP_CVAR(machinegun, spread_decay) < 0){
+       if(WEP_CVAR(machinegun, spread_offswitchfortimebaseddecay)){
                machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * actor.(weaponentity).misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
        } else {
                machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + actor.(weaponentity).machinegun_spread_accumulation, WEP_CVAR(machinegun, spread_max));
@@ -216,7 +216,7 @@ METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponen
         if(fire & 2)
         if(weapon_prepareattack(thiswep, actor, weaponentity, true, 0))
         {
-            if(WEP_CVAR(machinegun, spread_decay) >= 0){
+            if(!WEP_CVAR(machinegun, spread_offswitchfortimebaseddecay)){
                 actor.(weaponentity).machinegun_spread_accumulation = max(actor.(weaponentity).machinegun_spread_accumulation - ((time - actor.(weaponentity).oldTime) * WEP_CVAR(machinegun, spread_decay)), 0);
                 actor.(weaponentity).oldTime = time;
                 if(actor.(weaponentity).machinegun_spread_accumulation > 0){
index e1800fd1b5e5b4b4a60d42f02072bfdb30a5ef80..a30c96a8f9566a8ec4c9c016c33eae4d47402458 100644 (file)
@@ -41,6 +41,7 @@ CLASS(MachineGun, Weapon)
                P(class, prefix, spread_decay, float, NONE) \
                P(class, prefix, spread_max, float, NONE) \
                P(class, prefix, spread_min, float, NONE) \
+               P(class, prefix, spread_offswitchfortimebaseddecay, float, NONE) \
                P(class, prefix, sustained_ammo, float, NONE) \
                P(class, prefix, sustained_damage, float, NONE) \
                P(class, prefix, sustained_force, float, NONE) \