Skip to content

Commit

Permalink
Merge pull request #2721 from wowsims/blood_bb
Browse files Browse the repository at this point in the history
Blood Dps updates
  • Loading branch information
rosenrusinov authored Feb 26, 2023
2 parents 6d49876 + 2b64b67 commit f3aa380
Show file tree
Hide file tree
Showing 13 changed files with 175 additions and 46 deletions.
10 changes: 10 additions & 0 deletions proto/deathknight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ message Deathknight {
Experimental_1 = 1;
Experimental_2 = 2;
}

enum BloodSpell {
HS = 0;
BB = 1;
BS = 2;
}

enum CustomSpellOption {
CustomNoSpell = 0;
Expand Down Expand Up @@ -259,6 +265,10 @@ message Deathknight {

bool enable_weapon_swap = 28;
ItemSwap weapon_swap = 29;

bool use_dancing_rune_weapon = 30;

BloodSpell blood_spender = 31;
}
Rotation rotation = 1;

Expand Down
24 changes: 24 additions & 0 deletions sim/deathknight/blood_boil.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,27 @@ func (dk *Deathknight) registerBloodBoilSpell() {
},
})
}

func (dk *Deathknight) registerDrwBloodBoilSpell() {
dk.RuneWeapon.BloodBoil = dk.RuneWeapon.RegisterSpell(core.SpellConfig{
ActionID: BloodBoilActionID,
SpellSchool: core.SpellSchoolShadow,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagIgnoreAttackerModifiers,

DamageMultiplier: 0.5 * dk.bloodyStrikesBonus(dk.BloodBoil),
CritMultiplier: dk.bonusCritMultiplier(dk.Talents.MightOfMograine),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
for _, aoeTarget := range sim.Encounter.Targets {
aoeUnit := &aoeTarget.Unit

baseDamage := (sim.Roll(180, 220) + 0.06*dk.RuneWeapon.getImpurityBonus(spell)) * core.TernaryFloat64(dk.DrwDiseasesAreActive(aoeUnit), 1.5, 1.0)
baseDamage *= sim.Encounter.AOECapMultiplier()

spell.CalcAndDealDamage(sim, aoeUnit, baseDamage, spell.OutcomeMagicHitAndCrit)
}
},
})
}
32 changes: 32 additions & 0 deletions sim/deathknight/blood_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,35 @@ func (dk *Deathknight) registerBloodStrikeSpell() {
dk.BloodStrikeOhHit = dk.newBloodStrikeSpell(false)
dk.BloodStrike = dk.BloodStrikeMhHit
}

