forked from genshinsim/gcsim
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcons.go
More file actions
197 lines (177 loc) · 4.01 KB
/
Copy pathcons.go
File metadata and controls
197 lines (177 loc) · 4.01 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
package skirk
import (
"github.com/genshinsim/gcsim/pkg/core/attacks"
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/player/character"
"github.com/genshinsim/gcsim/pkg/core/targets"
"github.com/genshinsim/gcsim/pkg/modifier"
)
var c4Atkp = []float64{0.0, 0.1, 0.2, 0.4}
const c2Key = "skirk-c2"
const c6Dur = 15 * 60
func (c *char) c1() {
if c.Base.Cons < 1 {
return
}
ai := combat.AttackInfo{
ActorIndex: c.Index,
Abil: "Far to Fall",
Mult: 5,
AttackTag: attacks.AttackTagExtra,
ICDTag: attacks.ICDTagSkirkCons,
ICDGroup: attacks.ICDGroupDefault,
StrikeType: attacks.StrikeTypeDefault,
Element: attributes.Cryo,
Durability: 25,
CanBeDefenseHalted: false,
}
ap := combat.NewBoxHitOnTarget(
c.Core.Combat.Player(),
nil,
4,
4,
)
// TODO: Attack Delay on C1?
c.Core.QueueAttack(ai, ap, 3, 3)
}
func (c *char) c2OnSkill() {
if c.Base.Cons < 2 {
return
}
c.AddSerpentsSubtlety(c.Base.Key.String()+"-c2", 10.0)
}
func (c *char) c2OnBurstRuin() float64 {
if c.Base.Cons < 2 {
return 0
}
return 10
}
func (c *char) c2Init() {
if c.Base.Cons < 2 {
return
}
c.c2Atk = make([]float64, attributes.EndStatType)
c.c2Atk[attributes.ATKP] = 0.7
}
func (c *char) c2OnBurstExtinction() {
if c.Base.Cons < 2 {
return
}
// delay buff to the end of burst. c1 hits from burst don't benefit from c2
c.QueueCharTask(func() {
c.AddStatMod(character.StatMod{
Base: modifier.NewBase(c2Key, 12.5*60),
AffectedStat: attributes.ATKP,
Amount: func() ([]float64, bool) {
if !c.StatusIsActive(skillKey) {
return nil, false
}
return c.c2Atk, true
},
})
}, 39)
}
func (c *char) c4Init() {
if c.Base.Cons < 4 {
return
}
m := make([]float64, attributes.EndStatType)
m[attributes.ATKP] = 0
c.AddStatMod(character.StatMod{
Base: modifier.NewBase("skirk-c4", -1),
AffectedStat: attributes.ATKP,
Amount: func() ([]float64, bool) {
m[attributes.ATKP] = c4Atkp[c.getA4Stacks()]
return m, true
},
})
}
func (c *char) c6OnVoidAbsorb() {
if c.Base.Cons < 6 {
return
}
c.c6Stacks.PushOverwrite(c.TimePassed)
}
func (c *char) c6OnBurstRuin() {
if c.Base.Cons < 6 {
return
}
ai := combat.AttackInfo{
ActorIndex: c.Index,
Abil: "Havoc: Sever (Burst)",
Mult: 7.5 * c.a4MultBurst(),
AttackTag: attacks.AttackTagElementalBurst,
ICDTag: attacks.ICDTagElementalBurst,
ICDGroup: attacks.ICDGroupDefault,
StrikeType: attacks.StrikeTypeDefault,
Element: attributes.Cryo,
Durability: 25,
}
ap := combat.NewCircleHitOnTarget(
c.Core.Combat.Player(),
nil,
5,
)
filter := func(src int) bool {
return src+c6Dur >= c.TimePassed
}
count := c.c6Stacks.Count(filter)
c.c6Stacks.Clear()
for range count {
// TODO: Record Attack Delay on C6?
c.Core.QueueAttack(ai, ap, 0.2*60, 0.2*60)
}
}
func (c *char) c6OnAttackCB() func(a combat.AttackCB) {
if c.Base.Cons < 6 {
return nil
}
switch c.NormalCounter {
case 2, 4:
default:
return nil
}
return func(a combat.AttackCB) {
if a.Target.Type() != targets.TargettableEnemy {
return
}
hasStack := false
for !c.c6Stacks.IsEmpty() {
src, _ := c.c6Stacks.Pop()
if src+c6Dur >= c.TimePassed {
hasStack = true
break
}
}
if !hasStack {
return
}
ai := combat.AttackInfo{
ActorIndex: c.Index,
Abil: "Havoc: Sever (Normal)",
Mult: 1.8 * c.a4MultAttack(),
AttackTag: attacks.AttackTagNormal,
ICDTag: attacks.ICDTagNormalAttack,
ICDGroup: attacks.ICDGroupDefault,
StrikeType: attacks.StrikeTypeSlash,
Element: attributes.Cryo,
Durability: 25,
}
ap := combat.NewCircleHitOnTarget(
c.Core.Combat.Player(),
nil,
5,
)
for i := 1; i <= 3; i++ {
c.Core.QueueAttack(ai, ap, i*3, i*3)
}
}
}
func (c *char) c6Init() {
if c.Base.Cons < 6 {
return
}
c.c6Stacks = NewRingQueue[int](3)
// TODO: OnCharacterHurt?
}