Skip to content

Commit

Permalink
Merge pull request #6 from wowsims/hunter_updates
Browse files Browse the repository at this point in the history
Hunter Updates
  • Loading branch information
rosenrusinov authored Feb 1, 2024
2 parents 083aab5 + d83c9b6 commit 5d8f7b5
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 83 deletions.
2 changes: 1 addition & 1 deletion sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (wa *WeaponAttack) swing(sim *Simulation) time.Duration {
wa.swingAt = sim.CurrentTime + wa.curSwingDuration
attackSpell.Cast(sim, wa.unit.CurrentTarget)

if !sim.Options.Interactive {
if !sim.Options.Interactive && wa.unit.Rotation != nil {
wa.unit.Rotation.DoNextAction(sim)
}
} else {
Expand Down
1 change: 1 addition & 0 deletions sim/hunter/kill_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (hunter *Hunter) registerKillCommand() {
Duration: time.Second * 30,
MaxStacks: 3,
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
// TODO: Make it only work on Claw/Bite after pet abilities refactor
if spell.ProcMask.Matches(core.ProcMaskMeleeSpecial | core.ProcMaskSpellDamage) {
aura.RemoveStack(sim)
hunterAura.RemoveStack(sim)
Expand Down
8 changes: 6 additions & 2 deletions sim/hunter/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ func (hp *HunterPet) ExecuteCustomRotation(sim *core.Simulation) {
target := hp.CurrentTarget

if hp.focusDump == nil {
hp.specialAbility.Cast(sim, target)
if hp.specialAbility.CanCast(sim, target) {
hp.specialAbility.Cast(sim, target)
}
return
}
if hp.specialAbility == nil {
hp.focusDump.Cast(sim, target)
if hp.focusDump.CanCast(sim, target) {
hp.focusDump.Cast(sim, target)
}
return
}

Expand Down
12 changes: 0 additions & 12 deletions sim/hunter/pet_abilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,7 @@ func (hp *HunterPet) newFocusDump(pat PetAbilityType, spellID int32) *core.Spell
baseDamage := sim.Roll(16, 22) + hp.MHWeaponDamage(sim, spell.MeleeAttackPower())
baseDamage *= hp.killCommandMult()

cobraStrikesActive := hp.hunterOwner.CobraStrikesAura.IsActive()
if cobraStrikesActive {
spell.BonusCritRating += 100 * core.CritRatingPerCritChance
}
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialHitAndCrit)

if cobraStrikesActive {
spell.BonusCritRating -= 100 * core.CritRatingPerCritChance
hp.hunterOwner.CobraStrikesAura.RemoveStack(sim)
if hp.hunterOwner.CobraStrikesAura.GetStacks() == 0 {
hp.hunterOwner.CobraStrikesAura.Deactivate(sim)
}
}
},
})
}
Expand Down
96 changes: 96 additions & 0 deletions sim/hunter/runes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package hunter

import (
"time"

"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
)

func (hunter *Hunter) ApplyRunes() {
if hunter.HasRune(proto.HunterRune_RuneChestHeartOfTheLion) {
statMultiply := 1.1
hunter.MultiplyStat(stats.Strength, statMultiply)
hunter.MultiplyStat(stats.Stamina, statMultiply)
hunter.MultiplyStat(stats.Agility, statMultiply)
hunter.MultiplyStat(stats.Intellect, statMultiply)
hunter.MultiplyStat(stats.Spirit, statMultiply)
}

if hunter.HasRune(proto.HunterRune_RuneChestMasterMarksman) {
hunter.AddStat(stats.MeleeCrit, 5*core.CritRatingPerCritChance)
hunter.AddStat(stats.SpellCrit, 5*core.SpellCritRatingPerCritChance)
}

if hunter.HasRune(proto.HunterRune_RuneChestLoneWolf) && hunter.pet == nil {
hunter.PseudoStats.DamageDealtMultiplier *= 1.3
}

if hunter.HasRune(proto.HunterRune_RuneHandsBeastmastery) && hunter.pet != nil {
hunter.pet.PseudoStats.DamageDealtMultiplier *= 1.2
}

hunter.applySniperTraining()
hunter.applyCobraStrikes()
}

func (hunter *Hunter) applySniperTraining() {
if !hunter.HasRune(proto.HunterRune_RuneLegsSniperTraining) {
return
}

hunter.SniperTrainingAura = hunter.GetOrRegisterAura(core.Aura{
Label: "Sniper Training",
ActionID: core.ActionID{SpellID: 415399},
Duration: time.Second * 6,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskRangedSpecial) {
spell.BonusCritRating += 10 * core.CritRatingPerCritChance
}
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskRangedSpecial) {
spell.BonusCritRating -= 10 * core.CritRatingPerCritChance
}
}
},
})

core.ApplyFixedUptimeAura(hunter.SniperTrainingAura, hunter.Options.SniperTrainingUptime, time.Second*6, 0)
}

