-
Notifications
You must be signed in to change notification settings - Fork 133
/
unbreakable_armor.go
65 lines (55 loc) · 1.7 KB
/
unbreakable_armor.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
package deathknight
import (
"time"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)
func (dk *Deathknight) registerUnbreakableArmorSpell() {
if !dk.Talents.UnbreakableArmor {
return
}
actionID := core.ActionID{SpellID: 51271}
cdTimer := dk.NewTimer()
cd := time.Minute*1 - dk.thassariansPlateCooldownReduction(dk.UnbreakableArmor)
strDep := dk.NewDynamicMultiplyStat(stats.Strength, 1.2)
armorDep := dk.NewDynamicMultiplyStat(stats.Armor, core.TernaryFloat64(dk.HasMajorGlyph(proto.DeathknightMajorGlyph_GlyphOfUnbreakableArmor), 1.3, 1.25))
dk.UnbreakableArmorAura = dk.RegisterAura(core.Aura{
Label: "Unbreakable Armor",
ActionID: actionID,
Duration: time.Second * 20,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.EnableDynamicStatDep(sim, strDep)
aura.Unit.EnableDynamicStatDep(sim, armorDep)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.DisableDynamicStatDep(sim, strDep)
aura.Unit.DisableDynamicStatDep(sim, armorDep)
},
})
dk.UnbreakableArmor = dk.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagAPL,
RuneCost: core.RuneCostOptions{
FrostRuneCost: 1,
RunicPowerGain: 10,
},
Cast: core.CastConfig{
// No GCD
CD: core.Cooldown{
Timer: cdTimer,
Duration: cd,
},
IgnoreHaste: true,
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dk.UnbreakableArmorAura.Activate(sim)
},
})
if !dk.Inputs.IsDps {
dk.AddMajorCooldown(core.MajorCooldown{
Spell: dk.UnbreakableArmor,
Type: core.CooldownTypeSurvival,
})
}
}