From 607ba4570fb7cc0253c1e9e8d4f5a50485299526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Hillerstr=C3=B6m?= Date: Thu, 7 Nov 2024 17:30:51 +0100 Subject: [PATCH] [DK] Add Blood Strike --- sim/death_knight/blood_strike.go | 76 ++++++++++++++++++++++++++++++++ sim/death_knight/death_knight.go | 2 + ui/core/proto_utils/action_id.ts | 33 ++++++++++---- 3 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 sim/death_knight/blood_strike.go diff --git a/sim/death_knight/blood_strike.go b/sim/death_knight/blood_strike.go new file mode 100644 index 0000000000..423549f699 --- /dev/null +++ b/sim/death_knight/blood_strike.go @@ -0,0 +1,76 @@ +package death_knight + +import ( + "github.com/wowsims/cata/sim/core" + "github.com/wowsims/cata/sim/core/proto" +) + +var bloodStrikeActionID = core.ActionID{SpellID: 45902} + +func (dk *DeathKnight) registerBloodStrikeSpell() { + ohSpell := dk.GetOrRegisterSpell(core.SpellConfig{ + ActionID: bloodStrikeActionID.WithTag(2), + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeOHSpecial, + Flags: core.SpellFlagMeleeMetrics, + ClassSpellMask: DeathKnightSpellBloodStrike, + + DamageMultiplier: 0.8, + DamageMultiplierAdditive: 1, + CritMultiplier: dk.DefaultMeleeCritMultiplier(), + ThreatMultiplier: 1, + + ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { + baseDamage := dk.ClassSpellScaling*0.37799999118 + + spell.Unit.OHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) + + baseDamage *= dk.GetDiseaseMulti(target, 1.0, 0.025) + + spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialCritOnly) + }, + }) + + hasReaping := dk.Inputs.Spec == proto.Spec_SpecUnholyDeathKnight + + dk.GetOrRegisterSpell(core.SpellConfig{ + ActionID: bloodStrikeActionID.WithTag(1), + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL, + ClassSpellMask: DeathKnightSpellBloodStrike, + + RuneCost: core.RuneCostOptions{ + BloodRuneCost: 1, + RunicPowerGain: 10, + Refundable: true, + }, + Cast: core.CastConfig{ + DefaultCast: core.Cast{ + GCD: core.GCDDefault, + }, + IgnoreHaste: true, + }, + + DamageMultiplier: 0.8, + CritMultiplier: dk.DefaultMeleeCritMultiplier(), + ThreatMultiplier: 1, + + ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { + baseDamage := dk.ClassSpellScaling*0.75599998236 + + spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) + + baseDamage *= dk.GetDiseaseMulti(target, 1.0, 0.125) + + result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMeleeWeaponSpecialHitAndCrit) + + if hasReaping { + spell.SpendRefundableCostAndConvertBloodRune(sim, result, 1) + } else { + spell.SpendRefundableCost(sim, result) + } + dk.ThreatOfThassarianProc(sim, result, ohSpell) + + spell.DealDamage(sim, result) + }, + }) +} diff --git a/sim/death_knight/death_knight.go b/sim/death_knight/death_knight.go index 0b02c317ce..c2e005d9c1 100644 --- a/sim/death_knight/death_knight.go +++ b/sim/death_knight/death_knight.go @@ -145,6 +145,7 @@ func (dk *DeathKnight) Initialize() { dk.registerDeathPactSpell() dk.registerAntiMagicShellSpell() dk.registerRunicPowerDecay() + dk.registerBloodStrikeSpell() } func (dk *DeathKnight) Reset(sim *core.Simulation) { @@ -351,6 +352,7 @@ const ( DeathKnightSpellDancingRuneWeapon DeathKnightSpellDeathPact DeathKnightSpellUnholyBlight + DeathKnightSpellBloodStrike DeathKnightSpellKillingMachine // Used to react to km procs DeathKnightSpellConvertToDeathRune // Used to react to death rune gains diff --git a/ui/core/proto_utils/action_id.ts b/ui/core/proto_utils/action_id.ts index e31d8ba143..300ed638e7 100644 --- a/ui/core/proto_utils/action_id.ts +++ b/ui/core/proto_utils/action_id.ts @@ -255,11 +255,11 @@ export class ActionId { const baseName = tooltipData['name']; let name = baseName; - // handle DRT - let tag = this.tag + // handle DRT + let tag = this.tag; if (tag >= 71086) { - name = "Dragonwrath - " + name; - tag -= 71086 + name = 'Dragonwrath - ' + name; + tag -= 71086; } switch (baseName) { @@ -461,12 +461,12 @@ export class ActionId { if (tag === playerIndex || playerIndex == undefined) { name += ` (self)`; } else { - name += ` (from #${tag + 1})`; - } - } else { - name += ' (raid)'; + name += ` (from #${tag + 1})`; } - break; + } else { + name += ' (raid)'; + } + break; case 'Elemental Mastery': if (this.spellId === 64701) { name = `${name} (Buff)`; @@ -497,6 +497,7 @@ export class ActionId { case 'Obliterate': case 'Blood-Caked Strike': case 'Festering Strike': + case 'Blood Strike': case 'Razor Frost': case 'Lightning Speed': case 'Windfury Weapon': @@ -855,6 +856,20 @@ const spellIdTooltipOverrides: Map = new Map([ [JSON.stringify({ spellId: 879, tag: 3 }), { spellId: 54934 }], // Paladin - Glyph of Exorcism [JSON.stringify({ spellId: 49020, tag: 3 }), { spellId: 99000 }], // Death Knight - T12 4P Flaming Torment [JSON.stringify({ spellId: 55090, tag: 3 }), { spellId: 99000 }], // Death Knight - T12 4P Flaming Torment + + // Off-Hand attacks + [JSON.stringify({ spellId: 45902, tag: 2 }), { spellId: 66215 }], // Death Knight - Blood Strike Off-Hand + [JSON.stringify({ spellId: 45462, tag: 2 }), { spellId: 49998 }], // Death Knight - Death Strike Off-Hand + [JSON.stringify({ spellId: 85948, tag: 2 }), { spellId: 86061 }], // Death Knight - Festering Strike Off-Hand + [JSON.stringify({ spellId: 49143, tag: 2 }), { spellId: 66196 }], // Death Knight - Frost Strike Off-Hand + [JSON.stringify({ spellId: 49020, tag: 2 }), { spellId: 66198 }], // Death Knight - Obliterate Off-Hand + [JSON.stringify({ spellId: 45462, tag: 2 }), { spellId: 66216 }], // Death Knight - Plague Strike Off-Hand + [JSON.stringify({ spellId: 56815, tag: 2 }), { spellId: 66217 }], // Death Knight - Rune Strike Off-Hand + [JSON.stringify({ spellId: 1329, tag: 2 }), { spellId: 27576 }], // Rogue - Mutilate Off-Hand + [JSON.stringify({ spellId: 17364, tag: 2 }), { spellId: 32176 }], // Shaman - Stormstrike Off-Hand + [JSON.stringify({ spellId: 85288, tag: 2 }), { spellId: 85384 }], // Warrior - Raging Blow Off-Hand + [JSON.stringify({ spellId: 1464, tag: 2 }), { spellId: 97992 }], // Warrior - Slam Off-Hand + [JSON.stringify({ spellId: 1680, tag: 2 }), { spellId: 44949 }], // Warrior - Whirlwind Off-Hand ]); export const defaultTargetIcon = 'https://wow.zamimg.com/images/wow/icons/large/spell_shadow_metamorphosis.jpg';