func (dk *Deathknight) registerDrwBloodStrikeSpell() {
bonusBaseDamage := dk.sigilOfTheDarkRiderBonus()
diseaseMulti := dk.dkDiseaseMultiplier(0.125)

dk.RuneWeapon.BloodStrike = dk.RuneWeapon.RegisterSpell(core.SpellConfig{
ActionID: BloodStrikeActionID.WithTag(1),
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagIgnoreAttackerModifiers,

BonusCritRating: (dk.subversionCritBonus() + dk.annihilationCritBonus()) * core.CritRatingPerCritChance,
DamageMultiplier: .5 * 0.4 *
dk.bloodOfTheNorthCoeff() *
dk.thassariansPlateDamageBonus() *
dk.bloodyStrikesBonus(dk.BloodStrike),
CritMultiplier: dk.bonusCritMultiplier(dk.Talents.MightOfMograine + dk.Talents.GuileOfGorefiend),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := 764 +
bonusBaseDamage +
spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) +
spell.BonusWeaponDamage()

baseDamage *= dk.RoRTSBonus(target) *
(1.0 + dk.drwCountActiveDiseases(target)*diseaseMulti)

spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeWeaponSpecialHitAndCrit)
},
})
}
8 changes: 8 additions & 0 deletions sim/deathknight/dancing_rune_weapon.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ func (dk *Deathknight) registerDancingRuneWeaponCD() {
dk.RuneWeapon.PlagueStrike.Cast(sim, spell.Unit.CurrentTarget)
case dk.DeathStrike:
dk.RuneWeapon.DeathStrike.Cast(sim, spell.Unit.CurrentTarget)
case dk.BloodStrike:
dk.RuneWeapon.BloodStrike.Cast(sim, spell.Unit.CurrentTarget)
case dk.HeartStrike:
dk.RuneWeapon.HeartStrike.Cast(sim, spell.Unit.CurrentTarget)
case dk.DeathCoil:
dk.RuneWeapon.DeathCoil.Cast(sim, spell.Unit.CurrentTarget)
case dk.Pestilence:
dk.RuneWeapon.Pestilence.Cast(sim, spell.Unit.CurrentTarget)
case dk.BloodBoil:
dk.RuneWeapon.BloodBoil.Cast(sim, spell.Unit.CurrentTarget)
}
},
})
Expand Down Expand Up @@ -85,10 +89,12 @@ type RuneWeaponPet struct {
DeathStrike *core.Spell
DeathCoil *core.Spell

BloodStrike *core.Spell
HeartStrike *core.Spell
HeartStrikeOffHit *core.Spell

Pestilence *core.Spell
BloodBoil *core.Spell

// Diseases
FrostFeverSpell *core.Spell
Expand All @@ -98,10 +104,12 @@ type RuneWeaponPet struct {
func (runeWeapon *RuneWeaponPet) Initialize() {
runeWeapon.dkOwner.registerDrwDiseaseDots()
runeWeapon.dkOwner.registerDrwPestilenceSpell()
runeWeapon.dkOwner.registerDrwBloodBoilSpell()

runeWeapon.dkOwner.registerDrwIcyTouchSpell()
runeWeapon.dkOwner.registerDrwPlagueStrikeSpell()
runeWeapon.dkOwner.registerDrwDeathStrikeSpell()
runeWeapon.dkOwner.registerDrwBloodStrikeSpell()
runeWeapon.dkOwner.registerDrwHeartStrikeSpell()
runeWeapon.dkOwner.registerDrwDeathCoilSpell()
}
Expand Down
4 changes: 4 additions & 0 deletions sim/deathknight/deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ func (dk *Deathknight) DiseasesAreActive(target *core.Unit) bool {
return dk.FrostFeverSpell.Dot(target).IsActive() || dk.BloodPlagueSpell.Dot(target).IsActive()
}

func (dk *Deathknight) DrwDiseasesAreActive(target *core.Unit) bool {
return dk.Talents.DancingRuneWeapon && dk.RuneWeapon.FrostFeverSpell.Dot(target).IsActive() || dk.RuneWeapon.BloodPlagueSpell.Dot(target).IsActive()
}

func (dk *Deathknight) bonusCritMultiplier(bonusTalentPoints int32) float64 {
return dk.MeleeCritMultiplier(1, 0.15*float64(bonusTalentPoints))
}
Expand Down
2 changes: 2 additions & 0 deletions sim/deathknight/dps/dps_deathknight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ var bloodRotation = &proto.Deathknight_Rotation{
DrwDiseases: proto.Deathknight_Rotation_Pestilence,
UseEmpowerRuneWeapon: true,
PreNerfedGargoyle: false,
UseDancingRuneWeapon: true,
BloodSpender: proto.Deathknight_Rotation_HS,
}

var unholyRotation = &proto.Deathknight_Rotation{
Expand Down
98 changes: 56 additions & 42 deletions sim/deathknight/dps/rotation_blood.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,66 @@ func (dk *DpsDeathknight) setupBloodRotations() {
dk.Inputs.FuStrike = deathknight.FuStrike_Obliterate
}

if dk.Talents.DancingRuneWeapon {
switch dk.Rotation.BloodSpender {
case proto.Deathknight_Rotation_HS:
dk.br.bloodSpell = dk.HeartStrike
if !dk.Talents.HeartStrike {
dk.br.bloodSpell = dk.BloodStrike
}
case proto.Deathknight_Rotation_BB:
dk.br.bloodSpell = dk.BloodBoil
case proto.Deathknight_Rotation_BS:
dk.br.bloodSpell = dk.BloodStrike
}

if dk.Rotation.UseDancingRuneWeapon && dk.Talents.DancingRuneWeapon {
dk.setupDrwCooldowns()
}

//if dk.Inputs.BloodOpener == proto.Deathknight_Rotation_Standard {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_PS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_FU).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_FU).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionCallback_ERW).
NewAction(dk.RotationActionCallback_RD).
NewAction(dk.RotationActionCallback_DRW_Custom)
NewAction(dk.RotationActionBL_DRW_Custom)

if dk.sr.hasGod && dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Pestilence {
if dk.Rotation.UseDancingRuneWeapon && dk.sr.hasGod && dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Pestilence {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_Pesti).
NewAction(dk.RotationActionCallback_BT).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_FU).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS)
} else if dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Normal {
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_FU).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS)
} else if dk.Rotation.UseDancingRuneWeapon && dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Normal {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_IT).
NewAction(dk.RotationActionCallback_PS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionCallback_BT).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS)
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS)
} else {
dk.RotationSequence.
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionCallback_BT).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_FU).
NewAction(dk.RotationActionCallback_HS).
NewAction(dk.RotationActionCallback_HS)
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_FU).
NewAction(dk.RotationActionBL_BS).
NewAction(dk.RotationActionBL_BS)
}

