Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hunter - T3 Melee strike reset updates #1211

Merged
merged 5 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sim/core/cooldown.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func (timer *Timer) Set(t time.Duration) {
*timer = Timer(t)
}

// Niche reset meant to be used for attack queued abilities that can be reset. Avoids a queued ability going off twice during thrashes like Wild Strikes.
func (timer *Timer) QueueReset(t time.Duration) {
*timer = Timer(t + (time.Millisecond * 50))
}
ncberman marked this conversation as resolved.
Show resolved Hide resolved

func (timer *Timer) Reset() {
*timer = Timer(startingCDTime)
}
Expand Down
6 changes: 4 additions & 2 deletions sim/hunter/item_sets_pve_phase_7.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ func (hunter *Hunter) applyNaxxramasMelee4PBonus() {
spellsToReset = append(spellsToReset, hunter.MongooseBite)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if (spell.Flags.Matches(SpellFlagStrike) || spell.SpellCode == SpellCode_HunterMongooseBite) && result.DidCrit() {
for _, spell := range spellsToReset {
if (spell.Flags.Matches(SpellFlagStrike) || spell.SpellCode == SpellCode_HunterMongooseBite || spell.SpellCode == SpellCode_HunterRaptorStrikeHit) && result.DidCrit() {
if spell.SpellCode == SpellCode_HunterRaptorStrikeHit {
hunter.RaptorStrike.CD.QueueReset(sim.CurrentTime)
} else {
spell.CD.Reset()
}
Copy link
Collaborator

@kayla-glick kayla-glick Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be slightly cleaner:

Suggested change
if (spell.Flags.Matches(SpellFlagStrike) || spell.SpellCode == SpellCode_HunterMongooseBite || spell.SpellCode == SpellCode_HunterRaptorStrikeHit) && result.DidCrit() {
if spell.SpellCode == SpellCode_HunterRaptorStrikeHit {
hunter.RaptorStrike.CD.QueueReset(sim.CurrentTime)
} else {
spell.CD.Reset()
}
if (spell.Flags.Matches(SpellFlagStrike) || spell.SpellCode == SpellCode_HunterMongooseBite) && result.DidCrit() {
spell.CD.Reset()
} else if spell.SpellCode == SpellCode_HunterRaptorStrikeHit && result.DidCrit() {
hunter.RaptorStrike.CD.QueueReset(sim.CurrentTime)
}

}
Expand Down
6 changes: 5 additions & 1 deletion sim/hunter/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ func init() {
MaxStacks: 2,
OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
if spell.Flags.Matches(SpellFlagShot) || spell.ProcMask.Matches(core.ProcMaskMeleeSpecial) && spell.CD.Timer != nil {
spell.CD.Reset()
if spell.SpellCode == SpellCode_HunterRaptorStrike {
spell.CD.QueueReset(sim.CurrentTime)
} else {
spell.CD.Reset()
}
aura.RemoveStack(sim)
}
},
Expand Down
Loading