Fix Damage conversion / gain calcs #1374
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.
calcConvertedDamage was using the wrong order of variables for the function so it wasn't taking into account gained damage if a skill had innate conversion on it.
E.g. Skill has 50% convert phys to fire and tree has 20% elemental as extra lightning, it was not finding the fire damage that had been converted, so the ele as extra lightning was not giving any damage
Now that this was fixed though, it wasn't taking into account the proportion of damage converted from a skill when calculating gain as
e.g. 100% skill phys to fire stops mods like 20% phys as extra fire from working as there is no more base phys damage to scale from
Lastly, a bug that GGG fixed where damage mods that increased the maximum amount of a damage type (e.g. 30% more maximum phys) were affecting damage types after conversion
e.g. 100 to 100 phys damage skill with 30% more maximum phys and 100% skill phys to fire should have 100 to 100 fire damage, not 100 to 130 fire that PoB currently shows
I hope this is all the conversion issues fixed now
Test build:
https://maxroll.gg/poe2/pob/0yi7a0q2
Fixes #272, Fixes #1003, Fixes #1078
Before:

After:
