Add support for "Walker of the Wilds" Keystone and other "leech recovers based on x" mods #1348
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.
Description of the problem being solved:
Adds support for several "leech based on x" mods including (but not limited to):
This also refactors the area of the code that determines base leech values and standardizes some of the flag naming logic for previously existing mods.
Finally, it also adds two technical things:
hasTagtomodlibinModTools.luathat determines whether a mod includes a given specific tag. From what I could tell this functionality did not previously exist, but was very useful when converting phys leech without deleting the original mod (as it might apply multiple times) and also helps to prevent adding a tag multiple times. Pretty sure that it could be useful in other scenarios as well.true/falsevia thecfgpassed toModStore:GetCondition. I had a problem with this because I needed to tabulate the values for physical leech, even though they were not applying due to the flag that disables them. Adding an option to force the value for a single calculation seemed easier than actually changing the condition on the actor, only to change it back after.Steps taken to verify a working solution:
Link to a build that showcases this PR:
Leech Test Build
includes items for testing different combinations
After screenshot:
Leech Breakdown without converion


Leech Breakdown with conversion (note that the item mod now specifies "elemental leech" instead of physical leech