-
Notifications
You must be signed in to change notification settings - Fork 131
/
hemorrhage.go
107 lines (91 loc) · 3.1 KB
/
hemorrhage.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
97
98
99
100
101
102
103
104
105
106
107
package rogue
import (
"time"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
)
func (rogue *Rogue) registerHemorrhageSpell() {
if !rogue.Talents.Hemorrhage {
return
}
actionID := core.ActionID{SpellID: 48660}
var numPlayers int
for _, u := range rogue.Env.Raid.AllUnits {
if u.Type == core.PlayerUnit {
numPlayers++
}
}
var hemoAuras core.AuraArray
// Hemo debuff disabled except in raid sim
// in a raid environment each melee will get very little debuffs, which is hard to model
if numPlayers >= 2 {
bonusDamage := 75.0
if rogue.HasMajorGlyph(proto.RogueMajorGlyph_GlyphOfHemorrhage) {
bonusDamage *= 1.4
}
hemoAuras = rogue.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return target.GetOrRegisterAura(core.Aura{
Label: "Hemorrhage",
ActionID: actionID,
Duration: time.Second * 15,
MaxStacks: 10,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken += bonusDamage
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.PseudoStats.BonusPhysicalDamageTaken -= bonusDamage
},
OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.SpellSchool != core.SpellSchoolPhysical {
return
}
if !result.Landed() || result.Damage == 0 {
return
}
aura.RemoveStack(sim)
},
})
})
}
rogue.Hemorrhage = rogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | SpellFlagBuilder | SpellFlagColdBlooded | core.SpellFlagAPL,
EnergyCost: core.EnergyCostOptions{
Cost: rogue.costModifier(35 - float64(rogue.Talents.SlaughterFromTheShadows)),
Refund: 0.8,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
},
BonusCritRating: core.TernaryFloat64(rogue.HasSetBonus(Tier9, 4), 5*core.CritRatingPerCritChance, 0) +
[]float64{0, 2, 4, 6}[rogue.Talents.TurnTheTables]*core.CritRatingPerCritChance,
DamageMultiplier: core.TernaryFloat64(rogue.HasDagger(core.MainHand), 1.6, 1.1) * (1 +
0.02*float64(rogue.Talents.FindWeakness) +
core.TernaryFloat64(rogue.HasSetBonus(Tier6, 4), 0.06, 0)) *
(1 + 0.02*float64(rogue.Talents.SinisterCalling)),
CritMultiplier: rogue.MeleeCritMultiplier(true),
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
rogue.BreakStealth(sim)
baseDamage := 0 +
spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) +
spell.BonusWeaponDamage()
result := spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeWeaponSpecialHitAndCrit)
if result.Landed() {
rogue.AddComboPoints(sim, 1, spell.ComboPointMetrics())
if len(hemoAuras) > 0 {
hemoAura := hemoAuras.Get(target)
hemoAura.Activate(sim)
hemoAura.SetStacks(sim, 10)
}
} else {
spell.IssueRefund(sim)
}
},
})
}