Skip to content

Commit

Permalink
Merge pull request #3600 from vigo2/vigo/earthliving-fix
Browse files Browse the repository at this point in the history
Vigo/earthliving fix
  • Loading branch information
vigo2 authored Sep 5, 2023
2 parents a2a1a8e + 4c53c44 commit ae87464
Show file tree
Hide file tree
Showing 6 changed files with 333 additions and 407 deletions.
13 changes: 0 additions & 13 deletions sim/core/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,12 @@ const (

ProcMaskDirect = ProcMaskMelee | ProcMaskRanged | ProcMaskSpellDamage

ProcMaskTwoRoll = ProcMaskRanged | ProcMaskMeleeSpecial

ProcMaskSpecial = ProcMaskMeleeOrRangedSpecial | ProcMaskSpellDamage

ProcMaskMeleeOrProc = ProcMaskMelee | ProcMaskProc
ProcMaskSpellOrProc = ProcMaskSpellDamage | ProcMaskProc
)

func GetMeleeProcMaskForHands(mh bool, oh bool) ProcMask {
mask := ProcMaskUnknown
if mh {
mask |= ProcMaskMeleeMH
}
if oh {
mask |= ProcMaskMeleeOH
}
return mask
}

// Possible outcomes of any hit/damage roll.
type HitOutcome uint16

Expand Down
8 changes: 4 additions & 4 deletions sim/shaman/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ func NewElementalShaman(character core.Character, options *proto.Player) *Elemen
}
ele.EnableResumeAfterManaWait(ele.tryUseGCD)

if ele.HasMHWeapon() {
ele.ApplyFlametongueImbueToItem(ele.GetMHWeapon(), false)
if mh := ele.GetMHWeapon(); mh != nil {
ele.ApplyFlametongueImbueToItem(mh, false)
}

if ele.HasOHWeapon() {
ele.ApplyFlametongueImbueToItem(ele.GetOHWeapon(), false)
if oh := ele.GetOHWeapon(); oh != nil {
ele.ApplyFlametongueImbueToItem(oh, false)
}

if ele.Talents.FeralSpirit {
Expand Down
28 changes: 15 additions & 13 deletions sim/shaman/enhancement/enhancement.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,10 @@ func NewEnhancementShaman(character core.Character, options *proto.Player) *Enha
enh.SelfBuffs.ImbueOH = proto.ShamanImbue_NoImbue
}

enh.RegisterFlametongueImbue(
enh.SelfBuffs.ImbueMH == proto.ShamanImbue_FlametongueWeapon,
enh.SelfBuffs.ImbueOH == proto.ShamanImbue_FlametongueWeapon)
enh.RegisterFlametongueDownrankImbue(
enh.SelfBuffs.ImbueMH == proto.ShamanImbue_FlametongueWeaponDownrank,
enh.SelfBuffs.ImbueOH == proto.ShamanImbue_FlametongueWeaponDownrank)
enh.RegisterWindfuryImbue(
enh.SelfBuffs.ImbueMH == proto.ShamanImbue_WindfuryWeapon,
enh.SelfBuffs.ImbueOH == proto.ShamanImbue_WindfuryWeapon)
enh.RegisterFlametongueImbue(enh.getImbueProcMask(proto.ShamanImbue_FlametongueWeapon), false)
enh.RegisterFlametongueImbue(enh.getImbueProcMask(proto.ShamanImbue_FlametongueWeaponDownrank), true)
enh.RegisterWindfuryImbue(enh.getImbueProcMask(proto.ShamanImbue_WindfuryWeapon))
enh.RegisterFrostbrandImbue(enh.getImbueProcMask(proto.ShamanImbue_FrostbrandWeapon))

enh.SpiritWolves = &shaman.SpiritWolves{
SpiritWolf1: enh.NewSpiritWolf(1),
Expand All @@ -99,6 +94,17 @@ func NewEnhancementShaman(character core.Character, options *proto.Player) *Enha
return enh
}

func (enh *EnhancementShaman) getImbueProcMask(imbue proto.ShamanImbue) core.ProcMask {
var mask core.ProcMask
if enh.SelfBuffs.ImbueMH == imbue {
mask |= core.ProcMaskMeleeMH
}
if enh.SelfBuffs.ImbueOH == imbue {
mask |= core.ProcMaskMeleeOH
}
return mask
}

type EnhancementShaman struct {
*shaman.Shaman

Expand All @@ -115,10 +121,6 @@ func (enh *EnhancementShaman) GetShaman() *shaman.Shaman {
func (enh *EnhancementShaman) Initialize() {
enh.Shaman.Initialize()

enh.RegisterFrostbrandImbue(
enh.SelfBuffs.ImbueMH == proto.ShamanImbue_FrostbrandWeapon,
enh.SelfBuffs.ImbueOH == proto.ShamanImbue_FrostbrandWeapon)

if enh.ItemSwap.IsEnabled() {
mh := enh.ItemSwap.GetItem(proto.ItemSlot_ItemSlotMainHand)
enh.ApplyFlametongueImbueToItem(mh, true)
Expand Down
Loading

0 comments on commit ae87464

Please sign in to comment.