From 1d95501b9ba486a3ada1f5b764491230eb46f173 Mon Sep 17 00:00:00 2001 From: muffinstomp Date: Fri, 4 Apr 2025 11:31:10 -0400 Subject: [PATCH 1/3] initial commit --- sim/core/aura.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sim/core/aura.go b/sim/core/aura.go index 84ae1d11a0..8c47544864 100644 --- a/sim/core/aura.go +++ b/sim/core/aura.go @@ -22,6 +22,7 @@ type OnRefresh func(aura *Aura, sim *Simulation) type OnExpire func(aura *Aura, sim *Simulation) type OnStacksChange func(aura *Aura, sim *Simulation, oldStacks int32, newStacks int32) type OnStatsChange func(aura *Aura, sim *Simulation, oldStats stats.Stats, newStats stats.Stats) +type IsEnabledInSettings func(aura *Aura, sim *Simulation) // Callback for after a spell hits the target and after damage is calculated. Use it for proc effects // or anything that comes from the final result of the spell. @@ -120,6 +121,9 @@ type Aura struct { metrics AuraMetrics initialized bool + + // P8 Sebacious Poison fix + IsEnabledInSettings IsEnabledInSettings } func (aura *Aura) init(sim *Simulation) { From d9e51dcc39af8299a9f732278c16cbee66b097a7 Mon Sep 17 00:00:00 2001 From: muffinstomp Date: Fri, 4 Apr 2025 11:54:19 -0400 Subject: [PATCH 2/3] added a new callback to Auras to differentiate if they are being applied by the sim in Settings UI or not --- sim/core/aura.go | 10 ++++++++-- sim/core/debuffs.go | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sim/core/aura.go b/sim/core/aura.go index 8c47544864..2fc7f54455 100644 --- a/sim/core/aura.go +++ b/sim/core/aura.go @@ -22,7 +22,6 @@ type OnRefresh func(aura *Aura, sim *Simulation) type OnExpire func(aura *Aura, sim *Simulation) type OnStacksChange func(aura *Aura, sim *Simulation, oldStacks int32, newStacks int32) type OnStatsChange func(aura *Aura, sim *Simulation, oldStats stats.Stats, newStats stats.Stats) -type IsEnabledInSettings func(aura *Aura, sim *Simulation) // Callback for after a spell hits the target and after damage is calculated. Use it for proc effects // or anything that comes from the final result of the spell. @@ -123,7 +122,7 @@ type Aura struct { initialized bool // P8 Sebacious Poison fix - IsEnabledInSettings IsEnabledInSettings + IsEnabledInSettings bool } func (aura *Aura) init(sim *Simulation) { @@ -443,6 +442,13 @@ func (aura *Aura) ApplyOnPeriodicDamageDealt(newOnPeriodicDamageDealt OnPeriodic return aura } +// TODO: working on fixing p8 bonus applying to Sebacious in Settings>Debuffs +func (aura *Aura) ApplyIsEnabledInSettings() *Aura { + aura.IsEnabledInSettings = true + + return aura +} + type AuraFactory func(*Simulation) *Aura // Callback for doing something on reset. diff --git a/sim/core/debuffs.go b/sim/core/debuffs.go index f04dcdf49d..6c396df79c 100644 --- a/sim/core/debuffs.go +++ b/sim/core/debuffs.go @@ -178,6 +178,7 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, lev if debuffs.SebaciousPoison != proto.TristateEffect_TristateEffectMissing { aura := SebaciousPoisonAura(target, TernaryInt32(debuffs.SebaciousPoison == proto.TristateEffect_TristateEffectRegular, 0, 2), level) + aura.ApplyIsEnabledInSettings() SchedulePeriodicDebuffApplication(aura, PeriodicActionOptions{ Period: time.Second * 0, NumTicks: 1, From 22c8005ea5a3234970571003b6fd435a0a366cad Mon Sep 17 00:00:00 2001 From: muffinstomp Date: Fri, 4 Apr 2025 12:19:30 -0400 Subject: [PATCH 3/3] added if statement to the helper function that tracks stacks for p8 dps tier 2pc bonus that will check whether the aura was added in Settings before adding stacks --- sim/rogue/item_sets_phase_8.go | 2 ++ sim/rogue/poisons.go | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sim/rogue/item_sets_phase_8.go b/sim/rogue/item_sets_phase_8.go index 9950018a80..33f88de1a2 100644 --- a/sim/rogue/item_sets_phase_8.go +++ b/sim/rogue/item_sets_phase_8.go @@ -1,6 +1,7 @@ package rogue import ( + "fmt" "time" "github.com/wowsims/sod/sim/core" @@ -54,6 +55,7 @@ func (rogue *Rogue) applyScarletEnclaveDamage2PBonus() { Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { totalBleedsAndPoisons := rogue.PoisonsActive[rogue.CurrentTarget.UnitIndex] + rogue.BleedsActive[rogue.CurrentTarget.UnitIndex] + fmt.Println("Stack Count: ", totalBleedsAndPoisons) // Only apply the damage mod up to 3 times for the 60% bonus maximum damageMod.UpdateFloatValue(1 + 0.20*float64(min(3, totalBleedsAndPoisons))) damageMod.Activate() diff --git a/sim/rogue/poisons.go b/sim/rogue/poisons.go index 626bd4c9f2..210d8094e4 100644 --- a/sim/rogue/poisons.go +++ b/sim/rogue/poisons.go @@ -1,6 +1,7 @@ package rogue import ( + "fmt" "strconv" "time" @@ -69,11 +70,14 @@ func (rogue *Rogue) improvedPoisonsBonusProcChance() float64 { // p8 DPS tier bonus helper function func trackTotalUniquePoisons(aura *core.Aura, rogue *Rogue) { - aura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) { - rogue.PoisonsActive[aura.Unit.UnitIndex]++ - }).ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) { - rogue.PoisonsActive[aura.Unit.UnitIndex]-- - }) + fmt.Println("AuraIsFromSettings: ", aura.IsEnabledInSettings) + if !aura.IsEnabledInSettings { + aura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) { + rogue.PoisonsActive[aura.Unit.UnitIndex]++ + }).ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) { + rogue.PoisonsActive[aura.Unit.UnitIndex]-- + }) + } } ///////////////////////////////////////////////////////////////////////////