Skip to content

Commit

Permalink
fix lock item CD logic (#3798)
Browse files Browse the repository at this point in the history
  • Loading branch information
lime-green authored Oct 2, 2023
1 parent f25a2fa commit 4919fd2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions sim/warlock/TestAffliction.results
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion sim/warlock/TestDemonology.results
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
40 changes: 20 additions & 20 deletions sim/warlock/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 4919fd2

Please sign in to comment.