Skip to content

Commit

Permalink
Merge pull request #1211 from ncberman/hunter_strikeResetFix
Browse files Browse the repository at this point in the history
Hunter - T3 Melee strike reset updates
  • Loading branch information
kayla-glick authored Jan 12, 2025
2 parents ad5e73a + 8688991 commit 39cf4a8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
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))
}

func (timer *Timer) Reset() {
*timer = Timer(startingCDTime)
}
Expand Down
12 changes: 6 additions & 6 deletions sim/hunter/item_sets_pve_phase_7.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ func (hunter *Hunter) applyNaxxramasMelee4PBonus() {

// Not entirely sure how this will work so taking some liberties
// Assume that it resets all of them when one crits
var spellsToReset []*core.Spell
//var spellsToReset []*core.Spell

core.MakePermanent(hunter.RegisterAura(core.Aura{
Label: label,
OnInit: func(aura *core.Aura, sim *core.Simulation) {
spellsToReset = hunter.Strikes
spellsToReset = append(spellsToReset, hunter.MongooseBite)
//spellsToReset = hunter.Strikes
//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 {
spell.CD.Reset()
}
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

0 comments on commit 39cf4a8

Please sign in to comment.