forked from wowsims/cata
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path_focus_magic.go
More file actions
34 lines (28 loc) · 832 Bytes
/
_focus_magic.go
File metadata and controls
34 lines (28 loc) · 832 Bytes
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
package mage
import (
"time"
"github.com/wowsims/mop/sim/core"
)
func (mage *Mage) applyFocusMagic() {
if !mage.Talents.FocusMagic {
return
}
// This is used only for the individual sim.
if mage.Party.Raid.Size() == 1 {
if mage.ArcaneOptions.FocusMagicPercentUptime > 0 {
selfAura, _ := core.FocusMagicAura(&mage.Unit, nil)
core.ApplyFixedUptimeAura(selfAura, float64(mage.ArcaneOptions.FocusMagicPercentUptime)/100, time.Second*10, 1)
}
return
}
focusMagicTarget := mage.GetUnit(mage.ArcaneOptions.FocusMagicTarget)
if focusMagicTarget == nil {
return
} else if focusMagicTarget == &mage.Unit {
// When self is selected, give permanent self buff.
selfAura, _ := core.FocusMagicAura(&mage.Unit, nil)
core.MakePermanent(selfAura)
return
}
core.FocusMagicAura(&mage.Unit, focusMagicTarget)
}