From 7bfcd50e21789127f88a9364d2446f9a6f2edc7b Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Sat, 29 Jun 2024 23:32:05 -0400 Subject: [PATCH] fix warlock drain life apl value --- sim/warlock/apl_values.go | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/sim/warlock/apl_values.go b/sim/warlock/apl_values.go index 2ece94cc1d..98c2f6da35 100644 --- a/sim/warlock/apl_values.go +++ b/sim/warlock/apl_values.go @@ -55,27 +55,11 @@ func (value *APLValueWarlockShouldRecastDrainSoul) GetBool(sim *core.Simulation) return false } - var curseOfAgonyDuration time.Duration = 0 - for _, spell := range warlock.CurseOfAgony { - if spell.CurDot().IsActive() { - curseOfAgonyDuration = spell.CurDot().RemainingDuration(sim) - break - } + curseRefresh := time.Duration(0) + if warlock.ActiveCurseAura != nil { + curseRefresh = warlock.ActiveCurseAura.RemainingDuration(sim) } - var curseOfDoomDuration time.Duration = 0 - if warlock.CurseOfDoom.CurDot().IsActive() { - curseOfDoomDuration = warlock.CurseOfDoom.CurDot().RemainingDuration(sim) - } - - curseRefresh := max( - curseOfAgonyDuration, - curseOfDoomDuration, - warlock.CurseOfElementsAuras.Get(warlock.CurrentTarget).RemainingDuration(sim), - // warlock.CurseOfTonguesAuras.Get(warlock.CurrentTarget).RemainingDuration(sim), - // warlock.CurseOfWeaknessAuras.Get(warlock.CurrentTarget).RemainingDuration(sim), - ) - hauntRefresh := 1000 * time.Second if warlock.HauntDebuffAuras != nil { hauntRefresh = warlock.HauntDebuffAuras.Get(warlock.CurrentTarget).RemainingDuration(sim) - @@ -83,16 +67,14 @@ func (value *APLValueWarlockShouldRecastDrainSoul) GetBool(sim *core.Simulation) warlock.Haunt.TravelTime() } - timeUntilRefresh := curseRefresh - // the amount of ticks we have left, assuming we continue channeling dsDot := warlock.ChanneledDot - ticksLeft := int(timeUntilRefresh/dsDot.TickPeriod()) + 1 + ticksLeft := int(curseRefresh/dsDot.TickPeriod()) + 1 ticksLeft = min(ticksLeft, int(hauntRefresh/dsDot.TickPeriod())) ticksLeft = min(ticksLeft, dsDot.NumTicksRemaining(sim)) // amount of ticks we'd get assuming we recast drain soul - recastTicks := int(timeUntilRefresh/warlock.ApplyCastSpeed(dsDot.TickLength)) + 1 + recastTicks := int(curseRefresh/warlock.ApplyCastSpeed(dsDot.TickLength)) + 1 recastTicks = min(recastTicks, int(hauntRefresh/warlock.ApplyCastSpeed(dsDot.TickLength))) recastTicks = min(recastTicks, int(dsDot.NumberOfTicks))