Skip to content

Commit 341e259

Browse files
committed
[Paladin] Move mana regen outside of build phase auras
1 parent f3ca8b8 commit 341e259

4 files changed

Lines changed: 41 additions & 33 deletions

File tree

sim/core/sim.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -608,20 +608,18 @@ func (sim *Simulation) AddPendingAction(pa *PendingAction) {
608608
// panic(fmt.Sprintf("Cant add action in the past: %s", pa.NextActionAt))
609609
//}
610610
pa.consumed = false
611-
if len(sim.pendingActions) > 0 {
612-
for index, v := range sim.pendingActions[1:] {
613-
if v.NextActionAt < pa.NextActionAt || (v.NextActionAt == pa.NextActionAt && v.Priority >= pa.Priority) {
614-
//if sim.Log != nil {
615-
// sim.Log("Adding action at index %d for time %s", index - len(sim.pendingActions), pa.NextActionAt)
616-
// for i := index; i < len(sim.pendingActions); i++ {
617-
// sim.Log("Upcoming action at %s", sim.pendingActions[i].NextActionAt)
618-
// }
619-
//}
620-
sim.pendingActions = append(sim.pendingActions, pa)
621-
copy(sim.pendingActions[index+2:], sim.pendingActions[index+1:])
622-
sim.pendingActions[index+1] = pa
623-
return
624-
}
611+
for index, v := range sim.pendingActions[1:] {
612+
if v.NextActionAt < pa.NextActionAt || (v.NextActionAt == pa.NextActionAt && v.Priority >= pa.Priority) {
613+
//if sim.Log != nil {
614+
// sim.Log("Adding action at index %d for time %s", index - len(sim.pendingActions), pa.NextActionAt)
615+
// for i := index; i < len(sim.pendingActions); i++ {
616+
// sim.Log("Upcoming action at %s", sim.pendingActions[i].NextActionAt)
617+
// }
618+
//}
619+
sim.pendingActions = append(sim.pendingActions, pa)
620+
copy(sim.pendingActions[index+2:], sim.pendingActions[index+1:])
621+
sim.pendingActions[index+1] = pa
622+
return
625623
}
626624
}
627625
//if sim.Log != nil {

sim/paladin/protection/_protection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var DefaultOptions = &proto.Player_ProtectionPaladin{
8888
ProtectionPaladin: &proto.ProtectionPaladin{
8989
Options: &proto.ProtectionPaladin_Options{
9090
ClassOptions: &proto.PaladinOptions{
91-
Seal: proto.PaladinSeal_Truth,
91+
Seal: proto.PaladinSeal_Insight,
9292
},
9393
},
9494
},

sim/paladin/protection/guarded_by_the_light.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Grants 15% of your maximum mana every 2 sec.
2121
*/
2222
func (prot *ProtectionPaladin) registerGuardedByTheLight() {
2323
actionID := core.ActionID{SpellID: 53592}
24-
manaMetrics := prot.NewManaMetrics(actionID)
2524

2625
oldGetSpellPowerValue := prot.GetSpellPowerValue
2726
newGetSpellPowerValue := func(spell *core.Spell) float64 {
@@ -34,14 +33,6 @@ func (prot *ProtectionPaladin) registerGuardedByTheLight() {
3433
BuildPhase: core.CharacterBuildPhaseTalents,
3534

3635
OnGain: func(aura *core.Aura, sim *core.Simulation) {
37-
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
38-
Period: time.Second * 2,
39-
Priority: core.ActionPriorityRegen,
40-
OnAction: func(*core.Simulation) {
41-
prot.AddMana(sim, 0.15*prot.MaxMana(), manaMetrics)
42-
},
43-
})
44-
4536
prot.GetSpellPowerValue = newGetSpellPowerValue
4637
},
4738
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
@@ -66,4 +57,18 @@ func (prot *ProtectionPaladin) registerGuardedByTheLight() {
6657
ClassMask: paladin.SpellMaskJudgment,
6758
IntValue: -40,
6859
})
60+
61+
manaMetrics := prot.NewManaMetrics(actionID)
62+
core.MakePermanent(prot.RegisterAura(core.Aura{
63+
Label: "Guarded by the Light Mana Regen" + prot.Label,
64+
OnGain: func(aura *core.Aura, sim *core.Simulation) {
65+
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
66+
Period: time.Second * 2,
67+
Priority: core.ActionPriorityRegen,
68+
OnAction: func(*core.Simulation) {
69+
prot.AddMana(sim, 0.15*prot.MaxMana(), manaMetrics)
70+
},
71+
})
72+
},
73+
}))
6974
}

sim/paladin/retribution/sword_of_light.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Increases the healing done by Word of Glory by 60% and Flash of Light by 100%.
2020
*/
2121
func (ret *RetributionPaladin) registerSwordOfLight() {
2222
actionID := core.ActionID{SpellID: 53503}
23-
manaMetrics := ret.NewManaMetrics(actionID)
2423
swordOfLightHpActionID := core.ActionID{SpellID: 141459}
2524
ret.CanTriggerHolyAvengerHpGain(swordOfLightHpActionID)
2625

@@ -43,14 +42,6 @@ func (ret *RetributionPaladin) registerSwordOfLight() {
4342
}
4443
},
4544
OnGain: func(aura *core.Aura, sim *core.Simulation) {
46-
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
47-
Period: time.Second * 2,
48-
Priority: core.ActionPriorityRegen,
49-
OnAction: func(*core.Simulation) {
50-
ret.AddMana(sim, 0.06*ret.MaxMana(), manaMetrics)
51-
},
52-
})
53-
5445
ret.GetSpellPowerValue = newGetSpellPowerValue
5546
},
5647
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
@@ -90,6 +81,20 @@ func (ret *RetributionPaladin) registerSwordOfLight() {
9081
TimeValue: time.Minute * -1,
9182
})
9283

84+
manaMetrics := ret.NewManaMetrics(actionID)
85+
core.MakePermanent(ret.RegisterAura(core.Aura{
86+
Label: "Sword of Light Mana Regen" + ret.Label,
87+
OnGain: func(aura *core.Aura, sim *core.Simulation) {
88+
core.StartPeriodicAction(sim, core.PeriodicActionOptions{
89+
Period: time.Second * 2,
90+
Priority: core.ActionPriorityRegen,
91+
OnAction: func(*core.Simulation) {
92+
ret.AddMana(sim, 0.06*ret.MaxMana(), manaMetrics)
93+
},
94+
})
95+
},
96+
}))
97+
9398
holyTwoHandDamageMod := ret.AddDynamicMod(core.SpellModConfig{
9499
Kind: core.SpellMod_DamageDone_Pct,
95100
ClassMask: paladin.SpellMaskDamageModifiedBySwordOfLight,

0 commit comments

Comments
 (0)