-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathfiresmith.go
More file actions
76 lines (69 loc) · 1.93 KB
/
firesmith.go
File metadata and controls
76 lines (69 loc) · 1.93 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package firesmith
import (
"github.com/simimpact/srsim/pkg/engine"
"github.com/simimpact/srsim/pkg/engine/equip/relic"
"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 (
check = "firesmith-of-lava-forging"
buff = "firesmith-of-lava-forging-buff"
)
// 2pc: Increases Fire DMG by 10%.
// 4pc: Increases the wearer's Skill DMG by 12%.
// After unleashing Ultimate, increases the wearer's Fire DMG by 12% for the next attack.
func init() {
relic.Register(key.FiresmithOfLavaForging, relic.Config{
Effects: []relic.SetEffect{
{
MinCount: 2,
Stats: info.PropMap{prop.FireDamagePercent: 0.1},
CreateEffect: nil,
},
{
MinCount: 4,
Stats: nil,
CreateEffect: func(engine engine.Engine, owner key.TargetID) {
engine.AddModifier(owner, info.Modifier{
Name: check,
Source: owner,
})
},
},
},
})
modifier.Register(check, modifier.Config{
Listeners: modifier.Listeners{
OnBeforeHitAll: onBeforeHitAll,
OnAfterAction: onAfterUltimate,
},
})
modifier.Register(buff, modifier.Config{
StatusType: model.StatusType_STATUS_BUFF,
CanDispel: true,
Listeners: modifier.Listeners{
OnAfterAttack: removeBuff,
},
})
}
func onBeforeHitAll(mod *modifier.Instance, e event.HitStart) {
if e.Hit.AttackType == model.AttackType_SKILL {
e.Hit.Attacker.AddProperty(check, prop.AllDamagePercent, 0.12)
}
}
func onAfterUltimate(mod *modifier.Instance, e event.ActionEnd) {
if e.AttackType == model.AttackType_ULT {
mod.Engine().AddModifier(mod.Owner(), info.Modifier{
Name: buff,
Source: mod.Owner(),
Stats: info.PropMap{prop.FireDamagePercent: 0.12},
})
}
}
func removeBuff(mod *modifier.Instance, e event.AttackEnd) {
mod.RemoveSelf()
}