From 612c7455d34f0878c88aa2b0061dce362b0983df Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 6 Dec 2022 12:42:28 -0500 Subject: [PATCH 1/5] wip --- sim/core/runic_power.go | 7 +++ sim/deathknight/army_of_the_dead.go | 2 +- sim/deathknight/blood_boil.go | 2 +- sim/deathknight/blood_strike.go | 2 +- sim/deathknight/bone_shield.go | 2 +- sim/deathknight/dancing_rune_weapon.go | 2 +- sim/deathknight/death_and_decay.go | 2 +- sim/deathknight/death_coil.go | 2 +- sim/deathknight/death_pact.go | 2 +- sim/deathknight/death_strike.go | 2 +- .../dps/rotation_frost_sub_blood_desync.go | 45 ++++++++++++++++--- sim/deathknight/dps/rotation_shared_helper.go | 10 ++++- sim/deathknight/frost_strike.go | 2 +- sim/deathknight/ghoul_frenzy.go | 2 +- sim/deathknight/heart_strike.go | 2 +- sim/deathknight/horn_of_winter.go | 2 +- sim/deathknight/howling_blast.go | 2 +- sim/deathknight/icy_touch.go | 2 +- sim/deathknight/mark_of_blood.go | 3 +- sim/deathknight/obliterate.go | 3 +- sim/deathknight/pestilence.go | 2 +- sim/deathknight/plague_strike.go | 2 +- sim/deathknight/presences.go | 2 +- sim/deathknight/raise_dead.go | 2 +- sim/deathknight/scourge_strike.go | 2 +- sim/deathknight/summon_gargoyle.go | 2 +- 26 files changed, 79 insertions(+), 31 deletions(-) diff --git a/sim/core/runic_power.go b/sim/core/runic_power.go index 053a6eba86..5bdba19c22 100644 --- a/sim/core/runic_power.go +++ b/sim/core/runic_power.go @@ -386,6 +386,13 @@ func (rp *RunicPowerBar) UnholyRuneReadyAt(sim *Simulation) time.Duration { return MinDuration(rp.runeMeta[4].regenAt, rp.runeMeta[5].regenAt) } +func (rp *RunicPowerBar) RuneReadyAt(sim *Simulation, slot int8) time.Duration { + if rp.runeStates&isSpents[slot] != isSpents[slot] { + return sim.CurrentTime + } + return rp.runeMeta[slot].regenAt +} + // AnySpentRuneReadyAt returns the next time that a rune will regenerate. // // It will be NeverExpires if there is no rune pending regeneration. diff --git a/sim/deathknight/army_of_the_dead.go b/sim/deathknight/army_of_the_dead.go index 0fbb055fc8..009ef3a84f 100644 --- a/sim/deathknight/army_of_the_dead.go +++ b/sim/deathknight/army_of_the_dead.go @@ -60,7 +60,7 @@ func (dk *Deathknight) registerArmyOfTheDeadCD() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/blood_boil.go b/sim/deathknight/blood_boil.go index bd80d86d9f..81550b6a99 100644 --- a/sim/deathknight/blood_boil.go +++ b/sim/deathknight/blood_boil.go @@ -27,7 +27,7 @@ func (dk *Deathknight) registerBloodBoilSpell() { Cost: float64(baseCost), }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, }, diff --git a/sim/deathknight/blood_strike.go b/sim/deathknight/blood_strike.go index 35d1f01271..c6cf460494 100644 --- a/sim/deathknight/blood_strike.go +++ b/sim/deathknight/blood_strike.go @@ -71,7 +71,7 @@ func (dk *Deathknight) newBloodStrikeSpell(isMH bool) *RuneSpell { Cost: conf.BaseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } diff --git a/sim/deathknight/bone_shield.go b/sim/deathknight/bone_shield.go index e2d417cde9..f6a64b7973 100644 --- a/sim/deathknight/bone_shield.go +++ b/sim/deathknight/bone_shield.go @@ -57,7 +57,7 @@ func (dk *Deathknight) registerBoneShieldSpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: cdTimer, diff --git a/sim/deathknight/dancing_rune_weapon.go b/sim/deathknight/dancing_rune_weapon.go index c0f8d8605f..a18f46828d 100644 --- a/sim/deathknight/dancing_rune_weapon.go +++ b/sim/deathknight/dancing_rune_weapon.go @@ -52,7 +52,7 @@ func (dk *Deathknight) registerDancingRuneWeaponCD() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/death_and_decay.go b/sim/deathknight/death_and_decay.go index cd8b6f504f..484c585816 100644 --- a/sim/deathknight/death_and_decay.go +++ b/sim/deathknight/death_and_decay.go @@ -26,7 +26,7 @@ func (dk *Deathknight) registerDeathAndDecaySpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/death_coil.go b/sim/deathknight/death_coil.go index 76be1119aa..294715f5f0 100644 --- a/sim/deathknight/death_coil.go +++ b/sim/deathknight/death_coil.go @@ -28,7 +28,7 @@ func (dk *Deathknight) registerDeathCoilSpell() { cast.GCD = 0 cast.Cost = 0 } else { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() } }, }, diff --git a/sim/deathknight/death_pact.go b/sim/deathknight/death_pact.go index 76add0600e..d77d74fa99 100644 --- a/sim/deathknight/death_pact.go +++ b/sim/deathknight/death_pact.go @@ -29,7 +29,7 @@ func (dk *Deathknight) registerDeathPactSpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: cdTimer, diff --git a/sim/deathknight/death_strike.go b/sim/deathknight/death_strike.go index 0e49953fdd..a6d3fd648e 100644 --- a/sim/deathknight/death_strike.go +++ b/sim/deathknight/death_strike.go @@ -78,7 +78,7 @@ func (dk *Deathknight) newDeathStrikeSpell(isMH bool) *RuneSpell { Cost: conf.BaseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } diff --git a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go index 485ac93d92..534b064f4c 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go @@ -74,6 +74,7 @@ func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { NewAction(dk.RotationActionCallback_UA_Frost). NewAction(dk.RotationActionCallback_BT). NewAction(dk.RotationActionCallback_FrostSubBlood_Obli). + NewAction(dk.RotationAction_CancelBT). NewAction(dk.RotationActionCallback_FrostSubBlood_Sequence_Pesti_Desync). NewAction(dk.RotationActionCallback_FS). NewAction(dk.RotationActionCallback_RD). @@ -82,6 +83,31 @@ func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { NewAction(dk.RotationActionCallback_FrostSubBlood_DesyncRotation) } +func (dk *DpsDeathknight) canCastInDesyncWindow(sim *core.Simulation, spell *deathknight.RuneSpell) bool { + if !dk.RuneIsDeath(1) { + return true + } + + gcd := dk.GetGcdDuration(spell) + u := dk.UnholyRuneReadyAt(sim) + f := dk.FrostRuneReadyAt(sim) + d := dk.RuneReadyAt(sim, 1) + + if f <= sim.CurrentTime || u <= sim.CurrentTime { + return true + } + + if !(d <= f && f < u) { + return true + } + + if f+gcd >= u { + return false + } + + return true +} + func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_DesyncRotation(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { t := sim.CurrentTime ff := dk.FrostFeverDisease[target.Index].ExpiresAt() - t @@ -105,6 +131,11 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_DesyncRotation(si return -1 } + if dk.RuneIsDeath(0) && dk.RuneIsDeath(1) && dk.LeftBloodRuneReady() && dk.RightBloodRuneReady() { + dk.Pestilence.Cast(sim, target) + return -1 + } + if ff <= 0 { dk.IcyTouch.Cast(sim, target) return -1 @@ -138,37 +169,37 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_DesyncRotation(si } - if km && dk.FrostStrike.CanCast(sim) && dk.shDiseaseCheck(sim, target, dk.FrostStrike, false, 1, 0) { + if km && dk.FrostStrike.CanCast(sim) && dk.shDiseaseCheck(sim, target, dk.FrostStrike, false, 1, 0) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.FrostStrike.Cast(sim, target) return -1 } - if f > 0 && u > 0 || ((f == 0 && u > 0 && d > 0) || (f > 0 && u == 0 && d > 0)) && dk.shDiseaseCheck(sim, target, dk.Obliterate, true, 1, 0) { + if ((f > 0 && u > 0) || (f == 0 && u > 0 && d > 0) || (f > 0 && u == 0 && d > 0)) && dk.shDiseaseCheck(sim, target, dk.Obliterate, true, 1, 0) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.Obliterate.Cast(sim, target) return -1 } - if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) && dk.CurrentRunicPower() >= 100.0 { + if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) && dk.CurrentRunicPower() >= 100.0 && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.FrostStrike.Cast(sim, target) return -1 } - if t+spGcd <= ob && rime && dk.HowlingBlast.CanCast(sim) && dk.CurrentRunicPower() <= dk.MaxRunicPower()-5.0 { + if t+spGcd <= ob && rime && dk.HowlingBlast.CanCast(sim) && dk.CurrentRunicPower() <= dk.MaxRunicPower()-5.0 && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.HowlingBlast.Cast(sim, target) return -1 } - if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) { + if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.FrostStrike.Cast(sim, target) return -1 } - if t+spGcd <= ob && dk.HornOfWinter.CanCast(sim) && dk.CurrentRunicPower()+10.0 <= dk.MaxRunicPower() { + if t+spGcd <= ob && dk.HornOfWinter.CanCast(sim) && dk.CurrentRunicPower()+10.0 <= dk.MaxRunicPower() && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { dk.HornOfWinter.Cast(sim, target) return -1 } - if dk.LeftBloodRuneReady() { + if dk.LeftBloodRuneReady() && !dk.RuneIsDeath(0) { dk.Pestilence.Cast(sim, target) return -1 } diff --git a/sim/deathknight/dps/rotation_shared_helper.go b/sim/deathknight/dps/rotation_shared_helper.go index 19db106a19..044adcc1f5 100644 --- a/sim/deathknight/dps/rotation_shared_helper.go +++ b/sim/deathknight/dps/rotation_shared_helper.go @@ -18,10 +18,18 @@ func (sr *SharedRotation) Reset(sim *core.Simulation) { sr.recastedBP = false } +func (dk *DpsDeathknight) GetGcdDuration(spell *deathknight.RuneSpell) time.Duration { + gcd := dk.SpellGCD() + if spell.IsMelee() { + gcd = dk.GetModifiedGCD() + } + return gcd +} + func (dk *DpsDeathknight) shDiseaseCheck(sim *core.Simulation, target *core.Unit, spell *deathknight.RuneSpell, costRunes bool, casts int, ffSyncTime time.Duration) bool { ffRemaining := dk.FrostFeverDisease[target.Index].RemainingDuration(sim) bpRemaining := dk.BloodPlagueDisease[target.Index].RemainingDuration(sim) - castGcd := dk.SpellGCD() * time.Duration(casts) + castGcd := dk.GetGcdDuration(spell) * time.Duration(casts) // FF is not active or will drop before Gcd is ready after this cast if !dk.FrostFeverDisease[target.Index].IsActive() || ffRemaining < castGcd { diff --git a/sim/deathknight/frost_strike.go b/sim/deathknight/frost_strike.go index c086725e8f..7b1337e153 100644 --- a/sim/deathknight/frost_strike.go +++ b/sim/deathknight/frost_strike.go @@ -65,7 +65,7 @@ func (dk *Deathknight) newFrostStrikeHitSpell(isMH bool) *RuneSpell { Cost: conf.BaseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } diff --git a/sim/deathknight/ghoul_frenzy.go b/sim/deathknight/ghoul_frenzy.go index 54d007733f..5b27ad578d 100644 --- a/sim/deathknight/ghoul_frenzy.go +++ b/sim/deathknight/ghoul_frenzy.go @@ -56,7 +56,7 @@ func (dk *Deathknight) registerGhoulFrenzySpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/heart_strike.go b/sim/deathknight/heart_strike.go index f05bb18895..754b7270d1 100644 --- a/sim/deathknight/heart_strike.go +++ b/sim/deathknight/heart_strike.go @@ -68,7 +68,7 @@ func (dk *Deathknight) newHeartStrikeSpell(isMainTarget bool, isDrw bool) *RuneS Cost: conf.BaseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } diff --git a/sim/deathknight/horn_of_winter.go b/sim/deathknight/horn_of_winter.go index ffe6f2e3b9..6cc42862b7 100644 --- a/sim/deathknight/horn_of_winter.go +++ b/sim/deathknight/horn_of_winter.go @@ -45,7 +45,7 @@ func (dk *Deathknight) registerHornOfWinterSpell() { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/howling_blast.go b/sim/deathknight/howling_blast.go index 25ef478349..5c0002044c 100644 --- a/sim/deathknight/howling_blast.go +++ b/sim/deathknight/howling_blast.go @@ -36,7 +36,7 @@ func (dk *Deathknight) registerHowlingBlastSpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() if dk.RimeAura.IsActive() { cast.Cost = 0 // no runes, no regen dk.RimeAura.Deactivate(sim) diff --git a/sim/deathknight/icy_touch.go b/sim/deathknight/icy_touch.go index ab36b04384..870e82aa85 100644 --- a/sim/deathknight/icy_touch.go +++ b/sim/deathknight/icy_touch.go @@ -40,7 +40,7 @@ func (dk *Deathknight) registerIcyTouchSpell() { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, }, diff --git a/sim/deathknight/mark_of_blood.go b/sim/deathknight/mark_of_blood.go index 40e4776964..f2f7f1a346 100644 --- a/sim/deathknight/mark_of_blood.go +++ b/sim/deathknight/mark_of_blood.go @@ -29,7 +29,7 @@ func (dk *Deathknight) registerMarkOfBloodSpell() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: cdTimer, @@ -58,3 +58,4 @@ func (dk *Deathknight) registerMarkOfBloodSpell() { }) } } + diff --git a/sim/deathknight/obliterate.go b/sim/deathknight/obliterate.go index 2736bb86f3..2a42615d29 100644 --- a/sim/deathknight/obliterate.go +++ b/sim/deathknight/obliterate.go @@ -78,7 +78,7 @@ func (dk *Deathknight) newObliterateHitSpell(isMH bool) *RuneSpell { Cost: conf.BaseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } @@ -105,3 +105,4 @@ func (dk *Deathknight) registerObliterateSpell() { dk.ObliterateOhHit = dk.newObliterateHitSpell(false) dk.Obliterate = dk.ObliterateMhHit } + diff --git a/sim/deathknight/pestilence.go b/sim/deathknight/pestilence.go index 72dd6f4e7d..699c0d1d8c 100644 --- a/sim/deathknight/pestilence.go +++ b/sim/deathknight/pestilence.go @@ -27,7 +27,7 @@ func (dk *Deathknight) registerPestilenceSpell() { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, }, diff --git a/sim/deathknight/plague_strike.go b/sim/deathknight/plague_strike.go index e0acaa47f3..0e3d536404 100644 --- a/sim/deathknight/plague_strike.go +++ b/sim/deathknight/plague_strike.go @@ -80,7 +80,7 @@ func (dk *Deathknight) newPlagueStrikeSpell(isMH bool) *RuneSpell { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, } diff --git a/sim/deathknight/presences.go b/sim/deathknight/presences.go index ba81d437ff..f517c3908a 100644 --- a/sim/deathknight/presences.go +++ b/sim/deathknight/presences.go @@ -216,7 +216,7 @@ func (dk *Deathknight) registerUnholyPresenceAura(timer *core.Timer) { }) } -func (dk *Deathknight) getModifiedGCD() time.Duration { +func (dk *Deathknight) GetModifiedGCD() time.Duration { if dk.UnholyPresenceAura.IsActive() { return time.Second } else { diff --git a/sim/deathknight/raise_dead.go b/sim/deathknight/raise_dead.go index 4129466912..5259456132 100644 --- a/sim/deathknight/raise_dead.go +++ b/sim/deathknight/raise_dead.go @@ -32,7 +32,7 @@ func (dk *Deathknight) registerRaiseDeadCD() { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), diff --git a/sim/deathknight/scourge_strike.go b/sim/deathknight/scourge_strike.go index 3c952df597..2d9bdf67c2 100644 --- a/sim/deathknight/scourge_strike.go +++ b/sim/deathknight/scourge_strike.go @@ -59,7 +59,7 @@ func (dk *Deathknight) registerScourgeStrikeSpell() { GCD: core.GCDDefault, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, IgnoreHaste: true, }, diff --git a/sim/deathknight/summon_gargoyle.go b/sim/deathknight/summon_gargoyle.go index a18c2604a7..aa63f999d9 100644 --- a/sim/deathknight/summon_gargoyle.go +++ b/sim/deathknight/summon_gargoyle.go @@ -31,7 +31,7 @@ func (dk *Deathknight) registerSummonGargoyleCD() { Cost: baseCost, }, ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) { - cast.GCD = dk.getModifiedGCD() + cast.GCD = dk.GetModifiedGCD() }, CD: core.Cooldown{ Timer: dk.NewTimer(), From 333cccd4a68d1813a8fef8c506f70a06a9107b12 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 7 Dec 2022 18:01:22 -0500 Subject: [PATCH 2/5] merge --- sim/core/runic_power.go | 12 ++++-------- sim/deathknight/dps/rotation_frost_sub_blood.go | 2 +- .../dps/rotation_frost_sub_blood_desync.go | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sim/core/runic_power.go b/sim/core/runic_power.go index 8219a22d5f..52aaf6d11f 100644 --- a/sim/core/runic_power.go +++ b/sim/core/runic_power.go @@ -365,7 +365,10 @@ func (rp *RunicPowerBar) BloodRuneBothReadyAt() time.Duration { } -func (rp *RunicPowerBar) RuneReadyAt(slot int8) time.Duration { +func (rp *RunicPowerBar) RuneReadyAt(sim *Simulation, slot int8) time.Duration { + if rp.runeStates&isSpents[slot] != isSpents[slot] { + return sim.CurrentTime + } return rp.runeMeta[slot].regenAt } @@ -395,13 +398,6 @@ func (rp *RunicPowerBar) UnholyRuneReadyAt(sim *Simulation) time.Duration { return MinDuration(rp.runeMeta[4].regenAt, rp.runeMeta[5].regenAt) } -func (rp *RunicPowerBar) RuneReadyAt(sim *Simulation, slot int8) time.Duration { - if rp.runeStates&isSpents[slot] != isSpents[slot] { - return sim.CurrentTime - } - return rp.runeMeta[slot].regenAt -} - // AnySpentRuneReadyAt returns the next time that a rune will regenerate. // // It will be NeverExpires if there is no rune pending regeneration. diff --git a/sim/deathknight/dps/rotation_frost_sub_blood.go b/sim/deathknight/dps/rotation_frost_sub_blood.go index 4f842232c0..87095e5417 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood.go @@ -180,7 +180,7 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_FS_Dump_UntilUA(s func (dk *DpsDeathknight) getOblitDrift(sim *core.Simulation, castIn time.Duration) time.Duration { spendAt := sim.CurrentTime + castIn - oblit1 := core.MinDuration(dk.RuneReadyAt(2), dk.RuneReadyAt(3)) + oblit1 := core.MinDuration(dk.RuneReadyAt(sim, 2), dk.RuneReadyAt(sim, 3)) oblit2 := core.MinDuration(dk.SpendRuneReadyAt(4, spendAt), dk.SpendRuneReadyAt(5, spendAt)) return oblit2 - oblit1 } diff --git a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go index 534b064f4c..7344928063 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go @@ -75,7 +75,7 @@ func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { NewAction(dk.RotationActionCallback_BT). NewAction(dk.RotationActionCallback_FrostSubBlood_Obli). NewAction(dk.RotationAction_CancelBT). - NewAction(dk.RotationActionCallback_FrostSubBlood_Sequence_Pesti_Desync). + NewAction(dk.RotationActionCallback_Pesti). NewAction(dk.RotationActionCallback_FS). NewAction(dk.RotationActionCallback_RD). NewAction(dk.RotationActionCallback_FS_Special). From 8aa76a1921ba24b5a45d0f9bfffd84a0fd03c1bd Mon Sep 17 00:00:00 2001 From: Josh DM Date: Thu, 8 Dec 2022 00:11:24 -0500 Subject: [PATCH 3/5] refactor --- .../dps/rotation_frost_sub_blood_desync.go | 299 ++++++------------ 1 file changed, 102 insertions(+), 197 deletions(-) diff --git a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go index 7344928063..13131226c2 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go @@ -7,6 +7,23 @@ import ( "github.com/wowsims/wotlk/sim/deathknight" ) +func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { + dk.setupUnbreakableArmorCooldowns() + + dk.RotationSequence. + NewAction(dk.RotationActionCallback_IT). + NewAction(dk.RotationActionCallback_PS). + NewAction(dk.RotationActionCallback_UA_Frost). + NewAction(dk.RotationActionCallback_BT). + NewAction(dk.RotationActionCallback_FrostSubBlood_Obli). + NewAction(dk.RotationAction_CancelBT). + NewAction(dk.RotationActionCallback_Pesti). + NewAction(dk.RotationActionCallback_Frost_FS_HB). + NewAction(dk.RotationActionCallback_RD). + NewAction(dk.RotationActionCallback_FS). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Sequence1) +} + func (dk *DpsDeathknight) oblitRunesAt(sim *core.Simulation) time.Duration { _, f, u := dk.NormalCurrentRunes() d := dk.CurrentDeathRunes() @@ -37,230 +54,118 @@ func (dk *DpsDeathknight) oblitRunesAt(sim *core.Simulation) time.Duration { return sim.CurrentTime } -func (dk *DpsDeathknight) RotationActionCallback_FS_Special(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { - fitsTwo := dk.CurrentRunicPower()/float64(core.RuneCost(dk.FrostStrike.CurCast.Cost).RunicPower()) > 2.0 - km := dk.KM() - - if km || fitsTwo { - dk.FrostStrike.Cast(sim, target) +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Obli(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + casted := false + advance := true - if !fitsTwo { - s.Advance() - } - return -1 - } else { - // TODO: Use the grace period of those runes. - hwExtra := core.TernaryDuration(dk.HornOfWinter.CanCast(sim), dk.SpellGCD(), 0) - ob := dk.oblitRunesAt(sim) - fishingPeriod := ob - 1500*time.Millisecond - hwExtra - nextSwingAt := dk.NextMHSwingAt(sim) + 1 + ff := dk.FrostFeverDisease[target.Index].IsActive() + bp := dk.BloodPlagueDisease[target.Index].IsActive() - if nextSwingAt <= fishingPeriod { - return nextSwingAt - } else { + if ff && bp { + if dk.Obliterate.CanCast(sim) { + if dk.Deathchill != nil && dk.Deathchill.IsReady(sim) { + dk.Deathchill.Cast(sim, target) + } + casted = dk.Obliterate.Cast(sim, target) + advance = dk.LastOutcome.Matches(core.OutcomeLanded) + } else if dk.KM() && dk.FrostStrike.CanCast(sim) { + dk.FrostStrike.Cast(sim, target) + } else if dk.Rime() { + dk.HowlingBlast.Cast(sim, target) + } else if dk.FrostStrike.CanCast(sim) { dk.FrostStrike.Cast(sim, target) - s.Advance() - return -1 } - } -} -func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { - dk.setupUnbreakableArmorCooldowns() - - dk.RotationSequence. - NewAction(dk.RotationActionCallback_IT). - NewAction(dk.RotationActionCallback_PS). - NewAction(dk.RotationActionCallback_UA_Frost). - NewAction(dk.RotationActionCallback_BT). - NewAction(dk.RotationActionCallback_FrostSubBlood_Obli). - NewAction(dk.RotationAction_CancelBT). - NewAction(dk.RotationActionCallback_Pesti). - NewAction(dk.RotationActionCallback_FS). - NewAction(dk.RotationActionCallback_RD). - NewAction(dk.RotationActionCallback_FS_Special). - NewAction(dk.RotationActionCallback_HW). - NewAction(dk.RotationActionCallback_FrostSubBlood_DesyncRotation) -} - -func (dk *DpsDeathknight) canCastInDesyncWindow(sim *core.Simulation, spell *deathknight.RuneSpell) bool { - if !dk.RuneIsDeath(1) { - return true - } - - gcd := dk.GetGcdDuration(spell) - u := dk.UnholyRuneReadyAt(sim) - f := dk.FrostRuneReadyAt(sim) - d := dk.RuneReadyAt(sim, 1) - - if f <= sim.CurrentTime || u <= sim.CurrentTime { - return true - } - - if !(d <= f && f < u) { - return true - } - - if f+gcd >= u { - return false + s.ConditionalAdvance(casted && advance) + } else if !ff { + casted = dk.IcyTouch.Cast(sim, target) + advance = dk.LastOutcome.Matches(core.OutcomeLanded) + s.ConditionalAdvance(casted && advance) + } else { + casted = dk.PlagueStrike.Cast(sim, target) + advance = dk.LastOutcome.Matches(core.OutcomeLanded) + s.ConditionalAdvance(casted && advance) } - return true + return -1 } -func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_DesyncRotation(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { - t := sim.CurrentTime - ff := dk.FrostFeverDisease[target.Index].ExpiresAt() - t - bp := dk.BloodPlagueDisease[target.Index].ExpiresAt() - t - ob := dk.oblitRunesAt(sim) - spGcd := dk.SpellGCD() - abGcd := 1500 * time.Millisecond - b, f, u := dk.NormalCurrentRunes() - d := dk.CurrentDeathRunes() - km := dk.KM() - rime := dk.Rime() +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_UA(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + runeGrace := dk.RuneGraceAt(0, sim.CurrentTime) + waitFor := 100 * time.Millisecond - if b+f+u+int32(d) <= 1 && sim.IsExecutePhase35() && dk.EmpowerRuneWeapon.CanCast(sim) && dk.Rotation.UseEmpowerRuneWeapon && - sim.GetRemainingDuration() <= time.Duration(2.0*float64(dk.UnbreakableArmorAura.Duration)) { - dk.EmpowerRuneWeapon.Cast(sim, target) - dk.castAllMajorCooldowns(sim) - return t + if dk.UnbreakableArmor.IsReady(sim) && dk.BloodTap.IsReady(sim) { + dk.BloodTap.Cast(sim, target) + return sim.CurrentTime + waitFor + } else if dk.UnbreakableArmor.IsReady(sim) && runeGrace >= waitFor { + dk.UnbreakableArmor.Cast(sim, target) } - if dk.RotationActionCallback_LastSecondsCast(sim, target) { - return -1 - } - - if dk.RuneIsDeath(0) && dk.RuneIsDeath(1) && dk.LeftBloodRuneReady() && dk.RightBloodRuneReady() { - dk.Pestilence.Cast(sim, target) - return -1 - } - - if ff <= 0 { - dk.IcyTouch.Cast(sim, target) - return -1 - } - - if bp <= 0 { - dk.PlagueStrike.Cast(sim, target) - return -1 - } - - if ff <= 2*time.Second || bp < 2*time.Second { - dk.Pestilence.Cast(sim, target) - return -1 - } - - if dk.UnbreakableArmor.CanCast(sim) && dk.BloodTap.CanCast(sim) { - - if b > 0 { - dk.UnbreakableArmor.Cast(sim, target) - dk.castAllMajorCooldowns(sim) - dk.BloodTap.Cast(sim, target) - } else if d == 2 { - dk.UnbreakableArmor.Cast(sim, target) - dk.castAllMajorCooldowns(sim) - dk.BloodTap.Cast(sim, target) - } else if b == 0 && d == 0 { - dk.BloodTap.Cast(sim, target) - dk.UnbreakableArmor.Cast(sim, target) - dk.castAllMajorCooldowns(sim) - } + s.Advance() + return -1 +} - } +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Sequence1(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + s.Clear(). + // f1 u1 + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Obli). + // f2 u2 + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Obli). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_FS_Dump). + NewAction(dk.RotationActionCallback_Pesti). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Sequence2) + return sim.CurrentTime +} - if km && dk.FrostStrike.CanCast(sim) && dk.shDiseaseCheck(sim, target, dk.FrostStrike, false, 1, 0) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { - dk.FrostStrike.Cast(sim, target) - return -1 - } +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Sequence2(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + s.Clear(). + // d2 f1 + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Obli). + // f2 u1 + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Obli). + // u2 d1 + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Obli). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_UA). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_FS_Dump). + NewAction(dk.RotationActionCallback_Pesti). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_ERW). + NewAction(dk.RotationAction_CancelBT). + NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Sequence1) + return sim.CurrentTime +} - if ((f > 0 && u > 0) || (f == 0 && u > 0 && d > 0) || (f > 0 && u == 0 && d > 0)) && dk.shDiseaseCheck(sim, target, dk.Obliterate, true, 1, 0) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { - dk.Obliterate.Cast(sim, target) - return -1 +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_FS_Dump(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + if !dk.AllRunesSpent() { + s.Advance() + return sim.CurrentTime } - if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) && dk.CurrentRunicPower() >= 100.0 && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { + if dk.KM() && dk.FrostStrike.CanCast(sim) { dk.FrostStrike.Cast(sim, target) - return -1 - } - - if t+spGcd <= ob && rime && dk.HowlingBlast.CanCast(sim) && dk.CurrentRunicPower() <= dk.MaxRunicPower()-5.0 && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { + } else if dk.Rime() { dk.HowlingBlast.Cast(sim, target) - return -1 - } - - if t+abGcd <= ob && dk.FrostStrike.CanCast(sim) && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { + } else if dk.FrostStrike.CanCast(sim) { dk.FrostStrike.Cast(sim, target) - return -1 - } - - if t+spGcd <= ob && dk.HornOfWinter.CanCast(sim) && dk.CurrentRunicPower()+10.0 <= dk.MaxRunicPower() && dk.canCastInDesyncWindow(sim, dk.FrostStrike) { - dk.HornOfWinter.Cast(sim, target) - return -1 - } - - if dk.LeftBloodRuneReady() && !dk.RuneIsDeath(0) { - dk.Pestilence.Cast(sim, target) - return -1 } return -1 } -func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Sequence_Pesti_Desync(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { - casted := false - waitUntil := time.Duration(-1) +func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_ERW(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { + bothDeath := dk.RuneIsDeath(0) && dk.RuneIsDeath(1) - ff := dk.FrostFeverDisease[target.Index].ExpiresAt() - sim.CurrentTime - bp := dk.BloodPlagueDisease[target.Index].ExpiresAt() - sim.CurrentTime - - if dk.RotationActionCallback_LastSecondsCast(sim, target) { - return -1 - } + if sim.IsExecutePhase35() && dk.UnbreakableArmorAura.IsActive() && dk.Rotation.UseEmpowerRuneWeapon && bothDeath { + dk.castAllMajorCooldowns(sim) - if ff <= 0 || bp <= 0 { - return dk.RotationActionCallback_FrostSubBlood_DesyncRotation(sim, target, s) + // go to normal rotation! + s.Clear(). + NewAction(dk.RotationActionCallback_ERW). + NewAction(dk.RotationActionCallback_Obli). + NewAction(dk.RotationActionCallback_Obli). + NewAction(dk.RotationActionCallback_Obli). + NewAction(dk.RotationActionCallback_FrostSubBlood_SequenceRotation) } else { - casted = dk.Pestilence.Cast(sim, target) - advance := dk.LastOutcome.Matches(core.OutcomeLanded) - if !casted || (casted && !dk.LastOutcome.Matches(core.OutcomeLanded)) { - - if dk.SpellGCD() > ff || dk.SpellGCD() > bp { - return dk.RotationActionCallback_FrostSubBlood_DesyncRotation(sim, target, s) - } else { - s.ConditionalAdvance(casted && advance) - return core.TernaryDuration(casted, -1, waitUntil) - } - } else { - s.ConditionalAdvance(casted && advance) - return core.TernaryDuration(casted, -1, waitUntil) - } + s.Advance() } -} - -func (dk *DpsDeathknight) RotationActionCallback_LastSecondsCast_ERW(sim *core.Simulation, target *core.Unit) bool { - casted := false - - t := sim.CurrentTime - ff := dk.FrostFeverDisease[target.Index].ExpiresAt() - t - bp := dk.BloodPlagueDisease[target.Index].ExpiresAt() - t - - km := dk.KM() - if core.MinDuration(ff, bp) > sim.GetRemainingDuration() { - if dk.Obliterate.CanCast(sim) && ff > 0 && bp > 0 { - casted = dk.Obliterate.Cast(sim, target) - } else if dk.FrostStrike.CanCast(sim) && km { - casted = dk.FrostStrike.Cast(sim, target) - } else if dk.FrostStrike.CanCast(sim) { - casted = dk.FrostStrike.Cast(sim, target) - } else if dk.Obliterate.CanCast(sim) { - casted = dk.Obliterate.Cast(sim, target) - } else if dk.HowlingBlast.CanCast(sim) { - casted = dk.HowlingBlast.Cast(sim, target) - } else if dk.HornOfWinter.CanCast(sim) { - casted = dk.HornOfWinter.Cast(sim, target) - } - } - - return casted + return sim.CurrentTime } From 14d0720442bc3878a3840477ffa330834c38c129 Mon Sep 17 00:00:00 2001 From: Josh DM Date: Thu, 8 Dec 2022 08:16:22 -0500 Subject: [PATCH 4/5] fix filler --- .../dps/rotation_frost_sub_blood_desync.go | 70 +++++++------------ 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go index 13131226c2..6925c06a8e 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood_desync.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood_desync.go @@ -24,34 +24,12 @@ func (dk *DpsDeathknight) setupFrostSubBloodDesyncERWOpener() { NewAction(dk.RotationActionCallback_FrostSubBlood_Desync_Sequence1) } -func (dk *DpsDeathknight) oblitRunesAt(sim *core.Simulation) time.Duration { - _, f, u := dk.NormalCurrentRunes() - d := dk.CurrentDeathRunes() - - if f == 0 && u == 0 && d == 0 { - timings := [3]time.Duration{dk.NormalSpentFrostRuneReadyAt(sim), dk.NormalSpentUnholyRuneReadyAt(sim), dk.SpentDeathRuneReadyAt()} - if timings[0] > timings[2] { - timings[0], timings[2] = timings[2], timings[0] - } - if timings[0] > timings[1] { - timings[0], timings[1] = timings[1], timings[0] - } - if timings[1] > timings[2] { - timings[1], timings[2] = timings[2], timings[1] - } - return timings[1] - } else if f == 0 && u == 0 && d > 0 { - // Next Frost/Unholy - return core.MinDuration(dk.NormalSpentFrostRuneReadyAt(sim), dk.NormalSpentUnholyRuneReadyAt(sim)) - } else if f == 0 && u > 0 && d == 0 { - // Next death rune or next f rune - return core.MinDuration(dk.NormalSpentFrostRuneReadyAt(sim), dk.SpentDeathRuneReadyAt()) - } else if f > 0 && u == 0 && d == 0 { - // Next death rune or next f rune - return core.MinDuration(dk.NormalSpentUnholyRuneReadyAt(sim), dk.SpentDeathRuneReadyAt()) - } - - return sim.CurrentTime +// We need to keep the B2 and F1 runes in sync and immediately use them for obliterate +// otherwise if an unholy rune comes up then we can't continue the Desync rotation without +// re-casting IT + PS +func (dk *DpsDeathknight) canFitBeforeFirstOblit(sim *core.Simulation, gcd time.Duration) bool { + ob := core.MaxDuration(dk.RuneReadyAt(sim, 1), dk.RuneReadyAt(sim, 2)) + return sim.CurrentTime+gcd < ob } func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Obli(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { @@ -68,15 +46,10 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Obli(sim * } casted = dk.Obliterate.Cast(sim, target) advance = dk.LastOutcome.Matches(core.OutcomeLanded) - } else if dk.KM() && dk.FrostStrike.CanCast(sim) { - dk.FrostStrike.Cast(sim, target) - } else if dk.Rime() { - dk.HowlingBlast.Cast(sim, target) - } else if dk.FrostStrike.CanCast(sim) { - dk.FrostStrike.Cast(sim, target) + s.ConditionalAdvance(casted && advance) + } else { + dk.desync_Filler(sim, target) } - - s.ConditionalAdvance(casted && advance) } else if !ff { casted = dk.IcyTouch.Cast(sim, target) advance = dk.LastOutcome.Matches(core.OutcomeLanded) @@ -92,7 +65,7 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Obli(sim * func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_UA(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { runeGrace := dk.RuneGraceAt(0, sim.CurrentTime) - waitFor := 100 * time.Millisecond + waitFor := 5 * time.Millisecond if dk.UnbreakableArmor.IsReady(sim) && dk.BloodTap.IsReady(sim) { dk.BloodTap.Cast(sim, target) @@ -134,19 +107,28 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_Sequence2( return sim.CurrentTime } +func (dk *DpsDeathknight) desync_Filler(sim *core.Simulation, target *core.Unit) { + canFitAb := dk.canFitBeforeFirstOblit(sim, dk.GetModifiedGCD()) + canFitSpell := dk.canFitBeforeFirstOblit(sim, dk.SpellGCD()) + + if canFitAb && dk.KM() && dk.FrostStrike.CanCast(sim) { + dk.FrostStrike.Cast(sim, target) + } else if canFitSpell && dk.Rime() { + dk.HowlingBlast.Cast(sim, target) + } else if canFitAb && dk.FrostStrike.CanCast(sim) { + dk.FrostStrike.Cast(sim, target) + } else if canFitSpell { + dk.HornOfWinter.Cast(sim, target) + } +} + func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_Desync_FS_Dump(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration { if !dk.AllRunesSpent() { s.Advance() return sim.CurrentTime } - if dk.KM() && dk.FrostStrike.CanCast(sim) { - dk.FrostStrike.Cast(sim, target) - } else if dk.Rime() { - dk.HowlingBlast.Cast(sim, target) - } else if dk.FrostStrike.CanCast(sim) { - dk.FrostStrike.Cast(sim, target) - } + dk.desync_Filler(sim, target) return -1 } From c14ef59fe10b71e42a8f91c8998151fc21cf214b Mon Sep 17 00:00:00 2001 From: Josh DM Date: Thu, 8 Dec 2022 08:45:15 -0500 Subject: [PATCH 5/5] fix tests --- sim/deathknight/dps/TestFrost.results | 324 +++++++++--------- .../dps/rotation_frost_sub_blood.go | 4 +- sim/deathknight/dps/rotation_shared_helper.go | 10 +- 3 files changed, 165 insertions(+), 173 deletions(-) diff --git a/sim/deathknight/dps/TestFrost.results b/sim/deathknight/dps/TestFrost.results index c7ac2bc56f..f5f0847b16 100644 --- a/sim/deathknight/dps/TestFrost.results +++ b/sim/deathknight/dps/TestFrost.results @@ -45,22 +45,22 @@ character_stats_results: { dps_results: { key: "TestFrost-AllItems-AustereEarthsiegeDiamond" value: { - dps: 7744.84821 - tps: 4576.45716 + dps: 7746.7864 + tps: 4577.62007 } } dps_results: { key: "TestFrost-AllItems-Bandit'sInsignia-40371" value: { - dps: 7699.43034 - tps: 4556.96705 + dps: 7700.19415 + tps: 4557.42534 } } dps_results: { key: "TestFrost-AllItems-BeamingEarthsiegeDiamond" value: { - dps: 7761.44216 - tps: 4586.41353 + dps: 7762.49198 + tps: 4587.04342 } } dps_results: { @@ -80,57 +80,57 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-BlessedGarboftheUndeadSlayer" value: { - dps: 6359.43697 - tps: 3759.37507 + dps: 6359.25896 + tps: 3759.26826 } } dps_results: { key: "TestFrost-AllItems-BlessedRegaliaofUndeadCleansing" value: { - dps: 6119.972 - tps: 3615.92815 + dps: 6081.22389 + tps: 3592.64929 } } dps_results: { key: "TestFrost-AllItems-BracingEarthsiegeDiamond" value: { - dps: 7738.8865 - tps: 4481.42253 + dps: 7740.82356 + tps: 4482.56152 } } dps_results: { key: "TestFrost-AllItems-ChaoticSkyflareDiamond" value: { - dps: 7942.87857 - tps: 4695.27538 + dps: 7943.98319 + tps: 4695.93815 } } dps_results: { key: "TestFrost-AllItems-DarkmoonCard:Berserker!-42989" value: { - dps: 7632.21331 - tps: 4516.67541 + dps: 7633.27757 + tps: 4517.31397 } } dps_results: { key: "TestFrost-AllItems-DarkmoonCard:Death-42990" value: { - dps: 7621.78004 - tps: 4510.23504 + dps: 7622.53318 + tps: 4510.68692 } } dps_results: { key: "TestFrost-AllItems-DarkmoonCard:Greatness-44253" value: { - dps: 7827.37359 - tps: 4627.7722 + dps: 7828.45779 + tps: 4628.42272 } } dps_results: { key: "TestFrost-AllItems-DarkmoonCard:Greatness-44254" value: { - dps: 7748.67721 - tps: 4580.55438 + dps: 7749.7609 + tps: 4581.20459 } } dps_results: { @@ -143,191 +143,191 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-DarkrunedPlate" value: { - dps: 6514.98085 - tps: 3846.5629 + dps: 6514.166 + tps: 3846.07399 } } dps_results: { key: "TestFrost-AllItems-DeadlyGladiator'sSigilofStrife-42620" value: { - dps: 7418.91785 - tps: 4380.89894 + dps: 7419.89464 + tps: 4381.48502 } } dps_results: { key: "TestFrost-AllItems-DeathKnight'sAnguish-38212" value: { - dps: 7609.69925 - tps: 4503.16698 + dps: 7610.76351 + tps: 4503.80553 } } dps_results: { key: "TestFrost-AllItems-Defender'sCode-40257" value: { - dps: 7541.64549 - tps: 4462.33472 + dps: 7542.71193 + tps: 4462.97459 } } dps_results: { key: "TestFrost-AllItems-DestructiveSkyflareDiamond" value: { - dps: 7763.92519 - tps: 4587.90335 + dps: 7764.97501 + tps: 4588.53324 } } dps_results: { key: "TestFrost-AllItems-EffulgentSkyflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-EmberSkyflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-EnigmaticSkyflareDiamond" value: { - dps: 7761.44216 - tps: 4586.41353 + dps: 7762.49198 + tps: 4587.04342 } } dps_results: { key: "TestFrost-AllItems-EnigmaticStarflareDiamond" value: { - dps: 7756.24945 - tps: 4583.29791 + dps: 7757.29927 + tps: 4583.9278 } } dps_results: { key: "TestFrost-AllItems-EternalEarthsiegeDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-ExtractofNecromanticPower-40373" value: { - dps: 7634.74498 - tps: 4518.12895 + dps: 7636.16889 + tps: 4518.9833 } } dps_results: { key: "TestFrost-AllItems-EyeoftheBroodmother-45308" value: { - dps: 7614.8244 - tps: 4506.24206 + dps: 7615.88866 + tps: 4506.88062 } } dps_results: { key: "TestFrost-AllItems-ForgeEmber-37660" value: { - dps: 7600.45229 - tps: 4497.6188 + dps: 7601.51655 + tps: 4498.25736 } } dps_results: { key: "TestFrost-AllItems-ForlornSkyflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-ForlornStarflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-FuriousGladiator'sSigilofStrife-42621" value: { - dps: 7419.5934 - tps: 4381.30428 + dps: 7420.57019 + tps: 4381.89035 } } dps_results: { key: "TestFrost-AllItems-FuryoftheFiveFlights-40431" value: { - dps: 7759.62414 - tps: 4593.12191 + dps: 7760.71804 + tps: 4593.77825 } } dps_results: { key: "TestFrost-AllItems-FuturesightRune-38763" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-HatefulGladiator'sSigilofStrife-42619" value: { - dps: 7417.59604 - tps: 4380.10586 + dps: 7418.57283 + tps: 4380.69193 } } dps_results: { key: "TestFrost-AllItems-IllustrationoftheDragonSoul-40432" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-ImpassiveSkyflareDiamond" value: { - dps: 7761.44216 - tps: 4586.41353 + dps: 7762.49198 + tps: 4587.04342 } } dps_results: { key: "TestFrost-AllItems-ImpassiveStarflareDiamond" value: { - dps: 7756.24945 - tps: 4583.29791 + dps: 7757.29927 + tps: 4583.9278 } } dps_results: { key: "TestFrost-AllItems-IncisorFragment-37723" value: { - dps: 7714.98895 - tps: 4566.34079 + dps: 7716.06691 + tps: 4566.98757 } } dps_results: { key: "TestFrost-AllItems-InsightfulEarthsiegeDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-InvigoratingEarthsiegeDiamond" value: { - dps: 7769.71582 - tps: 4591.37773 + dps: 7771.65926 + tps: 4592.54379 hps: 12.97738 } } dps_results: { key: "TestFrost-AllItems-Lavanthor'sTalisman-37872" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-MajesticDragonFigurine-40430" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { @@ -340,106 +340,106 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-OfferingofSacrifice-37638" value: { - dps: 7534.83594 - tps: 4458.24899 + dps: 7535.90161 + tps: 4458.8884 } } dps_results: { key: "TestFrost-AllItems-PersistentEarthshatterDiamond" value: { - dps: 7763.84357 - tps: 4587.85438 + dps: 7765.78579 + tps: 4589.01971 } } dps_results: { key: "TestFrost-AllItems-PersistentEarthsiegeDiamond" value: { - dps: 7769.71582 - tps: 4591.37773 + dps: 7771.65926 + tps: 4592.54379 } } dps_results: { key: "TestFrost-AllItems-PowerfulEarthshatterDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-PowerfulEarthsiegeDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-PurifiedShardoftheGods" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-ReignoftheDead-47316" value: { - dps: 7530.47362 - tps: 4455.73132 + dps: 7531.54444 + tps: 4456.37381 } } dps_results: { key: "TestFrost-AllItems-ReignoftheDead-47477" value: { - dps: 7531.45096 - tps: 4456.31773 + dps: 7532.52177 + tps: 4456.96022 } } dps_results: { key: "TestFrost-AllItems-RelentlessEarthsiegeDiamond" value: { - dps: 7936.13343 - tps: 4691.22829 + dps: 7937.23817 + tps: 4691.89113 } } dps_results: { key: "TestFrost-AllItems-RelentlessGladiator'sSigilofStrife-42622" value: { - dps: 7420.38155 - tps: 4381.77717 + dps: 7421.35834 + tps: 4382.36324 } } dps_results: { key: "TestFrost-AllItems-RevitalizingSkyflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-RuneofRepulsion-40372" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-SavageGladiator'sSigilofStrife-42618" value: { - dps: 7417.36329 - tps: 4379.96621 + dps: 7418.34008 + tps: 4380.55228 } } dps_results: { key: "TestFrost-AllItems-ScourgeborneBattlegear" value: { - dps: 7140.59049 - tps: 4221.69408 + dps: 7134.10978 + tps: 4217.82404 } } dps_results: { key: "TestFrost-AllItems-ScourgebornePlate" value: { - dps: 6400.85634 - tps: 3778.84912 + dps: 6402.75247 + tps: 3779.9868 } } dps_results: { @@ -452,113 +452,113 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-Scourgelord'sPlate" value: { - dps: 6777.21996 - tps: 4000.56934 + dps: 6780.30201 + tps: 4002.41858 } } dps_results: { key: "TestFrost-AllItems-SealofthePantheon-36993" value: { - dps: 7541.1901 - tps: 4462.06149 + dps: 7542.26148 + tps: 4462.70432 } } dps_results: { key: "TestFrost-AllItems-ShinyShardoftheGods" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-SigilofHauntedDreams-40715" value: { - dps: 7428.7622 - tps: 4386.80555 + dps: 7429.73899 + tps: 4387.39163 } } dps_results: { key: "TestFrost-AllItems-SigilofVirulence-47673" value: { - dps: 7822.23444 - tps: 4619.63515 + dps: 7823.25801 + tps: 4620.2493 } } dps_results: { key: "TestFrost-AllItems-SigiloftheHangedMan-50459" value: { - dps: 7852.37952 - tps: 4639.5161 + dps: 7853.40755 + tps: 4640.13291 } } dps_results: { key: "TestFrost-AllItems-Sindragosa'sFlawlessFang-50361" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-SparkofLife-37657" value: { - dps: 7568.75013 - tps: 4477.21241 + dps: 7569.81038 + tps: 4477.84856 } } dps_results: { key: "TestFrost-AllItems-SphereofRedDragon'sBlood-37166" value: { - dps: 7655.19013 - tps: 4529.88741 + dps: 7665.26398 + tps: 4535.85661 } } dps_results: { key: "TestFrost-AllItems-StormshroudArmor" value: { - dps: 6100.47072 - tps: 3604.48198 + dps: 6099.20226 + tps: 3603.72091 } } dps_results: { key: "TestFrost-AllItems-SwiftSkyflareDiamond" value: { - dps: 7769.71582 - tps: 4591.37773 + dps: 7771.65926 + tps: 4592.54379 } } dps_results: { key: "TestFrost-AllItems-SwiftStarflareDiamond" value: { - dps: 7763.84357 - tps: 4587.85438 + dps: 7765.78579 + tps: 4589.01971 } } dps_results: { key: "TestFrost-AllItems-SwiftWindfireDiamond" value: { - dps: 7753.56713 - tps: 4581.68851 + dps: 7755.50723 + tps: 4582.85257 } } dps_results: { key: "TestFrost-AllItems-Thassarian'sBattlegear" value: { - dps: 7420.55769 - tps: 4385.91079 + dps: 7420.85251 + tps: 4386.08768 } } dps_results: { key: "TestFrost-AllItems-Thassarian'sPlate" value: { - dps: 6504.27467 - tps: 3840.1625 + dps: 6496.7747 + tps: 3835.80862 } } dps_results: { key: "TestFrost-AllItems-TheTwinBladesofAzzinoth" value: { - dps: 6946.97821 - tps: 4097.46605 + dps: 6946.00905 + tps: 4096.88456 } } dps_results: { @@ -585,29 +585,29 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-TirelessSkyflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-TirelessStarflareDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-TrenchantEarthshatterDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { key: "TestFrost-AllItems-TrenchantEarthsiegeDiamond" value: { - dps: 7738.8865 - tps: 4572.88014 + dps: 7740.82356 + tps: 4574.04237 } } dps_results: { @@ -620,29 +620,29 @@ dps_results: { dps_results: { key: "TestFrost-AllItems-WingedTalisman-37844" value: { - dps: 7522.35177 - tps: 4450.75849 + dps: 7523.41603 + tps: 4451.39704 } } dps_results: { key: "TestFrost-AllItems-WrathfulGladiator'sSigilofStrife-51417" value: { - dps: 7421.28229 - tps: 4382.31761 + dps: 7422.25909 + tps: 4382.90369 } } dps_results: { key: "TestFrost-Average-Default" value: { - dps: 7906.20403 - tps: 4673.55527 + dps: 7905.86808 + tps: 4673.35791 } } dps_results: { key: "TestFrost-Settings-Human-Frost P1-Basic-FullBuffs-LongMultiTarget" value: { - dps: 11291.03897 - tps: 6706.79088 + dps: 11291.02283 + tps: 6706.7812 } } dps_results: { @@ -669,8 +669,8 @@ dps_results: { dps_results: { key: "TestFrost-Settings-Human-Frost P1-Basic-NoBuffs-LongSingleTarget" value: { - dps: 3462.84316 - tps: 2039.18201 + dps: 3461.99416 + tps: 2038.67262 } } dps_results: { @@ -690,8 +690,8 @@ dps_results: { dps_results: { key: "TestFrost-Settings-Orc-Frost P1-Basic-FullBuffs-LongSingleTarget" value: { - dps: 5877.80445 - tps: 3455.64769 + dps: 5877.1485 + tps: 3455.25412 } } dps_results: { @@ -711,8 +711,8 @@ dps_results: { dps_results: { key: "TestFrost-Settings-Orc-Frost P1-Basic-NoBuffs-LongSingleTarget" value: { - dps: 3488.6317 - tps: 2052.89069 + dps: 3486.76405 + tps: 2051.62909 } } dps_results: { @@ -725,7 +725,7 @@ dps_results: { dps_results: { key: "TestFrost-SwitchInFrontOfTarget-Default" value: { - dps: 7528.10396 - tps: 4451.18392 + dps: 7542.2803 + tps: 4459.54959 } } diff --git a/sim/deathknight/dps/rotation_frost_sub_blood.go b/sim/deathknight/dps/rotation_frost_sub_blood.go index 87095e5417..4b85a84d81 100644 --- a/sim/deathknight/dps/rotation_frost_sub_blood.go +++ b/sim/deathknight/dps/rotation_frost_sub_blood.go @@ -180,8 +180,8 @@ func (dk *DpsDeathknight) RotationActionCallback_FrostSubBlood_FS_Dump_UntilUA(s func (dk *DpsDeathknight) getOblitDrift(sim *core.Simulation, castIn time.Duration) time.Duration { spendAt := sim.CurrentTime + castIn - oblit1 := core.MinDuration(dk.RuneReadyAt(sim, 2), dk.RuneReadyAt(sim, 3)) - oblit2 := core.MinDuration(dk.SpendRuneReadyAt(4, spendAt), dk.SpendRuneReadyAt(5, spendAt)) + oblit1 := core.MaxDuration(dk.RuneReadyAt(sim, 2), dk.RuneReadyAt(sim, 3)) + oblit2 := core.MaxDuration(dk.SpendRuneReadyAt(4, spendAt), dk.SpendRuneReadyAt(5, spendAt)) return oblit2 - oblit1 } diff --git a/sim/deathknight/dps/rotation_shared_helper.go b/sim/deathknight/dps/rotation_shared_helper.go index 044adcc1f5..19db106a19 100644 --- a/sim/deathknight/dps/rotation_shared_helper.go +++ b/sim/deathknight/dps/rotation_shared_helper.go @@ -18,18 +18,10 @@ func (sr *SharedRotation) Reset(sim *core.Simulation) { sr.recastedBP = false } -func (dk *DpsDeathknight) GetGcdDuration(spell *deathknight.RuneSpell) time.Duration { - gcd := dk.SpellGCD() - if spell.IsMelee() { - gcd = dk.GetModifiedGCD() - } - return gcd -} - func (dk *DpsDeathknight) shDiseaseCheck(sim *core.Simulation, target *core.Unit, spell *deathknight.RuneSpell, costRunes bool, casts int, ffSyncTime time.Duration) bool { ffRemaining := dk.FrostFeverDisease[target.Index].RemainingDuration(sim) bpRemaining := dk.BloodPlagueDisease[target.Index].RemainingDuration(sim) - castGcd := dk.GetGcdDuration(spell) * time.Duration(casts) + castGcd := dk.SpellGCD() * time.Duration(casts) // FF is not active or will drop before Gcd is ready after this cast if !dk.FrostFeverDisease[target.Index].IsActive() || ffRemaining < castGcd {