Skip to content

Commit

Permalink
Merge pull request #1391 from wowsims/fix/feral-weapon-swap
Browse files Browse the repository at this point in the history
Add Feral Paws handler
  • Loading branch information
1337LutZ authored Feb 14, 2025
2 parents 9c2f475 + 900cbd9 commit d6bb539
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sim/core/item_swaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ItemSwap struct {
onItemSwapCallbacks [NumItemSlots][]OnItemSwap

isFuryWarrior bool
isFeralDruid bool
mhCritMultiplier float64
ohCritMultiplier float64
rangedCritMultiplier float64
Expand Down Expand Up @@ -81,6 +82,7 @@ func (character *Character) enableItemSwap(itemSwap *proto.ItemSwap, mhCritMulti

character.ItemSwap = ItemSwap{
isFuryWarrior: character.Spec == proto.Spec_SpecFuryWarrior,
isFeralDruid: character.Spec == proto.Spec_SpecFeralDruid || character.Spec == proto.Spec_SpecGuardianDruid,
mhCritMultiplier: mhCritMultiplier,
ohCritMultiplier: ohCritMultiplier,
rangedCritMultiplier: rangedCritMultiplier,
Expand Down Expand Up @@ -372,7 +374,9 @@ func (swap *ItemSwap) swapItem(sim *Simulation, slot proto.ItemSlot, isPrepull b

switch slot {
case proto.ItemSlot_ItemSlotMainHand:
if character.AutoAttacks.AutoSwingMelee {
// Feral's concept of Paws is handeled in the druid.go Initialize()
// and doesn't need MH swap handling here.
if character.AutoAttacks.AutoSwingMelee && !swap.isFeralDruid {
character.AutoAttacks.SetMH(character.WeaponFromMainHand(swap.mhCritMultiplier))
}
case proto.ItemSlot_ItemSlotOffHand:
Expand Down
9 changes: 9 additions & 0 deletions sim/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,15 @@ func (druid *Druid) Initialize() {
druid.BlazeOfGloryAura = druid.GetAura("Blaze of Glory")
})

druid.RegisterItemSwapCallback([]proto.ItemSlot{proto.ItemSlot_ItemSlotMainHand}, func(sim *core.Simulation, slot proto.ItemSlot) {
switch {
case druid.InForm(Cat):
druid.AutoAttacks.SetMH(druid.GetCatWeapon())
case druid.InForm(Bear):
druid.AutoAttacks.SetMH(druid.GetBearWeapon())
}
})

druid.registerFaerieFireSpell()
// druid.registerRebirthSpell()
druid.registerInnervateCD()
Expand Down

0 comments on commit d6bb539

Please sign in to comment.