Skip to content

Commit

Permalink
Merge pull request #3110 from wowsims/dk_updates
Browse files Browse the repository at this point in the history
Dk updates
  • Loading branch information
rosenrusinov authored May 22, 2023
2 parents 510537f + 879e058 commit c26568c
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 99 deletions.
14 changes: 8 additions & 6 deletions sim/core/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent) {
//reset current mana after applying stats
pet.manaBar.reset()

// Call onEnable callbacks before enabling auto swing
// to not have to reorder PAs multiple times
pet.enabled = true

if pet.OnPetEnable != nil {
pet.OnPetEnable(sim)
}

pet.SetGCDTimer(sim, MaxDuration(0, sim.CurrentTime))
if sim.CurrentTime >= 0 {
pet.AutoAttacks.EnableAutoSwing(sim)
Expand All @@ -172,12 +180,6 @@ func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent) {
})
}

pet.enabled = true

if pet.OnPetEnable != nil {
pet.OnPetEnable(sim)
}

if sim.Log != nil {
pet.Log(sim, "Pet stats: %s", pet.GetStats())
pet.Log(sim, "Pet inherited stats: %s", pet.ApplyStatDependencies(pet.inheritedStats))
Expand Down
6 changes: 3 additions & 3 deletions sim/deathknight/dps/TestUnholy.results
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ dps_results: {
dps_results: {
key: "TestUnholy-AllItems-SigilofVirulence-47673"
value: {
dps: 8046.96581
tps: 5128.16517
hps: 266.55313
dps: 8245.23172
tps: 5205.95757
hps: 238.66172
}
}
dps_results: {
Expand Down
93 changes: 50 additions & 43 deletions sim/deathknight/dps/rotation_unholy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,29 @@ func (dk *DpsDeathknight) setupUnholyRotations() {
NewAction(dk.getSecondDiseaseAction()).
NewAction(dk.uhBloodRuneAction(true))

fuStrikeAction := dk.RotationActionCallback_DS
if dk.Talents.ScourgeStrike {
if dk.ur.sigil == Sigil_Virulence {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_SS).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionUH_SS_Sigil).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionUH_SS_Sigil).
NewAction(dk.RotationActionUH_BS)
} else if dk.ur.sigil == Sigil_HangedMan {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_SS).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_DC).
NewAction(dk.RotationActionCallback_ERW).
NewAction(dk.RotationActionCallback_SS).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_SS).
NewAction(dk.RotationActionUH_BS)
}
fuStrikeAction = dk.RotationActionCallback_SS
}

if dk.ur.sigil == Sigil_Virulence {
dk.RotationSequence.
NewAction(fuStrikeAction).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionUH_SS_Sigil).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionUH_SS_Sigil).
NewAction(dk.RotationActionUH_BS)
} else if dk.ur.sigil == Sigil_HangedMan {
dk.RotationSequence.
NewAction(fuStrikeAction).
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_DC).
NewAction(dk.RotationActionCallback_ERW).
NewAction(fuStrikeAction).
NewAction(dk.RotationActionUH_BS).
NewAction(fuStrikeAction).
NewAction(dk.RotationActionUH_BS)
}

