From 4136f424b389429d0010a2828d2d51746a0162dc Mon Sep 17 00:00:00 2001 From: The Grox Empire <47816228+TheGroxEmpire@users.noreply.github.com> Date: Sun, 24 Mar 2024 10:26:31 +0700 Subject: [PATCH] Warrior: add Polearm Specialization --- sim/warrior/talents.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sim/warrior/talents.go b/sim/warrior/talents.go index 4f3c73c8e6..5f61b0d5f3 100644 --- a/sim/warrior/talents.go +++ b/sim/warrior/talents.go @@ -99,6 +99,28 @@ func (warrior *Warrior) applyWeaponSpecializations() { }) } } + + if ps := warrior.Talents.PolearmSpecialization; ps > 0 { + // the default character panel displays critical strike chance for main hand only + switch warrior.GetProcMaskForTypes(proto.WeaponType_WeaponTypePolearm) { + case core.ProcMaskMelee: + warrior.AddStat(stats.MeleeCrit, 1*core.CritRatingPerCritChance*float64(ps)) + case core.ProcMaskMeleeMH: + warrior.AddStat(stats.MeleeCrit, 1*core.CritRatingPerCritChance*float64(ps)) + warrior.OnSpellRegistered(func(spell *core.Spell) { + if spell.ProcMask.Matches(core.ProcMaskMeleeOH) { + spell.BonusCritRating -= 1 * core.CritRatingPerCritChance * float64(ps) + } + }) + case core.ProcMaskMeleeOH: + warrior.OnSpellRegistered(func(spell *core.Spell) { + if spell.ProcMask.Matches(core.ProcMaskMeleeOH) { + spell.BonusCritRating += 1 * core.CritRatingPerCritChance * float64(ps) + } + }) + } + } + } func (warrior *Warrior) registerSwordSpecialization(procMask core.ProcMask) {