Skip to content

Commit

Permalink
Merge pull request #3141 from jarveson/jake/feral-scourgebane
Browse files Browse the repository at this point in the history
feral: handle scourgebane predatory strikes bonus
  • Loading branch information
jarveson authored Jun 4, 2023
2 parents 1dfcdfe + 87e1b00 commit 1e174c3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions sim/druid/forms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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}

Expand All @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1e174c3

Please sign in to comment.