-
Notifications
You must be signed in to change notification settings - Fork 133
/
mutilate.go
96 lines (81 loc) · 2.99 KB
/
mutilate.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
package rogue
import (
"time"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
)
var MutilateSpellID int32 = 48666
func (rogue *Rogue) newMutilateHitSpell(isMH bool) *core.Spell {
actionID := core.ActionID{SpellID: 48665}
procMask := core.ProcMaskMeleeMHSpecial
if !isMH {
actionID = core.ActionID{SpellID: 48664}
procMask = core.ProcMaskMeleeOHSpecial
}
return rogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: procMask,
Flags: core.SpellFlagMeleeMetrics | SpellFlagBuilder | SpellFlagColdBlooded,
BonusCritRating: core.TernaryFloat64(rogue.HasSetBonus(Tier9, 4), 5*core.CritRatingPerCritChance, 0) +
[]float64{0, 2, 4, 6}[rogue.Talents.TurnTheTables]*core.CritRatingPerCritChance +
5*core.CritRatingPerCritChance*float64(rogue.Talents.PuncturingWounds),
DamageMultiplierAdditive: 1 +
0.1*float64(rogue.Talents.Opportunity) +
0.02*float64(rogue.Talents.FindWeakness) +
core.TernaryFloat64(rogue.HasSetBonus(Tier6, 4), 0.06, 0),
DamageMultiplier: 1 *
core.TernaryFloat64(isMH, 1, rogue.dwsMultiplier()),
CritMultiplier: rogue.MeleeCritMultiplier(true),
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
var baseDamage float64
if isMH {
baseDamage = 181 + spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower())
} else {
baseDamage = 181 + spell.Unit.OHNormalizedWeaponDamage(sim, spell.MeleeAttackPower())
}
// TODO: Add support for all poison effects
if rogue.DeadlyPoison.Dot(target).IsActive() || rogue.woundPoisonDebuffAuras.Get(target).IsActive() {
baseDamage *= 1.2
}
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialCritOnly)
},
})
}
func (rogue *Rogue) registerMutilateSpell() {
if !rogue.Talents.Mutilate {
return
}
rogue.MutilateMH = rogue.newMutilateHitSpell(true)
rogue.MutilateOH = rogue.newMutilateHitSpell(false)
rogue.Mutilate = rogue.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: MutilateSpellID},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
EnergyCost: core.EnergyCostOptions{
Cost: rogue.costModifier(60 - core.TernaryFloat64(rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfMutilate), 5, 0)),
Refund: 0.8,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
},
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
rogue.BreakStealth(sim)
result := spell.CalcOutcome(sim, target, spell.OutcomeMeleeSpecialHit) // Miss/Dodge/Parry/Hit
if result.Landed() {
rogue.AddComboPoints(sim, 2, spell.ComboPointMetrics())
rogue.MutilateOH.Cast(sim, target)
rogue.MutilateMH.Cast(sim, target)
} else {
spell.IssueRefund(sim)
}
spell.DealOutcome(sim, result)
},
})
}