Skip to content

Commit

Permalink
fix timeworn strike, add ele 3pc
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Nov 17, 2024
1 parent d8fe2ec commit ce35b85
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 6 deletions.
71 changes: 65 additions & 6 deletions sim/common/sod/item_effects/phase_6.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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{
Expand Down Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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{
Expand All @@ -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,
Expand All @@ -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)
},
})
}
16 changes: 16 additions & 0 deletions sim/shaman/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
})
},
},
})
7 changes: 7 additions & 0 deletions sim/shaman/lava_burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions sim/shaman/shaman.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ type Shaman struct {
maelstromWeaponPPMM *core.PPMManager
powerSurgeProcChance float64
staticSHocksProcChance float64
useLavaBurstCritScaling bool
}

// Implemented by each Shaman spec.
Expand Down

0 comments on commit ce35b85

Please sign in to comment.