-
Notifications
You must be signed in to change notification settings - Fork 29
/
exorcism.go
101 lines (81 loc) · 3.14 KB
/
exorcism.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
package paladin
import (
"time"
"github.com/wowsims/sod/sim/core/stats"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)
func (paladin *Paladin) registerExorcism() {
ranks := []struct {
level int32
spellID int32
manaCost float64
scaleLevel int32
minDamage float64
maxDamage float64
scale float64
}{
{level: 20, spellID: 415068, manaCost: 85, scaleLevel: 25, minDamage: 84, maxDamage: 96, scale: 1.2},
{level: 28, spellID: 415069, manaCost: 135, scaleLevel: 33, minDamage: 152, maxDamage: 172, scale: 1.6},
{level: 36, spellID: 415070, manaCost: 180, scaleLevel: 41, minDamage: 217, maxDamage: 245, scale: 2.0},
{level: 44, spellID: 415071, manaCost: 235, scaleLevel: 49, minDamage: 304, maxDamage: 342, scale: 2.4},
{level: 52, spellID: 415072, manaCost: 285, scaleLevel: 57, minDamage: 393, maxDamage: 439, scale: 2.8},
{level: 60, spellID: 415073, manaCost: 345, scaleLevel: 60, minDamage: 505, maxDamage: 563, scale: 3.2},
}
hasExorcist := paladin.hasRune(proto.PaladinRune_RuneLegsExorcist)
hasWrath := paladin.hasRune(proto.PaladinRune_RuneHeadWrath)
paladin.exorcismCooldown = &core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Second * 15,
}
if paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower) {
paladin.exorcismCooldown.Duration /= 2
}
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.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,
ManaCost: core.ManaCostOptions{
FlatCost: rank.manaCost,
Multiplier: core.TernaryFloat64(paladin.hasRune(proto.PaladinRune_RuneFeetTheArtOfWar), 0.2, 1.0),
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
CD: *paladin.exorcismCooldown,
},
BonusCritRating: paladin.holyCrit(),
DamageMultiplier: 1,
ThreatMultiplier: 1,
BonusCoefficient: 0.429,
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return hasExorcist || target.MobType == proto.MobType_MobTypeDemon || target.MobType == proto.MobType_MobTypeUndead
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(minDamage, maxDamage)
var bonusCrit float64
if hasExorcist && (target.MobType == proto.MobType_MobTypeDemon || target.MobType == proto.MobType_MobTypeUndead) {
bonusCrit += 100 * core.CritRatingPerCritChance
}
if hasWrath {
bonusCrit += paladin.GetStat(stats.MeleeCrit)
}
spell.BonusCritRating += bonusCrit
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
spell.BonusCritRating -= bonusCrit
},
})
}
}