forked from wowsims/cata
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathsweeping_strikes.go
More file actions
104 lines (88 loc) · 3.28 KB
/
sweeping_strikes.go
File metadata and controls
104 lines (88 loc) · 3.28 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
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
102
103
104
package arms
import (
"time"
"github.com/wowsims/mop/sim/core"
"github.com/wowsims/mop/sim/warrior"
)
func (war *ArmsWarrior) registerSweepingStrikes() {
actionID := core.ActionID{SpellID: 1250616}
attackId := core.ActionID{SpellID: 12723}
normalizedId := core.ActionID{SpellID: 26654}
var copyDamage float64
hitSpell := war.RegisterSpell(core.SpellConfig{
ActionID: attackId,
ClassSpellMask: warrior.SpellMaskSweepingStrikesHit,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeSpecial,
Flags: core.SpellFlagIgnoreArmor | core.SpellFlagIgnoreModifiers | core.SpellFlagMeleeMetrics | core.SpellFlagPassiveSpell | core.SpellFlagNoOnCastComplete,
DamageMultiplier: 0.5,
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealDamage(sim, target, copyDamage, spell.OutcomeAlwaysHit)
},
})
war.SweepingStrikesNormalizedAttack = war.RegisterSpell(core.SpellConfig{
ActionID: normalizedId,
ClassSpellMask: warrior.SpellMaskSweepingStrikesNormalizedHit,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagPassiveSpell | core.SpellFlagNoOnCastComplete,
DamageMultiplier: 0.5,
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower())
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeAlwaysHit)
},
})
war.SweepingStrikesAura = core.BlockPrepull(war.MakeProcTriggerAura(core.ProcTrigger{
Name: "Sweeping Strikes",
ActionID: actionID,
MetricsActionID: actionID,
Duration: time.Second * 10,
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMelee,
Outcome: core.OutcomeLanded,
TriggerImmediately: true,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if war.Env.ActiveTargetCount() < 2 || result.PostArmorDamage <= 0 ||
spell.Matches(warrior.SpellMaskSweepingStrikesHit|
warrior.SpellMaskSweepingStrikesNormalizedHit|
warrior.SpellMaskSweepingSlam|
warrior.SpellMaskThunderClap|
warrior.SpellMaskWhirlwind|
warrior.SpellMaskCleave|
warrior.SpellMaskBladestormMH|
warrior.SpellMaskHeroicLeap|
warrior.SpellMaskShockwave|
warrior.SpellMaskDragonRoar) {
return
}
copyDamage = result.Damage
hitSpell.Cast(sim, war.Env.NextActiveTargetUnit(result.Target))
},
}))
spell := war.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
ClassSpellMask: warrior.SpellMaskSweepingStrikes,
RageCost: core.RageCostOptions{
Cost: 30,
},
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: war.NewTimer(),
Duration: time.Second * 10,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
war.SweepingStrikesAura.Activate(sim)
},
})
war.AddMajorCooldown(core.MajorCooldown{
Spell: spell,
Type: core.CooldownTypeDPS,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
return character.Env.ActiveTargetCount() > 1
},
})
}