Implemented ValuesPerItemName filter for magiceffects #12
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.
Motivation: there are several effects with plain numbers (like +hp, +stamina, plain +hp regen) that providing the same max values (like +20 for hp) can make early game items very strong but don't matter much for the late game. Without the possibility to set effects per item name it's impossible to make leather belt, gold ring and silver ring to be distinguishable (from gameplay perspective) since they occupy the same slot and have similar effects. There is similar problem with capes - it's much harder to get late game capes but they provide basically the same bonus (except their innate abilities like preventing freezing) as early game ones since there is almost no basic armor scaling on capes at all (in comparison with any other armor).
Also, settings effects per item name will allow overall more flexible configurations (one example can be making bronze armor finally worthy in comparison with troll one just by providing the former with much better ranges for +armor effect).
Backward compatibility: requires changing of MagicItem (ItemName field required). According to my tests, works with legacy items (of course, they have outdated effects) but maybe there can be situations where new world creation (removal of old items) is required.
Example 1 of usage (magiceffects.json part):
In the first example IncreaseHealth effect is tuned down for early game armor, more for rags, less for bronze/troll. Since there is no ValuesPerItemName filter set for any other items, they get default values from common ValuesPerRarity filter.
Example 2:
Sets different plain +hp regen for different Utility items.