Skip to content
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

Stocks, stock accessories, new C++ handling for Folding Stocks #55802

Merged
merged 7 commits into from
Mar 4, 2022

Conversation

bombasticSlacks
Copy link
Contributor

@bombasticSlacks bombasticSlacks commented Mar 3, 2022

Summary

Content "Folding Stocks that fold on activate, Stock accessories"

Purpose of change

#55428 back-end implementation stuff. Plus the part I want which is functioning folding stocks.

Describe the solution

This PR does the following:

  1. Splits Stocks and Stock Accessories.
  2. Adds an explicit Handling modifier to stocked guns vs pistols, this was hidden in the C++ but I wanted to make it clearer with a comment.
  3. Removes the Stock slot from the bullpup HWP and added an adjustable integrated bullpup stock.
  4. Added two new C++ flags, COLLAPSED_STOCK and FOLDED_STOCK. Folded is for guns which the stock folds to the side, reducing length but not volume. Collapsed is for guns like the MP7 where the stock presses into the body saving volume and length.
  5. Added transforms and the folded versions to the wire and folding stock
  6. Added a high end adjustable folding stock to replace one in CRIT mod (since butt hooks now have their own slot).
  7. Added lengths and volumes to things that were missing them like butt hooks.
  8. Made it so integral length counts stock and stock accessories separately when calculating gun length
  9. Added a name suffix for (folded) to guns so people don't fire their folded guns like dum dums
  10. Made the wire stock irremovable since it's exclusively used on guns where it is or at least probably shouldn't be removable and migratable to other guns.
  11. Fixed a simple bug with gun mods and transforms not detecting.

Specifically:

  • Somehow managed to keep the nebulous system where guns with stocks and without are all handled implicitly without the player thinking about it.
  • Butt hooks, and cheek pads are now on a separate slot "stock accessories". I went through and added these slots to every gun that could realistically take em. this is most the churn in this PR
  • COLLAPSED_STOCK is a flag that uses the old rules for reducing volume of folded guns. FOLDED_STOCK no longer decreases volume, the stock is still there just folded to the side. However both these flags now reduce 20cm off the length of the gun. Slime in Sawing off weapon stocks and better folding stocks #55428 estimates cut off at 26-24cm. With a folding stock its not as efficient as cutting off since there is either the back of stock still or the joint it folds on.
  • Any folded stock gets -10 to handling (reminder stock weapons get 20 handling, pistols get 10)
  • Added a non vanilla used high end stock which I'm gonna put on some fancy guns at some point. Currently it replaces a CRIT stock that doesn't make sense now that butt hooks are their own slot.
  • Butt hooks are now 4cm of additional length.
  • If an item is a gun the game checks if it has either of the added flags and then appends (folded) to it's name to let people play smart.

Describe alternatives you've considered

Adding dispersion changes as well, however this isn't currently handled in game and I didn't want to scope creep anymore.

Adding rules for buffer tube rifles.

Testing

Everything works in game as far as I can see. Gonna get yelled at by generic guns.

Additional context

Collapsed Vs Noncollapsed
image

Folded Vs Nonfolded
image

Accessories on a gun
image

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Mar 3, 2022
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Mar 3, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 3, 2022
@TheShadowFerret
Copy link
Contributor

Added a name suffix for (folded) to guns so people don't fire their folded guns like dum dums

That sign won't stop me because I can't read! :)

@Maleclypse Maleclypse added Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON labels Mar 3, 2022
@kevingranade kevingranade merged commit 05c305f into CleverRaven:master Mar 4, 2022
Copy link
Contributor

@Faalagorn Faalagorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marked missing apostrophes

"id": "FOLDED_STOCK",
"//": "for weapons that stock folds to one side, no change in volume.",
"type": "json_flag",
"info": "This items stock is folded it will be hard to shoot with."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items → item's

Copy link
Contributor

@Faalagorn Faalagorn Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing comma before "it" (or better yet, ", so it")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also give tag as well while at it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally (sorry about the comment streak); "item" or "gun"? I think there's no other items that can have stocks.

"id": "COLLAPSED_STOCK",
"//": "for weapons that stock collapses into the body reducing volume as well.",
"type": "json_flag",
"info": "This items stock is collapsed it will be hard to shoot with."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items → item's

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing comma before "it" (same as above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants