Skip to content

Commit

Permalink
Merge pull request #2772 from wowsims/tank_fixes
Browse files Browse the repository at this point in the history
Dk Tank crash fixes
  • Loading branch information
rosenrusinov authored Mar 13, 2023
2 parents 7e5b893 + 87986d7 commit 15ee145
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
6 changes: 5 additions & 1 deletion sim/deathknight/deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (dk *Deathknight) HasMinorGlyph(glyph proto.DeathknightMinorGlyph) bool {
return dk.HasGlyph(int32(glyph))
}

func NewDeathknight(character core.Character, inputs DeathknightInputs, talents string) *Deathknight {
func NewDeathknight(character core.Character, inputs DeathknightInputs, talents string, preNerfedGargoyle bool) *Deathknight {
dk := &Deathknight{
Character: character,
Talents: &proto.DeathknightTalents{},
Expand Down Expand Up @@ -438,6 +438,10 @@ func NewDeathknight(character core.Character, inputs DeathknightInputs, talents

dk.PseudoStats.MeleeHasteRatingPerHastePercent /= 1.3

if dk.Talents.SummonGargoyle {
dk.Gargoyle = dk.NewGargoyle(!preNerfedGargoyle)
}

dk.Ghoul = dk.NewGhoulPet(dk.Talents.MasterOfGhouls)
dk.OnGargoyleStartFirstCast = func() {}
dk.GargoyleSummonDelay = time.Millisecond * 2500
Expand Down
5 changes: 1 addition & 4 deletions sim/deathknight/dps/dps_deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ func NewDpsDeathknight(character core.Character, player *proto.Player) *DpsDeath
UseAMS: dk.Rotation.UseAms,
AvgAMSSuccessRate: dk.Rotation.AvgAmsSuccessRate,
AvgAMSHit: dk.Rotation.AvgAmsHit,
}, player.TalentsString),
}, player.TalentsString, dk.Rotation.PreNerfedGargoyle),
Rotation: dk.Rotation,
}
if dpsDk.Talents.SummonGargoyle {
dpsDk.Gargoyle = dpsDk.NewGargoyle(!dk.Rotation.PreNerfedGargoyle)
}

dpsDk.Inputs.UnholyFrenzyTarget = dk.Options.UnholyFrenzyTarget

Expand Down
10 changes: 6 additions & 4 deletions sim/deathknight/summon_gargoyle.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ func (dk *Deathknight) registerSummonGargoyleCD() {
},
})

// We use this for defining the min cast time of gargoyle
// but we dont cast it with the MCD system
dk.AddMajorCooldown(core.MajorCooldown{
Spell: dk.SummonGargoyle,
Type: core.CooldownTypeUnknown,
Type: core.CooldownTypeDPS,
})
dk.GetMajorCooldown(dk.SummonGargoyle.ActionID).Disable()
if dk.Inputs.IsDps {
// We use this for defining the min cast time of gargoyle
// but we dont cast it with the MCD system in the dps sim
dk.GetMajorCooldown(dk.SummonGargoyle.ActionID).Disable()
}
}

type GargoylePet struct {
Expand Down
5 changes: 2 additions & 3 deletions sim/deathknight/talents_blood.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,8 @@ func (dk *Deathknight) applyBloodGorged() {
return
}

bonusDamage := 1.1

armorPenRating := 10.0 * core.ArmorPenPerPercentArmor
bonusDamage := 1.0 + 0.02*float64(dk.Talents.BloodGorged)
armorPenRating := float64(dk.Talents.BloodGorged) * 2.0 * core.ArmorPenPerPercentArmor
dk.AddStat(stats.ArmorPenetration, armorPenRating)

procAura := core.MakePermanent(dk.RegisterAura(core.Aura{
Expand Down
34 changes: 23 additions & 11 deletions sim/deathknight/tank/openers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,45 @@ func (dk *TankDeathknight) TankRA_FuSpell(sim *core.Simulation, target *core.Uni
return -1
}

func (dk *TankDeathknight) TankRA_IT(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
casted := dk.IcyTouch.Cast(sim, target)
if !casted && dk.Talents.UnbreakableArmor && !dk.UnbreakableArmor.IsReady(sim) {
s.Advance()
return -1
}
advance := dk.LastOutcome.Matches(core.OutcomeLanded)

s.ConditionalAdvance(casted && advance)
return -1
}

func (dk *TankDeathknight) setupTankRegularERWOpener() {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.RotationActionCallback_PS).
NewAction(dk.TankRA_FuSpell).
NewAction(dk.RotationActionCallback_BT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_BloodSpell).
NewAction(dk.RotationActionCallback_ERW).
NewAction(dk.RotationActionCallback_Pesti).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.RotationActionCallback_RD).
NewAction(dk.TankRA_FuSpell)
}

func (dk *TankDeathknight) setupTankThreatERWOpener() {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.RotationActionCallback_BT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.RotationActionCallback_ERW).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.TankRA_IT).
NewAction(dk.RotationActionCallback_PS).
NewAction(dk.TankRA_BloodSpell)
}
2 changes: 1 addition & 1 deletion sim/deathknight/tank/tank_deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewTankDeathknight(character core.Character, options *proto.Player) *TankDe
Deathknight: deathknight.NewDeathknight(character, deathknight.DeathknightInputs{
IsDps: false,
StartingRunicPower: dkOptions.Options.StartingRunicPower,
}, options.TalentsString),
}, options.TalentsString, false),
Rotation: dkOptions.Rotation,
}

Expand Down

0 comments on commit 15ee145

Please sign in to comment.