Skip to content

Commit

Permalink
Separate reschedule and extend
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed Oct 30, 2023
1 parent 7318b67 commit 89729ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 2 additions & 5 deletions sim/core/dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ func (dot *Dot) Rollover(sim *Simulation) {
sim.AddPendingAction(dot.tickAction)
}

func (dot *Dot) RescheduleNextTickAndExtend(sim *Simulation, numTicks int32) {
dot.NumberOfTicks += numTicks
// Set duration to remaining ticks, minus the elapsed time since last tick
dot.Aura.Duration = time.Duration(dot.MaxTicksRemaining())*dot.tickPeriod - sim.CurrentTime + dot.lastTickTime
dot.Aura.Refresh(sim) // update aura's duration
func (dot *Dot) RescheduleNextTick(sim *Simulation) {
dot.RecomputeAuraDuration()

dot.tickAction.Cancel(sim) // remove old PA ticker

Expand Down
10 changes: 8 additions & 2 deletions sim/shaman/items_wotlk.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{
OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
fsDot := shaman.FlameShock.Dot(shaman.CurrentTarget)
if spell == shaman.LavaBurst && fsDot.IsActive() { // Doesn't have to hit from tooltip
// 4p t10 immediately updates the tickPeriod based on current haste
fsDot.RescheduleNextTick(sim)

// 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/
fsDot.RecomputeAuraDuration()
tickPeriod := fsDot.TickPeriod()
numTicks := int32(math.Round(float64(time.Second) * 6 / float64(tickPeriod)))
fsDot.RescheduleNextTickAndExtend(sim, numTicks)
fsDot.NumberOfTicks += numTicks

// Set duration to remaining ticks, minus the elapsed time since last tick
fsDot.Aura.Duration = time.Duration(fsDot.MaxTicksRemaining())*tickPeriod - (tickPeriod - (fsDot.NextTickAt() - sim.CurrentTime))
fsDot.Aura.Refresh(sim) // update aura's duration
}
},
})
Expand Down

0 comments on commit 89729ff

Please sign in to comment.