From cb0b3016067b68fc2f9ba9dde22f2a5be62ac4dd Mon Sep 17 00:00:00 2001 From: Josh DM Date: Mon, 2 Oct 2023 12:55:44 -0400 Subject: [PATCH] fix lock item CD logic --- sim/warlock/TestAffliction.results | 8 +++--- sim/warlock/TestDemonology.results | 2 +- sim/warlock/rotation.go | 40 +++++++++++++++--------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sim/warlock/TestAffliction.results b/sim/warlock/TestAffliction.results index b9a6518d43..d2c09216e9 100644 --- a/sim/warlock/TestAffliction.results +++ b/sim/warlock/TestAffliction.results @@ -756,8 +756,8 @@ dps_results: { dps_results: { key: "TestAffliction-Settings-Orc-P3-AffItemSwap--FullBuffs-ShortSingleTarget" value: { - dps: 12745.64043 - tps: 11577.89304 + dps: 12744.95769 + tps: 11577.47449 } } dps_results: { @@ -798,8 +798,8 @@ dps_results: { dps_results: { key: "TestAffliction-Settings-Orc-P3-Affliction Warlock--FullBuffs-ShortSingleTarget" value: { - dps: 12850.02367 - tps: 11691.84173 + dps: 12848.8498 + tps: 11691.14478 } } dps_results: { diff --git a/sim/warlock/TestDemonology.results b/sim/warlock/TestDemonology.results index 888f8bda06..2eb46d83d5 100644 --- a/sim/warlock/TestDemonology.results +++ b/sim/warlock/TestDemonology.results @@ -756,7 +756,7 @@ dps_results: { dps_results: { key: "TestDemonology-Settings-Orc-P2-Demonology Warlock--FullBuffs-ShortSingleTarget" value: { - dps: 12437.18825 + dps: 12436.88976 tps: 10461.28742 } } diff --git a/sim/warlock/rotation.go b/sim/warlock/rotation.go index b446ea0d46..6c50215935 100644 --- a/sim/warlock/rotation.go +++ b/sim/warlock/rotation.go @@ -22,26 +22,26 @@ func (warlock *Warlock) setupCooldowns(sim *core.Simulation) { } // TODO: find a way of getting the duration directly from the spell instead - durMap := make(map[int32]time.Duration) + durMap := make(map[core.ActionID]time.Duration) if warlock.MetamorphosisAura != nil { - durMap[47241] = warlock.MetamorphosisAura.Duration - } - durMap[33697] = 15 * time.Second - durMap[54758] = 12 * time.Second - durMap[10060] = 15 * time.Second - durMap[40211] = 15 * time.Second - durMap[40212] = 15 * time.Second - durMap[45466] = 20 * time.Second - durMap[45148] = 20 * time.Second - durMap[37873] = 20 * time.Second - - ignoredCDs := make(map[int32]struct{}) - ignoredCDs[42641] = struct{}{} // sapper - ignoredCDs[41119] = struct{}{} // saronite bomb - ignoredCDs[40536] = struct{}{} // explosive decoy - ignoredCDs[core.BloodlustActionID.SpellID] = struct{}{} // don't mess with BL + durMap[core.ActionID{SpellID: 47241}] = warlock.MetamorphosisAura.Duration + } + durMap[core.ActionID{SpellID: 33697}] = 15 * time.Second + durMap[core.ActionID{SpellID: 54758}] = 12 * time.Second + durMap[core.ActionID{SpellID: 10060}.WithTag(-1)] = 15 * time.Second + durMap[core.ActionID{ItemID: 40211}] = 15 * time.Second + durMap[core.ActionID{ItemID: 40212}] = 15 * time.Second + durMap[core.ActionID{ItemID: 45466}] = 20 * time.Second + durMap[core.ActionID{ItemID: 45148}] = 20 * time.Second + durMap[core.ActionID{ItemID: 37873}] = 20 * time.Second + + ignoredCDs := make(map[core.ActionID]struct{}) + ignoredCDs[core.ActionID{ItemID: 42641}] = struct{}{} // sapper + ignoredCDs[core.ActionID{ItemID: 41119}] = struct{}{} // saronite bomb + ignoredCDs[core.ActionID{ItemID: 40536}] = struct{}{} // explosive decoy + ignoredCDs[core.BloodlustActionID.WithTag(-1)] = struct{}{} // don't mess with BL if warlock.Inferno != nil { - ignoredCDs[warlock.Inferno.ActionID.SpellID] = struct{}{} + ignoredCDs[warlock.Inferno.ActionID] = struct{}{} } var executeActive func() bool @@ -61,12 +61,12 @@ func (warlock *Warlock) setupCooldowns(sim *core.Simulation) { lustCD := warlock.GetMajorCooldownIgnoreTag(core.BloodlustActionID) for _, cd := range warlock.GetMajorCooldowns() { - if _, ignored := ignoredCDs[cd.Spell.ActionID.SpellID]; ignored { + if _, ignored := ignoredCDs[cd.Spell.ActionID]; ignored { continue } spellCD := core.MaxDuration(cd.Spell.CD.Duration, cd.Spell.SharedCD.Duration) - runTime := time.Duration(float64(durMap[cd.Spell.ActionID.SpellID]) * 0.75) + runTime := time.Duration(float64(durMap[cd.Spell.ActionID]) * 0.75) spell := cd.Spell cd.ShouldActivate = func(sim *core.Simulation, character *core.Character) bool {