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

Jsonizes material reinforcing potential #29404

Merged
merged 3 commits into from
Apr 9, 2019
Merged

Jsonizes material reinforcing potential #29404

merged 3 commits into from
Apr 9, 2019

Conversation

Ilysen
Copy link
Contributor

@Ilysen Ilysen commented Apr 9, 2019

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 on item called reinforces() 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.

src/item.cpp Outdated Show resolved Hide resolved
@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Items / Item Actions / Item Qualities Items and how they work and interact labels Apr 9, 2019
@kevingranade kevingranade merged commit 7cafa75 into CleverRaven:master Apr 9, 2019
@Ilysen Ilysen deleted the MaterialJsonize branch April 9, 2019 23:49
@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/can-you-no-longer-upgrade-some-weapons-to-status/22277/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants