Bill Doors’ Weapon Jams!
Another small step in making weapon quality matters more!
Weapons now may occasionally jam, depending on their quality, tech level, and hitpoint (configurable in mod setting)
Weapons without quality are considered to be unaffected by manufacturing defects, thus won’t jam.
When a weapon jams, no bullets will be fired from this shot, current burst is terminated if is repeating weapon, and it’ll take a small amount of damage.
(for CE users) A gun that jammed will also needs a manual reload to clear jams, with the exception of:
1: load-one-at-once weapons
2: weapon with more than 5 second of reload or more than 75 round mag (for less annoyance when your 12-sec reload 200 round LMG jams on first shot)
3: weapons with a burst of more than 25 rounds as they’re considered to be externally powered guns thus they could simply force the jammed round out, they also won’t terminate their burst from jams either
Most constants and functions can be changed or toggled in mod settings!
For modders who don’t/wants own gun to jam:
use BDsWeaponJamming.DefModExtension_Jamming in modExtensions to customize how code behaves on your guns. Avaliable nodes are:
bool disableJamming: disables jamming for this gun regardless.
float jamChanceMulti: jam chances are multiplied against this value.
float jamChancePostfix: adds this value to the final jam chance, calculated after jamChanceMulti.
New variables in mod extension:
Bool NeverReloadWhenJam: Prevents gun from reloading when jammed, apparently needs CE for it to do anything
Bool AlwaysReloadWhenJam: vice versa, takes higher priority than NeverReloadWhenJam
Thanks for @Type writer’s tireless debugging and determination to find out a game-breaking bug when colonist hunt with their weapon broken mid-hunt without CE causes game to break. (Apparently CE added some sort of fail-safe to hunt job which gave me the illusion of bug-free) This bug is now fixed.