From 87e1b00f67d1085eb29cf50372a0c9b8ed56f72f Mon Sep 17 00:00:00 2001 From: jarves Date: Sat, 3 Jun 2023 19:48:51 -0500 Subject: [PATCH] feral: handle scourgebane predatory strikes bonus Signed-off-by: jarves --- sim/druid/forms.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sim/druid/forms.go b/sim/druid/forms.go index 2607cd9c9c..f28a2d7dc2 100644 --- a/sim/druid/forms.go +++ b/sim/druid/forms.go @@ -5,6 +5,7 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" + "github.com/wowsims/wotlk/sim/core/proto" "github.com/wowsims/wotlk/sim/core/stats" ) @@ -88,6 +89,21 @@ func (druid *Druid) GetFormShiftStats() stats.Stats { return s } +func (druid *Druid) GetDynamicPredStrikeStats() stats.Stats { + // Accounts for ap bonus for 'dynamic' enchants + // just scourgebane currently, this is a bit hacky but is needed as the bonus varies based on current target + // so has to be 'cached' differently + s := stats.Stats{} + if weapon := druid.GetMHWeapon(); weapon != nil { + bonusAp := 0.0 + if weapon.Enchant.EffectID == 3247 && druid.CurrentTarget.MobType == proto.MobType_MobTypeUndead { + bonusAp += 140 + } + s[stats.AttackPower] += bonusAp * ((0.2 / 3) * float64(druid.Talents.PredatoryStrikes)) + } + return s +} + func (druid *Druid) registerCatFormSpell() { actionID := core.ActionID{SpellID: 768} @@ -107,6 +123,8 @@ func (druid *Druid) registerCatFormSpell() { clawWeapon := druid.GetCatWeapon() + predBonus := stats.Stats{} + druid.CatFormAura = druid.RegisterAura(core.Aura{ Label: "Cat Form", ActionID: actionID, @@ -124,6 +142,9 @@ func (druid *Druid) registerCatFormSpell() { druid.PseudoStats.ThreatMultiplier *= 0.71 druid.PseudoStats.SpiritRegenMultiplier *= AnimalSpiritRegenSuppression druid.PseudoStats.BaseDodge += 0.02 * float64(druid.Talents.FeralSwiftness) + + predBonus = druid.GetDynamicPredStrikeStats() + druid.AddStatsDynamic(sim, predBonus) druid.AddStatsDynamic(sim, statBonus) druid.EnableDynamicStatDep(sim, agiApDep) if hotwDep != nil { @@ -153,6 +174,8 @@ func (druid *Druid) registerCatFormSpell() { druid.PseudoStats.ThreatMultiplier /= 0.71 druid.PseudoStats.SpiritRegenMultiplier /= AnimalSpiritRegenSuppression druid.PseudoStats.BaseDodge -= 0.02 * float64(druid.Talents.FeralSwiftness) + + druid.AddStatsDynamic(sim, predBonus.Multiply(-1)) druid.AddStatsDynamic(sim, statBonus.Multiply(-1)) druid.DisableDynamicStatDep(sim, agiApDep) if hotwDep != nil { @@ -241,6 +264,7 @@ func (druid *Druid) registerBearFormSpell() { potpdtm := 1 - 0.04*float64(druid.Talents.ProtectorOfThePack) clawWeapon := druid.GetBearWeapon() + predBonus := stats.Stats{} druid.BearFormAura = druid.RegisterAura(core.Aura{ Label: "Bear Form", @@ -260,6 +284,9 @@ func (druid *Druid) registerBearFormSpell() { druid.PseudoStats.DamageTakenMultiplier *= potpdtm druid.PseudoStats.SpiritRegenMultiplier *= AnimalSpiritRegenSuppression druid.PseudoStats.BaseDodge += 0.02 * float64(druid.Talents.FeralSwiftness+druid.Talents.NaturalReaction) + + predBonus = druid.GetDynamicPredStrikeStats() + druid.AddStatsDynamic(sim, predBonus) druid.AddStatsDynamic(sim, statBonus) if potpDep != nil { druid.EnableDynamicStatDep(sim, potpDep) @@ -290,6 +317,8 @@ func (druid *Druid) registerBearFormSpell() { druid.PseudoStats.DamageTakenMultiplier /= potpdtm druid.PseudoStats.SpiritRegenMultiplier /= AnimalSpiritRegenSuppression druid.PseudoStats.BaseDodge -= 0.02 * float64(druid.Talents.FeralSwiftness+druid.Talents.NaturalReaction) + + druid.AddStatsDynamic(sim, predBonus.Multiply(-1)) druid.AddStatsDynamic(sim, statBonus.Multiply(-1)) if potpDep != nil { druid.DisableDynamicStatDep(sim, potpDep)