Skip to content

Commit

Permalink
fix warlock DoTW calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Dec 29, 2024
1 parent 535e7be commit fca3e8d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sim/warlock/runes.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,24 @@ func (warlock *Warlock) applyDanceOfTheWicked() {
}

actionId := core.ActionID{SpellID: 412800}
critDelta := 0.0
lastCritSnapshot := 0.0

// DoTW snapshot your current crit each time it procs so we want to store the delta from each proc
// DoTW snapshot your current crit each time it procs so we want to add the delta between the last and current snapshot
dotwAura := warlock.GetOrRegisterAura(core.Aura{
ActionID: actionId,
Label: "Dance of the Wicked Proc",
Duration: 15 * time.Second,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
critDelta = 0
lastCritSnapshot = 0
},
OnRefresh: func(aura *core.Aura, sim *core.Simulation) {
critDelta = warlock.GetStat(stats.SpellCrit) - critDelta
warlock.AddStatDynamic(sim, stats.Dodge, critDelta)
newCritSnapshot := warlock.GetStat(stats.SpellCrit)
warlock.AddStatDynamic(sim, stats.Dodge, newCritSnapshot-lastCritSnapshot)
fmt.Println(sim.CurrentTime, "Current Crit:", warlock.GetStat(stats.SpellCrit), "Old Crit:", lastCritSnapshot, "Delta:", warlock.GetStat(stats.SpellCrit)-lastCritSnapshot)
lastCritSnapshot = newCritSnapshot
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
warlock.AddStatDynamic(sim, stats.Dodge, -critDelta)
warlock.AddStatDynamic(sim, stats.Dodge, -lastCritSnapshot)
},
})

Expand Down

0 comments on commit fca3e8d

Please sign in to comment.