func (hunter *Hunter) applyCobraStrikes() {
if !hunter.HasRune(proto.HunterRune_RuneChestCobraStrikes) || hunter.pet == nil {
return
}

hunter.CobraStrikesAura = hunter.pet.GetOrRegisterAura(core.Aura{
Label: "Cobra Strikes",
ActionID: core.ActionID{SpellID: 425714},
Duration: time.Second * 30,
MaxStacks: 2,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskMeleeSpecial | core.ProcMaskSpellDamage) {
spell.BonusCritRating += 100 * core.CritRatingPerCritChance
}
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskMeleeSpecial | core.ProcMaskSpellDamage) {
spell.BonusCritRating -= 100 * core.CritRatingPerCritChance
}
}
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.ProcMask.Matches(core.ProcMaskMeleeSpecial | core.ProcMaskSpellDamage) {
aura.RemoveStack(sim)
}
},
})
}
68 changes: 0 additions & 68 deletions sim/hunter/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,6 @@ func (hunter *Hunter) ApplyTalents() {
}
}

func (hunter *Hunter) ApplyRunes() {
if hunter.HasRune(proto.HunterRune_RuneChestHeartOfTheLion) {
statMultiply := 1.1
hunter.MultiplyStat(stats.Strength, statMultiply)
hunter.MultiplyStat(stats.Stamina, statMultiply)
hunter.MultiplyStat(stats.Agility, statMultiply)
hunter.MultiplyStat(stats.Intellect, statMultiply)
hunter.MultiplyStat(stats.Spirit, statMultiply)
}

if hunter.HasRune(proto.HunterRune_RuneChestMasterMarksman) {
hunter.AddStat(stats.MeleeCrit, 5*core.CritRatingPerCritChance)
hunter.AddStat(stats.SpellCrit, 5*core.SpellCritRatingPerCritChance)
}

if hunter.HasRune(proto.HunterRune_RuneChestLoneWolf) && hunter.pet == nil {
hunter.PseudoStats.DamageDealtMultiplier *= 1.15
}

if hunter.HasRune(proto.HunterRune_RuneHandsBeastmastery) && hunter.pet != nil {
hunter.pet.PseudoStats.DamageDealtMultiplier *= 1.2
}

hunter.applySniperTraining()
hunter.applyCobraStrikes()
}

func (hunter *Hunter) critMultiplier(isRanged bool, target *core.Unit) float64 {
primaryModifier := 1.0
secondaryModifier := 0.0
Expand All @@ -110,47 +83,6 @@ func (hunter *Hunter) critMultiplier(isRanged bool, target *core.Unit) float64 {
return hunter.MeleeCritMultiplier(primaryModifier, secondaryModifier)
}

func (hunter *Hunter) applySniperTraining() {
if !hunter.HasRune(proto.HunterRune_RuneLegsSniperTraining) {
return
}

hunter.SniperTrainingAura = hunter.GetOrRegisterAura(core.Aura{
Label: "Sniper Training",
ActionID: core.ActionID{SpellID: 415399},
Duration: time.Second * 6,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskRangedSpecial) {
spell.BonusCritRating += 10 * core.CritRatingPerCritChance
}
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
for _, spell := range aura.Unit.Spellbook {
if spell.ProcMask.Matches(core.ProcMaskRangedSpecial) {
spell.BonusCritRating -= 10 * core.CritRatingPerCritChance
}
}
},
})

core.ApplyFixedUptimeAura(hunter.SniperTrainingAura, hunter.Options.SniperTrainingUptime, time.Second*6, 0)
}

func (hunter *Hunter) applyCobraStrikes() {
if !hunter.HasRune(proto.HunterRune_RuneChestCobraStrikes) || hunter.pet == nil {
return
}

hunter.CobraStrikesAura = hunter.GetOrRegisterAura(core.Aura{
Label: "Cobra Strikes",
ActionID: core.ActionID{SpellID: 425714},
Duration: time.Second * 30,
MaxStacks: 2,
})
}

func (hunter *Hunter) applyFrenzy() {
if hunter.Talents.Frenzy == 0 {
return
Expand Down
13 changes: 13 additions & 0 deletions ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ export const BoonOfBlackfathom = withLabel(
'Boon of Blackfathom',
);

export const AshenvalePvpBuff = withLabel(
makeBooleanIndividualBuffInput({actionId: ActionId.fromSpellId(430352), fieldName: 'ashenvalePvpBuff', maxLevel: 39}),
'Ashenvale Pvp Buff',
);

///////////////////////////////////////////////////////////////////////////
// DEBUFFS
///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -443,6 +448,14 @@ export const WORLD_BUFFS_CONFIG = [
Stat.StatAttackPower
]
},
{
config: AshenvalePvpBuff,
picker: IconPicker,
stats: [
Stat.StatAttackPower,
Stat.StatSpellPower,
]
},
{
config: FengusFerocity,
picker: IconPicker,
Expand Down
1 change: 1 addition & 0 deletions ui/hunter/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecHunter, {
[Stat.StatStamina]: 0.5,
[Stat.StatAgility]: 2.65,
[Stat.StatIntellect]: 1.1,
[Stat.StatAttackPower]: 1.0,
[Stat.StatRangedAttackPower]: 1.0,
[Stat.StatMeleeHit]: 2,
[Stat.StatMeleeCrit]: 1.5,
Expand Down

0 comments on commit 5d8f7b5

Please sign in to comment.