Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maelstrom Weapon #713

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sim/shaman/chain_heal.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (shaman *Shaman) newChainHealSpellConfig(rank int, isOverload bool) core.Sp
manaCost := ChainHealManaCost[rank]
level := ChainHealLevel[rank]

flags := core.SpellFlagHelpful
flags := core.SpellFlagHelpful | SpellFlagMaelstrom
if !isOverload {
flags |= core.SpellFlagAPL
}
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/electric_spell.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (

// Shared precomputation logic for LB and CL.
func (shaman *Shaman) newElectricSpellConfig(actionID core.ActionID, baseCost float64, baseCastTime time.Duration, isOverload bool) core.SpellConfig {
flags := SpellFlagElectric | SpellFlagFocusable
flags := SpellFlagElectric | SpellFlagFocusable | SpellFlagMaelstrom
if !isOverload {
flags |= core.SpellFlagAPL
}
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/healing_wave.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (shaman *Shaman) newHealingWaveSpellConfig(rank int, isOverload bool) core.
manaCost := HealingWaveManaCost[rank]
level := HealingWaveLevel[rank]

flags := core.SpellFlagHelpful
flags := core.SpellFlagHelpful | SpellFlagMaelstrom
if !isOverload {
flags |= core.SpellFlagAPL
}
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/lava_burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (shaman *Shaman) newLavaBurstSpellConfig(isOverload bool) core.SpellConfig
cooldown := time.Second * 8
manaCost := .10

flags := SpellFlagFocusable
flags := SpellFlagFocusable | SpellFlagMaelstrom
if !isOverload {
flags |= core.SpellFlagAPL
}
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/lesser_healing_wave.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (shaman *Shaman) newLesserHealingWaveSpellConfig(rank int) core.SpellConfig
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellHealing,
Flags: core.SpellFlagHelpful | core.SpellFlagAPL,
Flags: core.SpellFlagHelpful | SpellFlagMaelstrom | core.SpellFlagAPL,

RequiredLevel: level,
Rank: rank,
Expand Down
48 changes: 15 additions & 33 deletions sim/shaman/runes.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,49 +213,31 @@ func (shaman *Shaman) applyMaelstromWeapon() {
return
}

buffSpellId := 408505
buffDuration := time.Second * 30

ppm := core.TernaryFloat64(shaman.GetCharacter().Consumes.MainHandImbue == proto.WeaponImbue_WindfuryWeapon, 15, 10)

var affectedSpells []*core.Spell
var affectedSpellCodes = []int32{
SpellCode_ShamanLightningBolt,
SpellCode_ShamanChainLightning,
SpellCode_ShamanLavaBurst,
SpellCode_ShamanHealingWave,
SpellCode_ShamanLesserHealingWave,
SpellCode_ShamanChainHeal,
}
shaman.OnSpellRegistered(func(spell *core.Spell) {
if spell.Flags.Matches(SpellFlagMaelstrom) {
affectedSpells = append(affectedSpells, spell)
}
})

shaman.MaelstromWeaponAura = shaman.RegisterAura(core.Aura{
Label: "MaelstromWeapon Proc",
ActionID: core.ActionID{SpellID: int32(buffSpellId)},
Duration: buffDuration,
ActionID: core.ActionID{SpellID: 408505},
Duration: time.Second * 30,
MaxStacks: 5,
OnInit: func(aura *core.Aura, sim *core.Simulation) {
affectedSpells = core.FilterSlice(
core.Flatten([][]*core.Spell{
shaman.LightningBolt,
shaman.ChainLightning,
{shaman.LavaBurst},
shaman.HealingWave,
shaman.LesserHealingWave,
shaman.ChainHeal,
}), func(spell *core.Spell) bool { return spell != nil },
)
},
OnStacksChange: func(aura *core.Aura, sim *core.Simulation, oldStacks int32, newStacks int32) {
multDiff := 0.2 * float64(newStacks-oldStacks)
core.Each(affectedSpells, func(spell *core.Spell) { spell.CastTimeMultiplier -= multDiff })
core.Each(affectedSpells, func(spell *core.Spell) { spell.CostMultiplier -= multDiff })
for _, spell := range affectedSpells {
spell.CastTimeMultiplier -= multDiff
spell.CostMultiplier -= multDiff
}
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !slices.Contains(affectedSpellCodes, spell.SpellCode) {
return
if spell.Flags.Matches(SpellFlagMaelstrom) {
shaman.MaelstromWeaponAura.Deactivate(sim)
}

shaman.MaelstromWeaponAura.Deactivate(sim)
},
})

Expand Down Expand Up @@ -288,7 +270,7 @@ func (shaman *Shaman) applyPowerSurge() {
return
}

// TODO: Figure out how this actually works becaue the 2024-02-27 tuning notes make it sound like
// TODO: Figure out how this actually works because the 2024-02-27 tuning notes make it sound like
// this is not just a fully passive stat boost
shaman.AddStat(stats.MP5, shaman.GetStat(stats.Intellect)*.15)

Expand Down Expand Up @@ -337,7 +319,7 @@ func (shaman *Shaman) applyWayOfEarth() {
}

// Way of Earth only activates if you have Rockbiter Weapon on your mainhand and a shield in your offhand
if shaman.Consumes.MainHandImbue != proto.WeaponImbue_RockbiterWeapon && (shaman.OffHand() == nil || shaman.OffHand().WeaponType != proto.WeaponType_WeaponTypeShield) {
if shaman.Consumes.MainHandImbue != proto.WeaponImbue_RockbiterWeapon || shaman.OffHand().WeaponType != proto.WeaponType_WeaponTypeShield {
return
}

Expand Down
1 change: 1 addition & 0 deletions sim/shaman/shaman.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
SpellFlagElectric = core.SpellFlagAgentReserved1
SpellFlagTotem = core.SpellFlagAgentReserved2
SpellFlagFocusable = core.SpellFlagAgentReserved3
SpellFlagMaelstrom = core.SpellFlagAgentReserved4
)

func NewShaman(character *core.Character, talents string, selfBuffs SelfBuffs) *Shaman {
Expand Down
Loading