-
Notifications
You must be signed in to change notification settings - Fork 32
/
holy_wrath.go
98 lines (79 loc) · 2.56 KB
/
holy_wrath.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
package paladin
import (
"time"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
"github.com/wowsims/sod/sim/core"
)
func (paladin *Paladin) registerHolyWrath() {
ranks := []struct {
level int32
spellID int32
manaCost float64
scaleLevel int32
minDamage float64
maxDamage float64
scale float64
}{
{level: 50, spellID: 2812, manaCost: 645, scaleLevel: 54, minDamage: 362, maxDamage: 428, scale: 1.6},
{level: 60, spellID: 10318, manaCost: 805, scaleLevel: 60, minDamage: 490, maxDamage: 576, scale: 1.9},
}
cd := core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Second * 60,
}
hasPurifyingPower := paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower)
hasWrath := paladin.hasRune(proto.PaladinRune_RuneHeadWrath)
if hasPurifyingPower {
cd.Duration /= 2
}
var results []*core.SpellResult
for i, rank := range ranks {
rank := rank
if paladin.Level < rank.level {
break
}
minDamage := rank.minDamage + float64(min(paladin.Level, rank.scaleLevel)-rank.level)*rank.scale
maxDamage := rank.maxDamage + float64(min(paladin.Level, rank.scaleLevel)-rank.level)*rank.scale
paladin.GetOrRegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: rank.spellID},
SpellSchool: core.SpellSchoolHoly,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage, // TODO to be tested
Flags: core.SpellFlagAPL,
RequiredLevel: int(rank.level),
Rank: i + 1,
ManaCost: core.ManaCostOptions{
FlatCost: rank.manaCost,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
CastTime: time.Second * 2,
},
IgnoreHaste: true,
CD: cd,
},
BonusCritRating: paladin.holyCrit(),
DamageMultiplier: 1,
ThreatMultiplier: 1,
BonusCoefficient: 0.19,
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
bonusCrit := core.TernaryFloat64(hasWrath, paladin.GetStat(stats.MeleeCrit), 0)
spell.BonusCritRating += bonusCrit
results = results[:0]
for _, target := range paladin.Env.Encounter.TargetUnits {
if hasPurifyingPower || (target.MobType == proto.MobType_MobTypeDemon || target.MobType == proto.MobType_MobTypeUndead) {
damage := sim.Roll(minDamage, maxDamage)
result := spell.CalcDamage(sim, target, damage, spell.OutcomeMagicHitAndCrit)
results = append(results, result)
}
}
for _, result := range results {
spell.DealDamage(sim, result)
}
spell.BonusCritRating -= bonusCrit
},
})
}
}