-
Notifications
You must be signed in to change notification settings - Fork 32
/
hammer_of_wrath.go
78 lines (64 loc) · 2.04 KB
/
hammer_of_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
package paladin
import (
"time"
"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core"
)
func (paladin *Paladin) registerHammerOfWrath() {
ranks := []struct {
level int32
spellID int32
minDamage float64
maxDamage float64
manaCost float64
}{
{level: 44, spellID: 24275, manaCost: 295, minDamage: 316, maxDamage: 348},
{level: 52, spellID: 24274, manaCost: 360, minDamage: 412, maxDamage: 455},
{level: 60, spellID: 24239, manaCost: 425, minDamage: 504, maxDamage: 566},
}
cd := core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Second * 6,
}
hasImprovedHammerOfWrath := paladin.hasRune(proto.PaladinRune_RuneWristImprovedHammerOfWrath)
for i, rank := range ranks {
rank := rank
if paladin.Level < rank.level {
break
}
paladin.GetOrRegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: rank.spellID},
SpellSchool: core.SpellSchoolHoly,
DefenseType: core.DefenseTypeRanged,
ProcMask: core.ProcMaskRangedSpecial, // TODO to be tested
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
Rank: i + 1,
RequiredLevel: int(rank.level),
ManaCost: core.ManaCostOptions{
FlatCost: rank.manaCost,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
CastTime: core.TernaryDuration(hasImprovedHammerOfWrath, 0, time.Second),
},
IgnoreHaste: true,
CD: cd,
},
DamageMultiplier: 1,
ThreatMultiplier: 1,
BonusCoefficient: 0.429,
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return sim.IsExecutePhase20()
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
damage := sim.Roll(rank.minDamage, rank.maxDamage)
spell.CalcAndDealDamage(sim, target, damage, spell.OutcomeRangedHitAndCrit)
// should be based on target.CurrentHealthPercent(), which is not available
if hasImprovedHammerOfWrath && sim.CurrentTime >= time.Duration(0.9*float64(sim.Duration)) {
cd.Reset()
}
},
})
}
}