-
Notifications
You must be signed in to change notification settings - Fork 32
/
divine_storm.go
62 lines (52 loc) · 1.9 KB
/
divine_storm.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
package paladin
import (
"time"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
)
// Divine Storm is a non-ap normalised instant attack that has a weapon damage % modifier with a 1.1 coefficient.
// It does this damage to up to 4 targets in range.
// DS also heals up to 3 party or raid members for 25% of the total damage caused. This has implications for prot
// paladin threat, so we'll implement this as a heal to the casting paladin for now.
func (paladin *Paladin) registerDivineStorm() {
if !paladin.hasRune(proto.PaladinRune_RuneChestDivineStorm) {
return
}
results := make([]*core.SpellResult, min(4, paladin.Env.GetNumTargets()))
healthMetrics := paladin.NewHealthMetrics(core.ActionID{SpellID: int32(proto.PaladinRune_RuneChestDivineStorm)})
paladin.RegisterSpell(core.SpellConfig{
ActionID: healthMetrics.ActionID,
SpellSchool: core.SpellSchoolPhysical,
DefenseType: core.DefenseTypeMelee,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
ManaCost: core.ManaCostOptions{
BaseCost: 0.12,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
IgnoreHaste: true,
CD: core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Second * 10,
},
},
DamageMultiplier: 1.1,
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
var totalDamageDealt float64
for idx := range results {
baseDamage := spell.Unit.MHWeaponDamage(sim, spell.MeleeAttackPower())
results[idx] = spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialHitAndCrit)
totalDamageDealt += results[idx].Damage
target = sim.Environment.NextTargetUnit(target)
}
for _, result := range results {
spell.DealDamage(sim, result)
}
paladin.GainHealth(sim, totalDamageDealt*0.25, healthMetrics)
},
})
}