Jsonizes material reinforcing potential #29404
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "The ability to reinforce a material is now tied to json."
Purpose of change
After playing with the inability to reinforce hard materials, I've since gotten over the fact that it's not actually that bad, but I do think that jsonizing where appropriate is always better than C++ hardcoding. (Considering jsonizing sleep comfort for furniture next...)
Describe the solution
Adds a new json field called
reinforces
to materials, which is enabled for Cotton, Leather, and Wool by default. I replaced the hardcoded checks for cotton, wool, and leather in reinforcing items for a call of a new function onitem
calledreinforces()
that checks if a material can be reinforced in the item's construction, and allows reinforcement if one exists.This makes it easier for mods to edit existing materials, and much easier for adding new cloth materials down the line (for instance, if someone wants to add a Silk material, they don't have to worry about editing C++ to do that.)
Also added a notice that an item can be reinforced in its description, since it's no longer the norm for most clothing and armor in the game.