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

JSONize gunmod weight multiplier #36388

Merged
merged 7 commits into from
Dec 27, 2019
Merged

Conversation

pawnishoovy
Copy link
Contributor

Summary

SUMMARY: Infrastructure "JSONize gunmod weight multiplier'"

Purpose of change

Gunmods such as lightweight replacement furniture are hardcoded at a weight multiplier of 0.75 and this cannot be changed through JSON alone.

Describe the solution

This PR removes the REDUCED_WEIGHT flag from lightweight replacement furniture and instead adds a new JSON variable "weight_multiplier" that affects gun weight in the same way REDUCED_WEIGHT did.

REDUCED_WEIGHT has NOT been removed from the game and may still be in use elsewhere.

Describe alternatives you've considered

N/A

Testing

Take a gun and lightweight replacement furniture
Apply the furniture gunmod
See as gun weight is affected despite no REDUCED_WEIGHT flag

Additional context

This will allow even more innate-weight-affecting gunmods with different values. For a hypothetical, a steel-to-titanium gunmod that affects multiplies weight by 0.5 instead of 0.75.

@ghost
Copy link

ghost commented Dec 23, 2019

Did you test if the weight of other attached gunmods gets altered by this weight multiplier?

@pawnishoovy
Copy link
Contributor Author

Did you test if the weight of other attached gunmods gets altered by this weight multiplier?

It does not change the weight of other mods, i.e. it works correctly. Just tested now as we speak.

@pawnishoovy
Copy link
Contributor Author

Unsure what's wrong with the travis check, I've astyled everything with 3.0.1 and the options given in the instructions.

src/itype.h Outdated Show resolved Hide resolved
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
@kevingranade kevingranade merged commit 5c0b19e into CleverRaven:master Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants