-
Notifications
You must be signed in to change notification settings - Fork 133
/
obliterate.go
96 lines (81 loc) · 3.16 KB
/
obliterate.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 deathknight
import (
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
)
// TODO: Cleanup obliterate the same way we did for plague strike
var ObliterateActionID = core.ActionID{SpellID: 51425}
func (dk *Deathknight) newObliterateHitSpell(isMH bool) *core.Spell {
bonusBaseDamage := dk.sigilOfAwarenessBonus()
diseaseMulti := dk.dkDiseaseMultiplier(0.125)
diseaseConsumptionChance := []float64{1.0, 0.67, 0.34, 0.0}[dk.Talents.Annihilation]
deathConvertChance := float64(dk.Talents.DeathRuneMastery) / 3
conf := core.SpellConfig{
ActionID: ObliterateActionID.WithTag(core.TernaryInt32(isMH, 1, 2)),
SpellSchool: core.SpellSchoolPhysical,
ProcMask: dk.threatOfThassarianProcMask(isMH),
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
RuneCost: core.RuneCostOptions{
FrostRuneCost: 1,
UnholyRuneCost: 1,
RunicPowerGain: 15 + 2.5*float64(dk.Talents.ChillOfTheGrave) + dk.scourgeborneBattlegearRunicPowerBonus(),
Refundable: true,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
IgnoreHaste: true,
},
BonusCritRating: (dk.rimeCritBonus() + dk.subversionCritBonus() + dk.annihilationCritBonus() + dk.scourgeborneBattlegearCritBonus()) * core.CritRatingPerCritChance,
DamageMultiplier: .8 *
core.TernaryFloat64(isMH, 1, dk.nervesOfColdSteelBonus()) *
core.TernaryFloat64(dk.HasMajorGlyph(proto.DeathknightMajorGlyph_GlyphOfObliterate), 1.25, 1.0) *
dk.scourgelordsBattlegearDamageBonus(ScourgelordBonusSpellOB),
CritMultiplier: dk.bonusCritMultiplier(dk.Talents.GuileOfGorefiend),
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
var baseDamage float64
if isMH {
baseDamage = 584 +
bonusBaseDamage +
spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) +
spell.BonusWeaponDamage()
} else {
// SpellID 66974
baseDamage = 292 +
bonusBaseDamage +
spell.Unit.OHNormalizedWeaponDamage(sim, spell.MeleeAttackPower()) +
spell.BonusWeaponDamage()
}
baseDamage *= dk.RoRTSBonus(target) *
(1.0 + dk.dkCountActiveDiseases(target)*diseaseMulti) *
dk.mercilessCombatBonus(sim)
result := spell.CalcDamage(sim, target, baseDamage, dk.threatOfThassarianOutcomeApplier(spell))
if isMH {
spell.SpendRefundableCostAndConvertFrostOrUnholyRune(sim, result, deathConvertChance)
dk.threatOfThassarianProc(sim, result, dk.ObliterateOhHit)
if sim.RandomFloat("Annihilation") < diseaseConsumptionChance {
dk.FrostFeverSpell.Dot(target).Deactivate(sim)
dk.BloodPlagueSpell.Dot(target).Deactivate(sim)
}
if sim.RandomFloat("Rime") < dk.rimeHbChanceProc() {
dk.FreezingFogAura.Activate(sim)
}
}
spell.DealDamage(sim, result)
},
}
if !isMH {
conf.RuneCost = core.RuneCostOptions{}
conf.Cast = core.CastConfig{}
} else {
conf.Flags |= core.SpellFlagAPL
}
return dk.RegisterSpell(conf)
}
func (dk *Deathknight) registerObliterateSpell() {
dk.ObliterateMhHit = dk.newObliterateHitSpell(true)
dk.ObliterateOhHit = dk.newObliterateHitSpell(false)
dk.Obliterate = dk.ObliterateMhHit
}