From ce35b858652766908cafe179c53c89ac47db6a78 Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Sun, 17 Nov 2024 03:28:46 -0500 Subject: [PATCH] fix timeworn strike, add ele 3pc --- sim/common/sod/item_effects/phase_6.go | 71 +++++++++++++++++++++++--- sim/shaman/item_sets_pve.go | 16 ++++++ sim/shaman/lava_burst.go | 7 +++ sim/shaman/shaman.go | 1 + 4 files changed, 89 insertions(+), 6 deletions(-) diff --git a/sim/common/sod/item_effects/phase_6.go b/sim/common/sod/item_effects/phase_6.go index 4d249ea11e..602e9a9610 100644 --- a/sim/common/sod/item_effects/phase_6.go +++ b/sim/common/sod/item_effects/phase_6.go @@ -109,6 +109,10 @@ func init() { // Increases the damage dealt by all of your damage over time spells by 2% per piece of Timeworn armor equipped. func TimewornDecayAura(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + multiplier := 1 + 0.02*float64(character.PseudoStats.TimewornBonus) character.OnSpellRegistered(func(spell *core.Spell) { @@ -122,6 +126,10 @@ func TimewornDecayAura(agent core.Agent) { // Reduces the chance for your attacks to be dodged or parried by 1% per piece of Timeworn armor equipped. func TimeswornExpertiseAura(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + stats := stats.Stats{stats.Expertise: float64(character.PseudoStats.TimewornBonus) * core.ExpertiseRatingPerExpertiseChance} core.MakePermanent(character.GetOrRegisterAura(core.Aura{ @@ -149,6 +157,10 @@ func TimeswornExpertiseAura(agent core.Agent) { // Increases the effectiveness of your healing and shielding spells by 2% per piece of Timeworn armor equipped. func TimewornHealing(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + healShieldMultiplier := 1 + 0.02*float64(character.PseudoStats.TimewornBonus) core.MakePermanent(character.GetOrRegisterAura(core.Aura{ @@ -169,6 +181,10 @@ func TimewornHealing(agent core.Agent) { // Increases the effectiveness of your Fire damage spells by 3% per piece of Timeworn armor equipped. func TimeswornPyromancyAura(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + fireMultiplier := 1 + 0.03*float64(character.PseudoStats.TimewornBonus) core.MakePermanent(character.GetOrRegisterAura(core.Aura{ @@ -187,6 +203,10 @@ func TimeswornPyromancyAura(agent core.Agent) { // Increases the casting speed of your spells by 2% per piece of Timeworn armor equipped. func TimeswornSpellAura(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + castSpeedMultiplier := 1 / (1 - 0.02*float64(character.PseudoStats.TimewornBonus)) core.MakePermanent(character.GetOrRegisterAura(core.Aura{ @@ -206,14 +226,18 @@ func TimeswornSpellAura(agent core.Agent) { // (100ms cooldown) func TimeswornStrikeAura(agent core.Agent) { character := agent.GetCharacter() + if character.PseudoStats.TimewornBonus == 0 { + return + } + procChance := float64(character.PseudoStats.TimewornBonus) * 0.01 - timeStrikeSpell := character.RegisterSpell(core.SpellConfig{ + timeStrikeMelee := character.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 1213381}, SpellSchool: core.SpellSchoolPhysical, DefenseType: core.DefenseTypeMelee, ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagNoOnCastComplete, + Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell, BonusCoefficient: 1, DamageMultiplier: 1, @@ -225,16 +249,51 @@ func TimeswornStrikeAura(agent core.Agent) { }, }) + timestrikeRanged := character.RegisterSpell(core.SpellConfig{ + ActionID: core.ActionID{SpellID: 1213381}, + SpellSchool: core.SpellSchoolPhysical, + DefenseType: core.DefenseTypeMelee, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell, + // TODO: Copied from Chimera Shot + MissileSpeed: 24, + + BonusCoefficient: 1, + DamageMultiplier: 1, + ThreatMultiplier: 1, + + ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { + // TODO: Missing the hunter Ammo damage bonus. We need to be able to store it on the character instead of the hunter + baseDamage := character.AutoAttacks.Ranged().CalculateNormalizedWeaponDamage(sim, spell.RangedAttackPower(target, false)) + result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeRangedHitAndCrit) + + spell.WaitTravelTime(sim, func(s *core.Simulation) { + spell.DealDamage(sim, result) + }) + }, + }) + + core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{ + Name: "Timeworn Strike Aura Melee", + Callback: core.CallbackOnSpellHitDealt, + Outcome: core.OutcomeLanded, + ProcMask: core.ProcMaskMeleeWhiteHit, + ProcChance: procChance, + ICD: time.Millisecond * 100, + Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { + timeStrikeMelee.Cast(sim, result.Target) + }, + }) + core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{ - Name: "Timeworn Strike Aura", - ActionID: core.ActionID{SpellID: 468782}, + Name: "Timeworn Strike Aura Ranged", Callback: core.CallbackOnSpellHitDealt, Outcome: core.OutcomeLanded, - ProcMask: core.ProcMaskWhiteHit, + ProcMask: core.ProcMaskRangedAuto, ProcChance: procChance, ICD: time.Millisecond * 100, Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - timeStrikeSpell.Cast(sim, result.Target) + timestrikeRanged.Cast(sim, result.Target) }, }) } diff --git a/sim/shaman/item_sets_pve.go b/sim/shaman/item_sets_pve.go index 7c852d75b1..ede9947470 100644 --- a/sim/shaman/item_sets_pve.go +++ b/sim/shaman/item_sets_pve.go @@ -782,3 +782,19 @@ var ItemSetStormcallersImpact = core.NewItemSet(core.ItemSet{ }, }, }) + +var ItemSetGiftOfTheGatheringStorm = core.NewItemSet(core.ItemSet{ + Name: "Gift of the Gathering Storm", + Bonuses: map[int32]core.ApplyEffect{ + // Your Lava Burst deals increased damage equal to its critical strike chance. + 3: func(agent core.Agent) { + shaman := agent.(ShamanAgent).GetShaman() + shaman.RegisterAura(core.Aura{ + Label: "S03 - Item - RAQ - Shaman - Elemental 3P Bonus", + OnInit: func(aura *core.Aura, sim *core.Simulation) { + shaman.useLavaBurstCritScaling = true + }, + }) + }, + }, +}) diff --git a/sim/shaman/lava_burst.go b/sim/shaman/lava_burst.go index fbbf2036c0..7626c9d26f 100644 --- a/sim/shaman/lava_burst.go +++ b/sim/shaman/lava_burst.go @@ -5,6 +5,7 @@ import ( "github.com/wowsims/sod/sim/core" "github.com/wowsims/sod/sim/core/proto" + "github.com/wowsims/sod/sim/core/stats" ) func (shaman *Shaman) registerLavaBurstSpell() { @@ -83,7 +84,13 @@ func (shaman *Shaman) newLavaBurstSpellConfig(isOverload bool) core.SpellConfig ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { baseDamage := sim.Roll(baseDamageLow, baseDamageHigh) + damageMultiplier := 1.0 + if shaman.useLavaBurstCritScaling { + damageMultiplier *= 1 + shaman.GetStat(stats.SpellCrit)*core.SpellCritRatingPerCritChance/100 + } + spell.DamageMultiplier *= damageMultiplier result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) + spell.DamageMultiplier /= damageMultiplier spell.WaitTravelTime(sim, func(sim *core.Simulation) { spell.DealDamage(sim, result) diff --git a/sim/shaman/shaman.go b/sim/shaman/shaman.go index a4265744a6..c85f78c86f 100644 --- a/sim/shaman/shaman.go +++ b/sim/shaman/shaman.go @@ -176,6 +176,7 @@ type Shaman struct { maelstromWeaponPPMM *core.PPMManager powerSurgeProcChance float64 staticSHocksProcChance float64 + useLavaBurstCritScaling bool } // Implemented by each Shaman spec.