Skip to content

Commit

Permalink
Fixed item swap, with changes to auto attack
Browse files Browse the repository at this point in the history
  • Loading branch information
Horatio27 committed Oct 29, 2023
1 parent 06b9767 commit d670a34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions sim/core/item_swaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,19 @@ func (swap *ItemSwap) swapWeapon(slot proto.ItemSlot) {

switch slot {
case proto.ItemSlot_ItemSlotMainHand:
character.AutoAttacks.SetMH(character.WeaponFromMainHand(swap.mhCritMultiplier))
if character.AutoAttacks.AutoSwingMelee() {
character.AutoAttacks.SetMH(character.WeaponFromMainHand(swap.mhCritMultiplier))
}
case proto.ItemSlot_ItemSlotOffHand:
character.AutoAttacks.SetOH(character.WeaponFromOffHand(swap.ohCritMultiplier))
//Special case for when the OHAuto Spell was set up with a non weapon and does not have a crit multiplier.
character.PseudoStats.CanBlock = character.OffHand().WeaponType == proto.WeaponType_WeaponTypeShield
if character.AutoAttacks.AutoSwingMelee() {
character.AutoAttacks.SetOH(character.WeaponFromOffHand(swap.ohCritMultiplier))
//Special case for when the OHAuto Spell was set up with a non weapon and does not have a crit multiplier.
character.PseudoStats.CanBlock = character.OffHand().WeaponType == proto.WeaponType_WeaponTypeShield
}
case proto.ItemSlot_ItemSlotRanged:
character.AutoAttacks.SetRanged(character.WeaponFromRanged(swap.rangedCritMultiplier))
if character.AutoAttacks.AutoSwingRanged() {
character.AutoAttacks.SetRanged(character.WeaponFromRanged(swap.rangedCritMultiplier))
}
}

character.AutoAttacks.isDualWielding = character.MainHand().SwingSpeed != 0 && character.OffHand().SwingSpeed != 0
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/fire_elemental_totem.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (shaman *Shaman) registerFireElementalTotem() {
Type: core.CooldownTypeUnknown,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
success := false
if enhTier10Aura != nil && shaman.Totems.EnhTierTenBonus {
if enhTier10Aura != nil && shaman.Totems.EnhTierTenBonus && shaman.fireElementalSnapShot != nil {
if enhTier10Aura.IsActive() {
success = shaman.fireElementalSnapShot.CanSnapShot(sim, castWindow)
} else if sim.CurrentTime+fireTotemDuration > sim.Encounter.Duration {
Expand Down

0 comments on commit d670a34

Please sign in to comment.