-
Notifications
You must be signed in to change notification settings - Fork 29
/
runes.go
131 lines (114 loc) · 3.78 KB
/
runes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package paladin
import (
"time"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
)
func (paladin *Paladin) ApplyRunes() {
if paladin.hasRune(proto.PaladinRune_RuneWaistEnlightenedJudgements) {
paladin.AddStat(stats.SpellHit, 17*core.SpellHitRatingPerHitChance)
}
paladin.registerTheArtOfWar()
paladin.registerSheathOfLight()
paladin.registerGuardedByTheLight()
// "RuneHeadFanaticism" is handled in Exorcism, Holy Shock, SoC, and SoR
// "RuneHeadWrath" is handled in Exorcism, Holy Shock, Consecration (and Holy Wrath once implemented)
paladin.registerHammerOfTheRighteous()
// "RuneWristImprovedHammerOfWrath" is handled Hammer of Wrath
// "RuneWristPurifyingPower" is handled in Exorcism
}
func (paladin *Paladin) fanaticism() float64 {
return core.TernaryFloat64(paladin.hasRune(proto.PaladinRune_RuneHeadFanaticism), 18, 0) * core.SpellCritRatingPerCritChance
}
func (paladin *Paladin) registerTheArtOfWar() {
if !paladin.hasRune(proto.PaladinRune_RuneFeetTheArtOfWar) {
return
}
paladin.RegisterAura(core.Aura{
Label: "The Art of War",
Duration: core.NeverExpires,
ActionID: core.ActionID{SpellID: 426157},
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.ProcMask.Matches(core.ProcMaskMelee) || !result.Outcome.Matches(core.OutcomeCrit) {
return
}
paladin.holyShockCooldown.Reset()
paladin.exorcismCooldown.Reset()
},
})
}
func (paladin *Paladin) registerSheathOfLight() {
if !paladin.hasRune(proto.PaladinRune_RuneWaistSheathOfLight) {
return
}
dep := paladin.NewDynamicStatDependency(
stats.AttackPower, stats.SpellPower, 0.3,
)
sheathAura := paladin.RegisterAura(core.Aura{
Label: "Sheath of Light",
Duration: time.Second * 60,
ActionID: core.ActionID{SpellID: 426159},
OnGain: func(aura *core.Aura, sim *core.Simulation) {
paladin.EnableDynamicStatDep(sim, dep)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
paladin.DisableDynamicStatDep(sim, dep)
},
})
paladin.RegisterAura(core.Aura{
Label: "Sheath of Light (rune)",
Duration: core.NeverExpires,
ActionID: core.ActionID{SpellID: 426158},
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.ProcMask.Matches(core.ProcMaskWhiteHit) {
return
}
sheathAura.Activate(sim)
},
})
}
func (paladin *Paladin) registerGuardedByTheLight() {
if !paladin.hasRune(proto.PaladinRune_RuneFeetGuardedByTheLight) {
return
}
actionID := core.ActionID{SpellID: 415058}
manaMetrics := paladin.NewManaMetrics(actionID)
var manaPA *core.PendingAction
guardedAura := paladin.RegisterAura(core.Aura{
Label: "Guarded by the Light",
Duration: time.Second*15 + 1,
ActionID: actionID,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
manaPA = core.StartPeriodicAction(sim, core.PeriodicActionOptions{
Period: time.Second * 3,
OnAction: func(sim *core.Simulation) {
paladin.AddMana(sim, 0.05*paladin.MaxMana(), manaMetrics)
},
})
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
manaPA.Cancel(sim)
},
})
paladin.RegisterAura(core.Aura{
Label: "Guarded by the Light (rune)",
Duration: core.NeverExpires,
ActionID: core.ActionID{SpellID: 415755},
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.ProcMask.Matches(core.ProcMaskWhiteHit) {
return
}
guardedAura.Activate(sim)
},
})
}