dk.RotationSequence.NewAction(dk.RotationActionCallback_BloodRotation)
dk.RotationSequence.NewAction(dk.RotationActionBL_BloodRotation)
}

func (dk *DpsDeathknight) RotationActionCallback_BloodRotation(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
func (dk *DpsDeathknight) RotationActionBL_BloodRotation(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
casted := false

if !dk.blDiseaseCheck(sim, target, dk.RaiseDead, true, 1) {
Expand All @@ -88,15 +99,11 @@ func (dk *DpsDeathknight) RotationActionCallback_BloodRotation(sim *core.Simulat
}

if !casted {
if dk.blDiseaseCheck(sim, target, dk.BloodStrike, true, 1) {
if dk.blDiseaseCheck(sim, target, dk.br.bloodSpell, true, 1) {
if dk.shShouldSpreadDisease(sim) {
return dk.blSpreadDiseases(sim, target, s)
} else {
if dk.Talents.HeartStrike {
casted = dk.HeartStrike.Cast(sim, target)
} else {
casted = dk.BloodStrike.Cast(sim, target)
}
casted = dk.br.bloodSpell.Cast(sim, target)
}
} else {
dk.blRecastDiseasesSequence(sim)
Expand Down Expand Up @@ -127,15 +134,15 @@ func (dk *DpsDeathknight) blAfterDrwSequence(sim *core.Simulation) {
dk.RotationSequence.Clear()

if dk.sr.hasGod && dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Pestilence {
dk.RotationSequence.NewAction(dk.RotationActionCallback_Pesti_DRW)
dk.RotationSequence.NewAction(dk.RotationActionBL_Pesti_DRW)
} else if dk.Rotation.DrwDiseases == proto.Deathknight_Rotation_Normal {
dk.RotationSequence.
NewAction(dk.RotationActionBL_IT_DRW).
NewAction(dk.RotationActionBL_PS_DRW)
}

dk.RotationSequence.
NewAction(dk.RotationAction_ResetToBloodMain)
NewAction(dk.RotationActionBL_ResetToBloodMain)
}

func (dk *DpsDeathknight) blRecastDiseasesSequence(sim *core.Simulation) {
Expand All @@ -160,26 +167,26 @@ func (dk *DpsDeathknight) blRecastDiseasesSequence(sim *core.Simulation) {
}

dk.RotationSequence.
NewAction(dk.RotationAction_ResetToBloodMain)
NewAction(dk.RotationActionBL_ResetToBloodMain)
}

func (dk *DpsDeathknight) RotationAction_ResetToBloodMain(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
func (dk *DpsDeathknight) RotationActionBL_ResetToBloodMain(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
dk.RotationSequence.Clear().
NewAction(dk.RotationActionCallback_BloodRotation)
NewAction(dk.RotationActionBL_BloodRotation)

return sim.CurrentTime
}

func (dk *DpsDeathknight) RotationActionCallback_DRW_Snapshot(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
func (dk *DpsDeathknight) RotationActionBL_DRW_Snapshot(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
dk.br.activatingDrw = true
dk.br.drwSnapshot.ActivateMajorCooldowns(sim)
dk.br.activatingDrw = false
s.Advance()
return sim.CurrentTime
}

func (dk *DpsDeathknight) RotationActionCallback_DRW_Custom(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
if dk.Talents.DancingRuneWeapon {
func (dk *DpsDeathknight) RotationActionBL_DRW_Custom(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
if dk.Rotation.UseDancingRuneWeapon && dk.Talents.DancingRuneWeapon {
casted := dk.DancingRuneWeapon.Cast(sim, target)
if casted {
dk.br.drwSnapshot.ResetProcTrackers()
Expand All @@ -192,7 +199,14 @@ func (dk *DpsDeathknight) RotationActionCallback_DRW_Custom(sim *core.Simulation
return -1
}

func (dk *DpsDeathknight) RotationActionCallback_FU(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
func (dk *DpsDeathknight) RotationActionBL_BS(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
casted := dk.br.bloodSpell.Cast(sim, target)
advance := dk.LastOutcome.Matches(core.OutcomeLanded)
s.ConditionalAdvance(casted && advance)
return -1
}

func (dk *DpsDeathknight) RotationActionBL_FU(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
casted := false
if dk.Inputs.FuStrike == deathknight.FuStrike_DeathStrike {
casted = dk.DeathStrike.Cast(sim, target)
Expand All @@ -205,7 +219,7 @@ func (dk *DpsDeathknight) RotationActionCallback_FU(sim *core.Simulation, target
return -1
}

func (dk *DpsDeathknight) RotationActionCallback_Pesti_DRW(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
func (dk *DpsDeathknight) RotationActionBL_Pesti_DRW(sim *core.Simulation, target *core.Unit, s *deathknight.Sequence) time.Duration {
casted := dk.Pestilence.Cast(sim, target)
advance := dk.LastOutcome.Matches(core.OutcomeLanded)

Expand Down
5 changes: 5 additions & 0 deletions sim/deathknight/dps/rotation_blood_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type BloodRotation struct {
drwSnapshot *core.SnapshotManager
drwMaxDelay time.Duration

bloodSpell *core.Spell

activatingDrw bool
}

Expand Down Expand Up @@ -152,6 +154,9 @@ func (dk *DpsDeathknight) blDrwCanCast(sim *core.Simulation, castTime time.Durat
if !dk.Talents.DancingRuneWeapon {
return false
}
if !dk.Rotation.UseDancingRuneWeapon {
return false
}
if !dk.DancingRuneWeapon.IsReady(sim) {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/icy_touch.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (dk *Deathknight) registerDrwIcyTouchSpell() {

BonusCritRating: dk.rimeCritBonus() * core.CritRatingPerCritChance,
DamageMultiplier: 0.5 * (1 + 0.05*float64(dk.Talents.ImprovedIcyTouch)),
CritMultiplier: dk.RuneWeapon.DefaultMeleeCritMultiplier(),
CritMultiplier: dk.DefaultMeleeCritMultiplier(),
ThreatMultiplier: 7,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
1 change: 1 addition & 0 deletions sim/deathknight/pestilence.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (dk *Deathknight) registerPestilenceSpell() {
},
})
}

func (dk *Deathknight) registerDrwPestilenceSpell() {
hasGlyphOfDisease := dk.HasMajorGlyph(proto.DeathknightMajorGlyph_GlyphOfDisease)
dk.RuneWeapon.Pestilence = dk.RuneWeapon.RegisterSpell(core.SpellConfig{
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/plague_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (dk *Deathknight) registerDrwPlagueStrikeSpell() {
BonusCritRating: (dk.annihilationCritBonus() + dk.scourgebornePlateCritBonus() + dk.viciousStrikesCritChanceBonus()) * core.CritRatingPerCritChance,
DamageMultiplier: 0.5 * 0.5 *
(1.0 + 0.1*float64(dk.Talents.Outbreak)),
CritMultiplier: dk.RuneWeapon.DefaultMeleeCritMultiplier(),
CritMultiplier: dk.bonusCritMultiplier(dk.Talents.ViciousStrikes),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
Loading

0 comments on commit f3aa380

Please sign in to comment.