Skip to content

Fix 100% or more reduced attack speed giving negative speed and inflated ailments - #10514

Open
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/5288-negative-attack-speed
Open

lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/5288-negative-attack-speed

Conversation

@lucaskarsten

Copy link
Copy Markdown
Contributor

Fixes #5288

Description of the problem being solved:

With 100% or more reduced attack speed, the increased/more speed multiplier in CalcOffence was 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 through m_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:

  • Added 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). On dev 4 of the 5 fail (bleed 0.21 at 100%, speed -0.144 at 104%); all pass on this branch.
  • Full busted suite: 750 successes, 0 failures.
  • --tags=builds (the saved 3.13 builds): the same 900 failures, with identical messages, on dev and 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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Having negative attack speed inflates bleeds.

1 participant