From 14483d0569e17d249afdafc69c25a6225cf1e966 Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Sun, 29 Oct 2023 18:29:51 -0500 Subject: [PATCH 1/4] Update Ele T10 4pc --- sim/core/dot.go | 16 ++++++++++++++++ sim/shaman/items_wotlk.go | 20 ++++---------------- sim/shaman/shocks.go | 4 +++- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/sim/core/dot.go b/sim/core/dot.go index c17f2d5027..7d933267a5 100644 --- a/sim/core/dot.go +++ b/sim/core/dot.go @@ -111,6 +111,22 @@ func (dot *Dot) Rollover(sim *Simulation) { sim.AddPendingAction(dot.tickAction) } +func (dot *Dot) RescheduleNextTickAndExtend(sim *Simulation, numTicks int32) { + dot.NumberOfTicks += numTicks + // Set duration to remaining ticks, minus the elapsed time since last tick + dot.Aura.Duration = time.Duration(dot.MaxTicksRemaining())*dot.tickPeriod - sim.CurrentTime + dot.lastTickTime + dot.Aura.Refresh(sim) // update aura's duration + + dot.tickAction.Cancel(sim) // remove old PA ticker + + // recreate with new period, resetting the next tick. + periodicOptions := dot.basePeriodicOptions() + periodicOptions.Period = dot.tickPeriod + dot.tickAction = NewPeriodicAction(sim, periodicOptions) + dot.tickAction.NextActionAt = dot.lastTickTime + dot.tickPeriod + sim.AddPendingAction(dot.tickAction) +} + func (dot *Dot) Apply(sim *Simulation) { dot.TakeSnapshot(sim, false) diff --git a/sim/shaman/items_wotlk.go b/sim/shaman/items_wotlk.go index fce23136b7..52bfd68366 100644 --- a/sim/shaman/items_wotlk.go +++ b/sim/shaman/items_wotlk.go @@ -64,22 +64,10 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{ // Find the number of ticks whose duration is closest to 6s. // "our testing confirms that the 4pc t10 setbonus adds to FS the closest number of ticks to 6 seconds always" // https://web.archive.org/web/20100808192139/http://elitistjerks.com/f79/t76510-elemental_patch_3_3_now_more_fire_nova/p25/ - numTicks := 2 - period := fsDot.TickPeriod() - sixSeconds := time.Second * 6 - - for i := 3; i <= 10; i++ { - finishesAtCur := time.Duration(numTicks) * period - finishesAtNew := time.Duration(i) * period - - if math.Abs(float64(sixSeconds-finishesAtNew)) <= math.Abs(float64(sixSeconds-finishesAtCur)) { - numTicks = i - } else { - break - } - } - fsDot.Duration = fsDot.RemainingDuration(sim) + time.Duration(numTicks)*period - fsDot.Refresh(sim) + fsDot.RecomputeAuraDuration() + tickPeriod := fsDot.TickPeriod() + numTicks := int32(math.Round(float64(time.Second) * 6 / float64(tickPeriod))) + fsDot.RescheduleNextTickAndExtend(sim, numTicks) } }, }) diff --git a/sim/shaman/shocks.go b/sim/shaman/shocks.go index b3d5420b06..e8be1baed3 100644 --- a/sim/shaman/shocks.go +++ b/sim/shaman/shocks.go @@ -65,10 +65,12 @@ func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { config.CritMultiplier = shaman.ElementalCritMultiplier(core.TernaryFloat64(shaman.HasMajorGlyph(proto.ShamanMajorGlyph_GlyphOfFlameShock), 0.6, 0)) config.DamageMultiplier += 0.1 * float64(shaman.Talents.BoomingEchoes) + flameShockBaseNumberOfTicks := 6 + core.TernaryInt32(shaman.HasSetBonus(ItemSetThrallsRegalia, 2), 3, 0) config.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { baseDamage := 500 + 0.214*spell.SpellPower() result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) if result.Landed() { + spell.Dot(target).NumberOfTicks = flameShockBaseNumberOfTicks spell.Dot(target).Apply(sim) } spell.DealDamage(sim, result) @@ -89,7 +91,7 @@ func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { shaman.LavaBurst.BonusCritRating -= 100 * core.CritRatingPerCritChance }, }, - NumberOfTicks: 6 + core.TernaryInt32(shaman.HasSetBonus(ItemSetThrallsRegalia, 2), 3, 0), + NumberOfTicks: flameShockBaseNumberOfTicks, TickLength: time.Second * 3, AffectedByCastSpeed: true, From b6b4d6196885e4a70c76160ba4a48372371959f3 Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Sun, 29 Oct 2023 19:24:51 -0500 Subject: [PATCH 2/4] Update tests --- sim/shaman/elemental/TestElemental.results | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/shaman/elemental/TestElemental.results b/sim/shaman/elemental/TestElemental.results index fd46b4b652..55e522bc22 100644 --- a/sim/shaman/elemental/TestElemental.results +++ b/sim/shaman/elemental/TestElemental.results @@ -434,8 +434,8 @@ dps_results: { dps_results: { key: "TestElemental-AllItems-FrostWitch'sRegalia" value: { - dps: 8209.20382 - tps: 4559.89103 + dps: 8215.41125 + tps: 4564.44786 } } dps_results: { From 7318b67b9e6c391943daef339705ae4800fd6994 Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Mon, 30 Oct 2023 09:23:30 -0500 Subject: [PATCH 3/4] Switch to OnCastComplete --- sim/shaman/items_wotlk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/shaman/items_wotlk.go b/sim/shaman/items_wotlk.go index 52bfd68366..7e96d6e3a6 100644 --- a/sim/shaman/items_wotlk.go +++ b/sim/shaman/items_wotlk.go @@ -58,8 +58,8 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{ OnReset: func(aura *core.Aura, sim *core.Simulation) { aura.Activate(sim) }, - OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - fsDot := shaman.FlameShock.Dot(result.Target) + OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) { + fsDot := shaman.FlameShock.Dot(shaman.CurrentTarget) if spell == shaman.LavaBurst && fsDot.IsActive() { // Doesn't have to hit from tooltip // Find the number of ticks whose duration is closest to 6s. // "our testing confirms that the 4pc t10 setbonus adds to FS the closest number of ticks to 6 seconds always" From 89729ff6de131d6df5f509fb0fbc8a53085e1e88 Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Mon, 30 Oct 2023 09:45:02 -0500 Subject: [PATCH 4/4] Separate reschedule and extend --- sim/core/dot.go | 7 ++----- sim/shaman/items_wotlk.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sim/core/dot.go b/sim/core/dot.go index 7d933267a5..f66c3c7897 100644 --- a/sim/core/dot.go +++ b/sim/core/dot.go @@ -111,11 +111,8 @@ func (dot *Dot) Rollover(sim *Simulation) { sim.AddPendingAction(dot.tickAction) } -func (dot *Dot) RescheduleNextTickAndExtend(sim *Simulation, numTicks int32) { - dot.NumberOfTicks += numTicks - // Set duration to remaining ticks, minus the elapsed time since last tick - dot.Aura.Duration = time.Duration(dot.MaxTicksRemaining())*dot.tickPeriod - sim.CurrentTime + dot.lastTickTime - dot.Aura.Refresh(sim) // update aura's duration +func (dot *Dot) RescheduleNextTick(sim *Simulation) { + dot.RecomputeAuraDuration() dot.tickAction.Cancel(sim) // remove old PA ticker diff --git a/sim/shaman/items_wotlk.go b/sim/shaman/items_wotlk.go index 7e96d6e3a6..4b5736f288 100644 --- a/sim/shaman/items_wotlk.go +++ b/sim/shaman/items_wotlk.go @@ -61,13 +61,19 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{ OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) { fsDot := shaman.FlameShock.Dot(shaman.CurrentTarget) if spell == shaman.LavaBurst && fsDot.IsActive() { // Doesn't have to hit from tooltip + // 4p t10 immediately updates the tickPeriod based on current haste + fsDot.RescheduleNextTick(sim) + // Find the number of ticks whose duration is closest to 6s. // "our testing confirms that the 4pc t10 setbonus adds to FS the closest number of ticks to 6 seconds always" // https://web.archive.org/web/20100808192139/http://elitistjerks.com/f79/t76510-elemental_patch_3_3_now_more_fire_nova/p25/ - fsDot.RecomputeAuraDuration() tickPeriod := fsDot.TickPeriod() numTicks := int32(math.Round(float64(time.Second) * 6 / float64(tickPeriod))) - fsDot.RescheduleNextTickAndExtend(sim, numTicks) + fsDot.NumberOfTicks += numTicks + + // Set duration to remaining ticks, minus the elapsed time since last tick + fsDot.Aura.Duration = time.Duration(fsDot.MaxTicksRemaining())*tickPeriod - (tickPeriod - (fsDot.NextTickAt() - sim.CurrentTime)) + fsDot.Aura.Refresh(sim) // update aura's duration } }, })