Repository navigation
Fix 100% or more reduced attack speed giving negative speed and inflated ailments - #10514
Open
lucaskarsten wants to merge 1 commit into
Open
lucaskarsten wants to merge 1 commit into
lucaskarsten wants to merge 1 commit into
Conversation
…ted ailments With 100% or more reduced speed, the increased/more multiplier was used as is, so the skill speed and hit DPS went negative. Ailments then took the "skill with no attack time" path, which assumes a single use and no longer scales stacks by speed, so bleed jumped from 0.04 at 99% reduced to 0.21 at 100% reduced. Floor the speed at 0 when the multiplier is 0 or lower, and give bleed, poison and ignite no stacks in that case instead of the single use fallback.
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 #5288
Description of the problem being solved:
With 100% or more reduced attack speed, the increased/more speed multiplier in
CalcOffencewas used as is (baseTime / round((1 + inc/100) * more, 2)), so the skill speed and hit DPS went negative.The ailments then made it worse: bleed, poison and ignite only scale their stacks by hits per second when the speed is above 0, and otherwise assume a skill with no attack/cast time that is used once. At 0 or negative speed they fell back to a full single use, so the ailment DPS jumped instead of going down. Ignite on skills with a
Cooldown(even 0) went throughm_max(Cooldown, Time)with both at 0 and came out invalid.This PR floors the speed at 0 when the multiplier is 0 or lower: the skill is never used, so it doesn't hit, and bleed, poison and ignite get no stacks in that case instead of the single use fallback. Skills whose speed comes from trigger rates, cooldown overrides, traps/mines or totems that fire once don't go through this line and are unchanged.
Note: in game you can't attack at all with 100% or more reduced attack speed; I couldn't confirm the exact client behaviour, so this treats it as "the skill is never used". Not addressed here (pre-existing, same family as #4996): Trauma stack sustain with more than 100% reduced attack speed, and the speed breakdown showing inf at 0.
Steps taken to verify a working solution:
spec/System/TestAttackSpeedFloor_spec.lua: at 99% reduced, speed, bleed, poison and ignite are still above 0; at 100%, 104% and 150% reduced (Cyclone) speed, hit DPS, bleed, total poison, ignite and combined DPS are all 0; the same for a cooldown attack (Vigilant Strike with a sword). Ondev4 of the 5 fail (bleed 0.21 at 100%, speed -0.144 at 104%); all pass on this branch.--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:
Cyclone (or Vigilant Strike) with 100% chance to Bleed and "X% reduced Attack Speed" in custom modifiers, X from 99 to 150.
Before screenshot:
Vigilant Strike, Corroded Blade: 99% reduced: Bleed DPS 0.19. 100% reduced: Bleed DPS 3.14, Combined DPS 4.08. 104% reduced: attack speed -0.049, hit DPS -0.196.
After screenshot:
99% reduced: unchanged (Bleed DPS 0.19). 100% and 104% reduced: attack speed 0, hit, bleed, poison, ignite and combined DPS 0.