Skip to content

Machinegun's spread decaying instead of instant reset to 0

Dr. Jaska requested to merge drjaska/mgspreaddecay into master

If machinegun spread accumulation is reset to 0 instantly when the firing button is released it negates any effect spread accumulation is supposed to have on higher level players. This is fixed and a cvar is added to control the amount of spread decayed per second. I set the cvar to deplete 3 shots worth of spread per second (just a number 3 times higher than spread_add cvar's value). Spread decay is based on time passing and does not pause when the gun is being fired, time passes while the weapon is being fired.

Alt fire is blocked unless spread is at 0 to prevent abuse with firing primary until full spread and then going to alt fire for no spread. To give a reason to use alt fire other the 3 shots being closer together in a burst, alt fire currently only accumulates only half of the spread per shot compared to primary fire. (If a each shot gives 1 point then while primary fire gives 1+1+1 for 3 shots alt fire gives 0.5+0.5+0.5 for 3 shots)

Despite mg being OP on paper I'm leaving balancing untouched (except for the first bullet having 0 spread in default bal-wep-xonotic.cfg) due to current level of the playerbase as a whole.

Decay cvar value of 0 is an off-switch for this new behavior.

Closes #2560

Edited by Dr. Jaska

Merge request reports