-
Notifications
You must be signed in to change notification settings - Fork 89
/
aimed.go
81 lines (72 loc) · 2.26 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
package tartaglia
import (
"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"
"github.com/genshinsim/gcsim/pkg/core/glog"
)
var aimedFrames []int
const aimedHitmark = 86
func init() {
aimedFrames = frames.InitAbilSlice(94)
aimedFrames[action.ActionDash] = aimedHitmark
aimedFrames[action.ActionJump] = aimedHitmark
}
// Once fully charged, deal Hydro DMG and apply the Riptide status.
func (c *char) Aimed(p map[string]int) action.ActionInfo {
if c.StatusIsActive(MeleeKey) {
c.Core.Log.NewEvent("aim called when not in ranged stance", glog.LogActionEvent, c.Index).
Write("action", action.ActionAim)
return action.ActionInfo{
Frames: func(action.Action) int { return 1200 },
AnimationLength: 1200,
CanQueueAfter: 1200,
State: action.Idle,
}
}
travel, ok := p["travel"]
if !ok {
travel = 10
}
weakspot := p["weakspot"]
ai := combat.AttackInfo{
ActorIndex: c.Index,
Abil: "Aim (Charged)",
AttackTag: attacks.AttackTagExtra,
ICDTag: attacks.ICDTagNone,
ICDGroup: attacks.ICDGroupDefault,
StrikeType: attacks.StrikeTypePierce,
Element: attributes.Hydro,
Durability: 25,
Mult: aim[c.TalentLvlAttack()],
HitWeakPoint: weakspot == 1,
HitlagHaltFrames: 0.12 * 60, // deployable hitlag, but only on weakspot
HitlagFactor: 0.01,
HitlagOnHeadshotOnly: true,
IsDeployable: true,
}
c.Core.QueueAttack(
ai,
combat.NewBoxHit(
c.Core.Combat.Player(),
c.Core.Combat.PrimaryTarget(),
geometry.Point{Y: -0.5},
0.1,
1,
),
aimedHitmark,
aimedHitmark+travel,
// TODO: what's the ordering on these 2 callbacks?
c.rtFlashCallback, // call back for triggering slash
c.aimedApplyRiptide, // call back for applying riptide
)
return action.ActionInfo{
Frames: frames.NewAbilFunc(aimedFrames),
AnimationLength: aimedFrames[action.InvalidAction],
CanQueueAfter: aimedHitmark,
State: action.AimState,
}
}