Repository navigation
Fix minimum/maximum damage mods not applying to fully converted damage - #10508
Open
lucaskarsten wants to merge 2 commits into
Open
lucaskarsten wants to merge 2 commits into
lucaskarsten wants to merge 2 commits into
Conversation
Damage types with no base damage of their own (e.g. Lightning on a spell whose Physical damage is 100% converted) returned the converted damage before their "more/increased Minimum/Maximum <Type> Damage" modifiers were applied, so Roiling Tempest and similar mods did nothing for phys to lightning spells.
…t chained and gained conversion
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #10407
Description of the problem being solved:
Roiling Tempest ("25% more Maximum Lightning Damage / 50% less Minimum Lightning Damage") and any custom "more/increased Minimum/Maximum Damage" did nothing on spells whose damage is fully converted to that type (e.g. Divine Ire, Storm Burst or Hydrosphere with Physical to Lightning).
In
calcDamage, a damage type with no base damage of its own (baseMin == 0 and baseMax == 0) returned the damage converted into it straight away, skipping all its modifiers. That is fine for the normal increased/more mods, because those of the destination type are already applied while calculating the source type (the type flags are carried down the conversion chain), but theMin<Type>Damage/Max<Type>Damagemods are only looked up for the type being calculated, so they were lost. When the type also has some base damage, the same mods were already applied to the converted part ((base... + addMax) * moreMaxDamage * incMaxDamage), so the result depended on whether the skill had any base damage of that type.The min/max lookups now happen before that early return and are applied to the converted damage there too, for every damage type. The breakdown row of that type now shows the multipliers in the More/less column (e.g.
x 0.5 min, x 1.25 max) so the jump from Converted Damage to Total is explained.Side effects, all through the same
calcDamage:calcAilmentSourceDamage) and minions that convert damage get the same correction.Steps taken to verify a working solution:
TestOffence_spec.lua: Bladefall with 100% of Physical converted to Lightning, plus "25% more Maximum Lightning Damage" and "50% less Minimum Lightning Damage". Lightning max goes from 535 to 669 and min from 356 to 178. Ondevit stays at 535 (the test fails).devthe three Roiling tempest and custom modifier "more maximum lightning damage" doesnt seem to apply for phys2light conversion #10407 tests fail (26 successes / 3 failures inTestOffence_spec.lua); on this branch 29 / 0.dev--tags=builds(the saved 3.13 builds): the same 900 failures, with identical messages, ondevand on this branch, so no saved-build output changed.Link to a build that showcases this PR:
The build in the issue, with "25% more Maximum Lightning Damage" and "50% less Minimum Lightning Damage" added as custom modifiers.
Before screenshot:
Storm Burst: 277 to 416 Lightning Damage, with or without the mods.
After screenshot:
Storm Burst: 138 to 520 Lightning Damage with the mods.