-
Notifications
You must be signed in to change notification settings - Fork 32
/
holy_shock.go
96 lines (76 loc) · 2.68 KB
/
holy_shock.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
package paladin
import (
"github.com/wowsims/sod/sim/core/stats"
"time"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)
func (paladin *Paladin) registerHolyShock() {
paladin.holyShockCooldown = &core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Second * 15,
}
if !paladin.Talents.HolyShock {
return
}
ranks := []struct {
level int32
spellID int32
manaCost float64
minDamage float64
maxDamage float64
}{
{level: 40, spellID: 20473, manaCost: 225, minDamage: 204, maxDamage: 220},
{level: 48, spellID: 20929, manaCost: 275, minDamage: 279, maxDamage: 301},
{level: 56, spellID: 20930, manaCost: 325, minDamage: 365, maxDamage: 395},
}
hasInfusionOfLight := paladin.hasRune(proto.PaladinRune_RuneWaistInfusionOfLight)
damageMultiplier := core.TernaryFloat64(hasInfusionOfLight, 1.2, 1.0)
hasArtOfWar := paladin.hasRune(proto.PaladinRune_RuneFeetTheArtOfWar)
manaCostMultiplier := core.TernaryFloat64(hasArtOfWar, 0.2, 1.0)
hasWrath := paladin.hasRune(proto.PaladinRune_RuneHeadWrath)
manaMetrics := paladin.NewManaMetrics(core.ActionID{SpellID: 437063}) // Infusion of Light mana restore
for i, rank := range ranks {
rank := rank
if paladin.Level < rank.level {
break
}
paladin.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: rank.spellID},
SpellSchool: core.SpellSchoolHoly,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
RequiredLevel: int(rank.level),
Rank: i + 1,
SpellCode: SpellCode_PaladinHolyShock,
ManaCost: core.ManaCostOptions{
FlatCost: rank.manaCost,
Multiplier: manaCostMultiplier,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
CD: *paladin.holyShockCooldown,
},
BonusCritRating: paladin.holyCrit(),
DamageMultiplier: damageMultiplier,
ThreatMultiplier: 1,
BonusCoefficient: 0.429,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(rank.minDamage, rank.maxDamage)
bonusCrit := core.TernaryFloat64(hasWrath, paladin.GetStat(stats.MeleeCrit), 0)
spell.BonusCritRating += bonusCrit
result := spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
spell.BonusCritRating -= bonusCrit
// If we crit, Infusion of Light refunds base mana cost and resets Holy Shock/Exorcism.
if hasInfusionOfLight && result.Outcome.Matches(core.OutcomeCrit) {
paladin.AddMana(sim, rank.manaCost, manaMetrics)
paladin.holyShockCooldown.Reset()
paladin.exorcismCooldown.Reset()
}
},
})
}
}