-
Notifications
You must be signed in to change notification settings - Fork 88
/
aimed.go
137 lines (119 loc) · 3.47 KB
/
aimed.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
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
package yoimiya
import (
"fmt"
"github.com/genshinsim/gcsim/internal/frames"
"github.com/genshinsim/gcsim/pkg/core/action"
"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/geometry"
)
var aimedFrames [][]int
var aimedHitmarks = []int{86, 103, 121, 139}
func init() {
aimedFrames = make([][]int, 4)
// Normal CA
aimedFrames[0] = frames.InitAbilSlice(97)
aimedFrames[0][action.ActionDash] = aimedHitmarks[0]
aimedFrames[0][action.ActionJump] = aimedHitmarks[0]
// CA - 1 Kindling Arrow
aimedFrames[1] = frames.InitAbilSlice(114)
aimedFrames[1][action.ActionDash] = aimedHitmarks[1]
aimedFrames[1][action.ActionJump] = aimedHitmarks[1]
// CA - 2 Kindling Arrows
aimedFrames[2] = frames.InitAbilSlice(132)
aimedFrames[2][action.ActionDash] = aimedHitmarks[2]
aimedFrames[2][action.ActionJump] = aimedHitmarks[2]
// CA - 3 Kindling Arrows
aimedFrames[3] = frames.InitAbilSlice(150)
aimedFrames[3][action.ActionDash] = aimedHitmarks[3]
aimedFrames[3][action.ActionJump] = aimedHitmarks[3]
}
// Standard aimed attack
func (c *char) Aimed(p map[string]int) action.ActionInfo {
travel, ok := p["travel"]
if !ok {
travel = 10
}
weakspot := p["weakspot"]
// determines what CA gets executed
kindling, ok := p["kindling"]
if !ok || kindling < 0 {
kindling = 0
}
if kindling > 3 {
kindling = 3
}
// used to adjust how long it takes for the kindling arrows to hit starting from CA arrow release
kindling_travel, ok := p["kindling_travel"]
if !ok {
kindling_travel = 30
}
// Normal Arrow
ai := combat.AttackInfo{
ActorIndex: c.Index,
Abil: "Aimed Shot",
AttackTag: attacks.AttackTagExtra,
ICDTag: attacks.ICDTagNone,
ICDGroup: attacks.ICDGroupDefault,
StrikeType: attacks.StrikeTypePierce,
Element: attributes.Pyro,
Durability: 25,
Mult: aim[c.TalentLvlAttack()],
HitWeakPoint: weakspot == 1,
HitlagHaltFrames: 0.12 * 60,
HitlagFactor: 0.01,
HitlagOnHeadshotOnly: true,
IsDeployable: true,
}
c2CB := c.makeC2CB()
c.Core.QueueAttack(
ai,
combat.NewBoxHit(
c.Core.Combat.Player(),
c.Core.Combat.PrimaryTarget(),
geometry.Point{Y: -0.5},
0.1,
1,
),
aimedHitmarks[kindling],
aimedHitmarks[kindling]+travel,
c2CB,
)
// Kindling Arrows
if kindling > 0 {
ai.ICDTag = attacks.ICDTagExtraAttack
ai.Mult = aimExtra[c.TalentLvlAttack()]
// TODO:
// Kindling Arrows can hit weakspots to proc stuff like Prototype Crescent, but they don't always crit
// current assumption is that they never hit a weakspot
ai.HitWeakPoint = false
// no hitlag
ai.HitlagHaltFrames = 0
ai.HitlagFactor = 0.01
ai.HitlagOnHeadshotOnly = false
ai.IsDeployable = false
for i := 1; i <= kindling; i++ {
ai.Abil = fmt.Sprintf("Kindling Arrow %v", i)
// add a bit of extra delay for kindling arrows
c.Core.QueueAttack(
ai,
combat.NewCircleHit(
c.Core.Combat.Player(),
c.Core.Combat.PrimaryTarget(),
nil,
0.6,
),
aimedHitmarks[kindling],
aimedHitmarks[kindling]+kindling_travel,
c2CB,
)
}
}
return action.ActionInfo{
Frames: frames.NewAbilFunc(aimedFrames[kindling]),
AnimationLength: aimedFrames[kindling][action.InvalidAction],
CanQueueAfter: aimedHitmarks[kindling],
State: action.AimState,
}
}