if dk.Rotation.UseDeathAndDecay || (!dk.Talents.ScourgeStrike && dk.Talents.Annihilation == 0) {
Expand Down Expand Up @@ -131,19 +134,19 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholyDndRotation(sim *core.Sim
}

cast := false
prioSs, _ := dk.bonusProcRotationChecks(sim)

if dk.uhDiseaseCheck(sim, target, dk.DeathAndDecay, true, 1) {
if prioSs {
if dk.uhVirulenceRotationCheck(sim, true) {
if dk.uhGargoyleCheck(sim, target, core.GCDDefault*2+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
cast = dk.ScourgeStrike.Cast(sim, target)
cast = dk.uhCastVirulenceStrike(sim, target)
if cast {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_UnholyDndRotation)
if dk.LastOutcome.Matches(core.OutcomeLanded) {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_UnholyDndRotation)
}
}
} else {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
Expand All @@ -164,16 +167,18 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholyDndRotation(sim *core.Sim
if !cast {
if dk.uhDiseaseCheck(sim, target, dk.ScourgeStrike, true, 1) {
if !dk.uhShouldWaitForDnD(sim, true, true, true) {
if dk.Talents.ScourgeStrike && dk.ScourgeStrike.IsReady(sim) {
if dk.uhVirulenceRotationCheck(sim, false) && dk.DeathStrike.IsReady(sim) {
if dk.uhGargoyleCheck(sim, target, core.GCDDefault*2+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
cast = dk.ScourgeStrike.Cast(sim, target)
cast = dk.uhCastVirulenceStrike(sim, target)
if cast {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_UnholyDndRotation)
if dk.LastOutcome.Matches(core.OutcomeLanded) {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionUH_BS).
NewAction(dk.RotationActionCallback_UnholyDndRotation)
}
}
} else if dk.IcyTouch.CanCast(sim, nil) && dk.PlagueStrike.CanCast(sim, nil) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+core.GCDDefault*2+50*time.Millisecond) {
Expand All @@ -189,9 +194,10 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholyDndRotation(sim *core.Sim
return sim.CurrentTime
}
if !cast {
gargCheck := dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond)
if dk.shShouldSpreadDisease(sim) {
if !dk.uhShouldWaitForDnD(sim, true, false, false) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
Expand All @@ -200,14 +206,14 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholyDndRotation(sim *core.Sim
}
if !cast {
if dk.uhDeathCoilCheck(sim) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
cast = dk.DeathCoil.Cast(sim, target)
}
if !cast {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
Expand Down Expand Up @@ -258,29 +264,30 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholySsRotation(sim *core.Simu
fuStrike = dk.Obliterate
}
if dk.uhDiseaseCheck(sim, target, fuStrike, true, 1) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if dk.uhGargoyleCheck(sim, target, core.GCDDefault+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
casted = fuStrike.Cast(sim, target)
} else {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()*2+50*time.Millisecond) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+core.GCDDefault*2+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
dk.uhRecastDiseasesSequence(sim)
return sim.CurrentTime
}
if !casted {
gargCheck := dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond)
if dk.shShouldSpreadDisease(sim) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
casted = dk.uhSpreadDiseases(sim, target, s)
} else {
if dk.uhDiseaseCheck(sim, target, dk.BloodStrike, true, 1) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if dk.uhGargoyleCheck(sim, target, core.GCDDefault+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
Expand All @@ -290,7 +297,7 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholySsRotation(sim *core.Simu
casted = dk.BloodBoil.Cast(sim, target)
}
} else {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()*2+50*time.Millisecond) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+core.GCDDefault*2+50*time.Millisecond) {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
Expand All @@ -300,14 +307,14 @@ func (dk *DpsDeathknight) RotationActionCallback_UnholySsRotation(sim *core.Simu
}
if !casted {
if dk.uhDeathCoilCheck(sim) {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
casted = dk.DeathCoil.Cast(sim, target)
}
if !casted {
if dk.uhGargoyleCheck(sim, target, dk.SpellGCD()+50*time.Millisecond) {
if gargCheck {
dk.uhAfterGargoyleSequence(sim)
return sim.CurrentTime
}
Expand Down Expand Up @@ -500,7 +507,7 @@ func (dk *DpsDeathknight) RotationActionUH_BS(sim *core.Simulation, target *core
s.ConditionalAdvance(casted && advance)
} else {
bloodSpell := dk.BloodBoil
_, prioBs := dk.bonusProcRotationChecks(sim)
prioBs := dk.unholyMightRotationChecks(sim)
if dk.desolationAuraCheck(sim) || prioBs {
bloodSpell = dk.BloodStrike
}
Expand Down Expand Up @@ -528,7 +535,7 @@ func (dk *DpsDeathknight) RotationActionUH_SS_Sigil(sim *core.Simulation, target
dk.EmpowerRuneWeapon.Cast(sim, target)
}

casted := dk.ScourgeStrike.Cast(sim, target)
casted := dk.uhCastVirulenceStrike(sim, target)
advance := dk.LastOutcome.Matches(core.OutcomeLanded)

s.ConditionalAdvance(casted && advance)
Expand Down
Loading

0 comments on commit c26568c

Please sign in to comment.