forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSONize flag-based modifiers on comestible enjoyability (CleverRaven#…
…35813) * JSONize flag taste modifiers There was only a single flag that affected the "fun" value of comestibles (BAD_TASTE) but I want to add more for a water sanitation rework, so rather than hardcoding more, I JSONized the process. Adds a new member variable to json_flag objects, "taste_mod," which additively modifies the enjoyability of comestibles. This is done via a new function, "item::get_comestible_fun". The MUSHY flag check was moved there from Character::fun_for as well. "item::get_comestible_fun" is of course called in "Character::fun_for", so this commit shouldn't have any functional changes. * Make "islot_comestible::fun" private Anyone trying to query a comestible's "fun" should be using the new "item::get_comestible_fun" method. This commit is to enforce that. Of course, that had to be reconciled with the current usage of "fun". I added "item" and "Item_factory" as friends of "islot_comestible" so that "item::get_comestible_fun" and the function that sets "fun" still have access to it. All other queries of "fun" were instead changed to the new method. This has the side-effect of applying BAD_TASTE and MUSHY effects in places where they didn't before, including but not limited to: - Interaction with taste blocker bionic. - NPCs making decisions about faction food stocks. - NPCs making decisions about whether they personally want food. - Scavenging monsters deciding whether to eat food off the ground. * Apply suggestions from code review Co-Authored-By: BevapDin <[email protected]> * Subjugate rogue tab (i.e. astyle) * Fix merge mistake
- Loading branch information
1 parent
81be329
commit b1cff02
Showing
12 changed files
with
96 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters