Skip to content

Commit

Permalink
fix ele t10 (#3919)
Browse files Browse the repository at this point in the history
* fix ele t10

* faster

* update tests
  • Loading branch information
lime-green authored Oct 19, 2023
1 parent f5e24b3 commit 35ea798
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sim/shaman/elemental/TestElemental.results
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ dps_results: {
dps_results: {
key: "TestElemental-AllItems-FrostWitch'sRegalia"
value: {
dps: 8146.52207
tps: 4515.57676
dps: 8209.20382
tps: 4559.89103
}
}
dps_results: {
Expand Down
21 changes: 19 additions & 2 deletions sim/shaman/items_wotlk.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package shaman

import (
"math"
"time"

"github.com/wowsims/wotlk/sim/core"
Expand Down Expand Up @@ -60,8 +61,24 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
fsDot := shaman.FlameShock.Dot(result.Target)
if spell == shaman.LavaBurst && fsDot.IsActive() { // Doesn't have to hit from tooltip
// Modify dot to last 6 more seconds than it has left, and refresh aura
fsDot.Duration = fsDot.RemainingDuration(sim) + time.Second*6
// Find the number of ticks whose duration is closest to 6s.
// "our testing confirms that the 4pc t10 setbonus adds to FS the closest number of ticks to 6 seconds always"
// https://web.archive.org/web/20100808192139/http://elitistjerks.com/f79/t76510-elemental_patch_3_3_now_more_fire_nova/p25/
numTicks := 2
period := fsDot.TickPeriod()
sixSeconds := time.Second * 6

for i := 3; i <= 10; i++ {
finishesAtCur := time.Duration(numTicks) * period
finishesAtNew := time.Duration(i) * period

if math.Abs(float64(sixSeconds-finishesAtNew)) <= math.Abs(float64(sixSeconds-finishesAtCur)) {
numTicks = i
} else {
break
}
}
fsDot.Duration = fsDot.RemainingDuration(sim) + time.Duration(numTicks)*period
fsDot.Refresh(sim)
}
},
Expand Down

0 comments on commit 35ea798

Please sign in to comment.