Skip to content

Commit

Permalink
Clean up hunter pet rotation code
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jan 2, 2024
1 parent 3e9c7a7 commit c7a8aef
Showing 1 changed file with 13 additions and 31 deletions.
44 changes: 13 additions & 31 deletions sim/hunter/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,42 +106,24 @@ func (hp *HunterPet) ExecuteCustomRotation(sim *core.Simulation) {
}

target := hp.CurrentTarget
if hp.config.RandomSelection {
if sim.RandomFloat("Hunter Pet Ability") < 0.5 {
if !hp.specialAbility.CanCast(sim, target) || !hp.specialAbility.Cast(sim, target) {
if !hp.focusDump.Cast(sim, target) {
// Do nothing
}
}
} else {
if !hp.focusDump.Cast(sim, target) {
if !hp.specialAbility.CanCast(sim, target) || !hp.specialAbility.Cast(sim, target) {
// Do nothing
}
}
}

if hp.focusDump == nil {
hp.specialAbility.Cast(sim, target)
return
}
if hp.specialAbility == nil {
hp.focusDump.Cast(sim, target)
return
}

if !hp.specialAbility.CanCast(sim, target) || hp.specialAbility.Cast(sim, target) {
// For abilities that don't use the GCD.
if hp.GCD.IsReady(sim) {
if hp.focusDump != nil {
if !hp.focusDump.Cast(sim, target) {
// Do nothing
}
} else {
// Do nothing
}
}
} else {
if hp.focusDump != nil {
if !hp.focusDump.Cast(sim, target) {
// Do nothing
}
if hp.config.RandomSelection {
if sim.RandomFloat("Hunter Pet Ability") < 0.5 {
_ = hp.specialAbility.Cast(sim, target) || hp.focusDump.Cast(sim, target)
} else {
// Do nothing
_ = hp.focusDump.Cast(sim, target) || hp.specialAbility.Cast(sim, target)
}
} else {
_ = hp.specialAbility.Cast(sim, target) || hp.focusDump.Cast(sim, target)
}
}

Expand Down

0 comments on commit c7a8aef

Please sign in to comment.