-
Notifications
You must be signed in to change notification settings - Fork 288
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
fix: secondary magazine gunmods can inherit more behaviors from parent gun #6083
fix: secondary magazine gunmods can inherit more behaviors from parent gun #6083
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, got a few questions but nothing that's absolutely required to change.
Co-authored-by: OrenAudeles <orenaudeles@gmail.com>
Autofix has formatted code style violation in this PR. I edit commits locally (e.g: git, github desktop) and want to keep autofix
I do not want the automated commit
If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT. |
Co-authored-by: OrenAudeles <orenaudeles@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 I don't see anything else funky, and I said in the previous review it looked good anyway other than those few things so I don't see any reason to not approve it now.
Purpose of change (The Why)
This makes it so that gunmods whose gimmick is just "I'm actually a second magazine on this gun, not a real auxillery weapon" will act more like it, inheriting behaviors from the gun it's installed on.
Describe the solution (The How)
C++ changes:
USE_PARENT_GUN
for use below.ranged::handle_gun_damage
now tracks and applies fouling to the parent item if a gunmod with theUSE_PARENT_GUN
flag is the one firing.calc_gun_volume
likewise gains special handling for gunmods that havingUSE_PARENT_GUN
, making it borrow the base loudness and loudness modifiers of any gunmods from the gun it's installed on, while still using the loudness value of its own ammo.cycle_action
likewise checks for if the item it's processing is a gunmod withUSE_PARENT_GUN
, and if so will check the parent item for whether to doRELOAD_EJECT
and brass catcher functions, and additionally offload its spent cases/links to the parent item instead of loading itself with them.JSON changes:
USE_PARENT_GUN
flag to KSG second magazine, KSG-25 second magazine, TS12 second magazine, and TS12 third magazine.Documentation changes:
Describe alternatives you've considered
Just doing the hackery route of making the KSG a 14-round shotgun and the Tavor a 15-round shotgun, like DDA ended up doing. That's boring and lame, so I dun wanna. :D
Testing
It's hard to tell but it seems like dispersion and handling already uses the parent item, as can be verified by installing proper sights on the TS12 (which starts off with HORRENDOUS sight dispersion evidently due to not coming with iron sights by default). Shots tend to swing wide for all firemodes with it by default, while slapping proper sights on it makes it able to hit the broad side of a barn even with the secondary fire modes.
Additional context
Fun fact, auxiliary guns can also accept magazines, so this would make cursed things like this a bit more feasible:

If anyone can find other properties involving gunmods that absolutely should apply to second-mag gunmods but don't, please do point me to where the offending code may be.
Checklist
Mandatory
closes #1234
in Summary of the PR so it can be closed automatically.main
so it won't cause conflict when updatingmain
branch later.