-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy patheidolon.go
More file actions
60 lines (54 loc) · 1.33 KB
/
eidolon.go
File metadata and controls
60 lines (54 loc) · 1.33 KB
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
package tingyun
import (
"github.com/simimpact/srsim/pkg/engine/event"
"github.com/simimpact/srsim/pkg/engine/info"
"github.com/simimpact/srsim/pkg/engine/modifier"
"github.com/simimpact/srsim/pkg/engine/prop"
"github.com/simimpact/srsim/pkg/key"
"github.com/simimpact/srsim/pkg/model"
)
const (
E1 = "tingyun-e1"
E2 = "tingyun-e2"
)
func init() {
modifier.Register(E1, modifier.Config{
StatusType: model.StatusType_STATUS_BUFF,
Stacking: modifier.ReplaceBySource,
CanDispel: true,
TickMoment: modifier.ModifierPhase1End,
})
}
func doE1OnUlt(mod *modifier.Instance, e event.ActionEnd) {
st := mod.State().(*skillState)
// bypass
if st.tingEidolon < 1 {
return
}
if e.AttackType == model.AttackType_ULT {
mod.Engine().AddModifier(mod.Owner(), info.Modifier{
Name: E1,
Source: mod.Source(),
Stats: info.PropMap{prop.SPDPercent: 0.2},
})
}
}
func doE2(mod *modifier.Instance, target key.TargetID) {
st := mod.State().(*skillState)
// bypass
if st.tingEidolon < 2 || st.e2flag {
return
}
mod.Engine().ModifyEnergy(info.ModifyAttribute{
Key: E2,
Target: mod.Owner(),
Source: mod.Source(),
Amount: 5.0,
})
st.e2flag = true
}
// not fully correct, this should trigger with OnAllowAction instead of OnPhase1
func removeE2CD(mod *modifier.Instance) {
st := mod.State().(*skillState)
st.e2flag = false
}