forked from wowsims/cata
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathtouch_of_death.go
More file actions
56 lines (47 loc) · 1.68 KB
/
touch_of_death.go
File metadata and controls
56 lines (47 loc) · 1.68 KB
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
package monk
import (
"time"
"github.com/wowsims/mop/sim/core"
"github.com/wowsims/mop/sim/core/proto"
)
func (monk *Monk) registerTouchOfDeath() {
hasGlyph := monk.HasMajorGlyph(proto.MonkMajorGlyph_GlyphOfTouchOfDeath)
actionID := core.ActionID{SpellID: 115080}
chiMetrics := monk.NewChiMetrics(actionID)
cooldown := time.Second*90 + core.TernaryDuration(hasGlyph, 2*time.Minute, 0)
chiCost := int32(3)
monk.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagCannotBeDodged | core.SpellFlagIgnoreArmor | core.SpellFlagIgnoreModifiers | SpellFlagSpender | core.SpellFlagAPL,
ClassSpellMask: MonkSpellTouchOfDeath,
MaxRange: core.MaxMeleeRange,
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
CD: core.Cooldown{
Timer: monk.NewTimer(),
Duration: cooldown,
},
},
DamageMultiplier: 1,
ThreatMultiplier: 1,
CritMultiplier: monk.DefaultCritMultiplier(),
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return (hasGlyph || monk.GetChi() >= 3) && sim.GetRemainingDuration() <= time.Second*1
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.RollWithLabel(0, spell.Unit.MaxHealth(), "Touch Of Death Damage")
result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialNoBlockDodgeParryNoCrit)
if result.Landed() {
spell.DealDamage(sim, result)
if !hasGlyph {
monk.SpendChi(sim, chiCost, chiCost, chiMetrics)
}
}
},
})
}