-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added gun length fixes (cut barrel & muzzle attachments) #46927
added gun length fixes (cut barrel & muzzle attachments) #46927
Conversation
Can you jsonize this for usage with pistol stocks/bayonets/suppressors? |
i ll give it a try and see what i can do update: i looked at the code and the best i can do is to ensure that the length of muzzle attachments & bayonets in underbarrel slot gets taken into account. Stocks on the other hand replace existing parts of the gun ... those default parts aren't curretly simulated and are just part of the guns core stats. |
The "plain" /250 ml idea has the difficulty of not accounting for calibre, nor for multiple barrels (most notably in shotguns, unless a (M61) Vulcan has slipped in while I wasn't looking...). BTW, is the barrel volume for shotguns for one or two barrels (in applicable cases)? |
A quarter of a liter per 25.4 millimeter would mean it's an artillery piece, not something you can lug around. The comment for the json md would mean the example barrel is about 3 millimeters long... |
It should be for both barrels together, after all we don't track the number of barrels anywhere and use the stat to reduce the volume of guns with a cut barrel. |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/sawing-off-shotguns-no-longer-works/25930/2 |
Summary
SUMMARY: Bugfixes "Cut barrel task & muzzle attachments now change the guns length"
Purpose of change
Cutting the barrel off a gun, didn't change the guns length at all.
Fixes #45806 (to some extend)
Describe the solution
1. Cutting
The guns barrel_volume (the stat used to reduce volume for guns with a cut barrel) is put in relation to the guns total volume to estimate a baseline of what percentage of the guns length gets cut.
It also should make is realy easy to swap out the current calculation in the future once we have an enforced more functional standard in the json files.
2. Attachments:
Gunmods get searched for the muzzle location and if found the items length will be added (this does not change the possible amount cut from the barrel!)
Describe alternatives you've considered
json md
"barrel_volume": "30 mL", // Amount of volume lost when the barrel is sawn. Approximately 250 ml per inch is a decent approximation.
This standard is neither enforced nor reasonable but that's something that needs fixing on it's own.
Testing
Spawn in 2 of a any rifle you wanna cut.
hacksaw one and compare the two.
Then grab a suppressor and add it to a valid gun. The guns length should be increased by the attachments length.
2 cut examples:
Barret anti material rifle loses 9 inches.
Double barrel shotgun loses 3inches.
Not a lot but working as intended. The error is with the json files having absurd barrel_volume amounts.