forked from wowsims/wotlk
-
Notifications
You must be signed in to change notification settings - Fork 2
/
power_infusion.go
54 lines (45 loc) · 1.48 KB
/
power_infusion.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
package priest
import (
"time"
"github.com/Tereneckla/wotlk/sim/core"
)
func (priest *Priest) registerPowerInfusionCD() {
if !priest.Talents.PowerInfusion {
return
}
actionID := core.ActionID{SpellID: 10060, Tag: priest.Index}
powerInfusionTarget := priest.GetUnit(priest.SelfBuffs.PowerInfusionTarget)
if powerInfusionTarget == nil {
return
}
powerInfusionAura := core.PowerInfusionAura(powerInfusionTarget, actionID.Tag)
piSpell := priest.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagHelpful,
ManaCost: core.ManaCostOptions{
BaseCost: 0.16,
},
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: priest.NewTimer(),
Duration: time.Duration(float64(core.PowerInfusionCD) * (1 - .1*float64(priest.Talents.Aspiration))),
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
powerInfusionAura.Activate(sim)
},
})
priest.AddMajorCooldown(core.MajorCooldown{
Spell: piSpell,
Priority: core.CooldownPriorityBloodlust,
Type: core.CooldownTypeMana,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
// How can we determine the target will be able to continue casting
// for the next 15s at 20% reduced mana cost? Arbitrary value until then.
//if powerInfusionTarget.CurrentMana() < 3000 {
// return false
//}
return !powerInfusionTarget.HasActiveAuraWithTag(core.BloodlustAuraTag)
},
})
}