Skip to content

Commit 4433c02

Browse files
committed
initial commit
temp 2
1 parent 3647a07 commit 4433c02

7 files changed

Lines changed: 304 additions & 22 deletions

File tree

internal/characters/venti/aimed.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ func (c *char) Aimed(p map[string]int) (action.Info, error) {
7979
aimedHitmarks[hold],
8080
aimedHitmarks[hold]+travel,
8181
)
82-
if c.Base.Cons >= 1 {
83-
c.c1(ai, aimedHitmarks[hold], travel)
84-
}
82+
83+
c.c1(ai, aimedHitmarks[hold], travel)
8584

8685
return action.Info{
8786
Frames: frames.NewAbilFunc(aimedFrames[hold]),

internal/characters/venti/asc.go

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
package venti
22

3-
import "github.com/genshinsim/gcsim/pkg/core/attributes"
3+
import (
4+
"github.com/genshinsim/gcsim/pkg/core/action"
5+
"github.com/genshinsim/gcsim/pkg/core/attributes"
6+
"github.com/genshinsim/gcsim/pkg/core/event"
7+
"github.com/genshinsim/gcsim/pkg/core/info"
8+
"github.com/genshinsim/gcsim/pkg/core/player/character"
9+
"github.com/genshinsim/gcsim/pkg/modifier"
10+
)
11+
12+
const (
13+
hexAttackCBICDKey = "venti-hexerei-attack-cb-icd"
14+
)
415

516
// A1 is not implemented and will likely never be implemented:
617
// Holding Skyward Sonnet creates an upcurrent that lasts for 20s.
@@ -20,3 +31,75 @@ func (c *char) a4() {
2031
}
2132
}
2233
}
34+
35+
func (c *char) hexInit() {
36+
if !c.IsHexerei {
37+
return
38+
}
39+
if c.Core.Player.GetHexereiCount() < 2 {
40+
return
41+
}
42+
43+
m := make([]float64, attributes.EndStatType)
44+
m[attributes.DmgP] = 0.5
45+
46+
onSwirlBuff := func(args ...any) {
47+
if !c.StatusIsActive(burstKey) {
48+
return
49+
}
50+
51+
atk := args[1].(*info.AttackEvent)
52+
char := c.Core.Player.ByIndex(atk.Info.ActorIndex)
53+
54+
if atk.Info.ActorIndex != c.Core.Player.Active() {
55+
return
56+
}
57+
58+
char.AddAttackMod(character.AttackMod{
59+
Base: modifier.NewBaseWithHitlag("venti-hexerei-dmg", 4*60),
60+
Amount: func(_ *info.AttackEvent, _ info.Target) []float64 {
61+
return m
62+
},
63+
})
64+
65+
c.burstHexMult = 1.35
66+
c.burstHexSrc = c.Core.F
67+
68+
resetHexMult := func(src int) func() {
69+
return func() {
70+
if c.burstHexSrc != src {
71+
return
72+
}
73+
c.burstHexMult = 1
74+
}
75+
}
76+
77+
char.QueueCharTask(resetHexMult(c.Core.F), 4*60)
78+
}
79+
80+
c.Core.Events.Subscribe(event.OnSwirlPyro, onSwirlBuff, "venti-hexerei-on-swirl-pyro")
81+
c.Core.Events.Subscribe(event.OnSwirlHydro, onSwirlBuff, "venti-hexerei-on-swirl-hydro")
82+
c.Core.Events.Subscribe(event.OnSwirlElectro, onSwirlBuff, "venti-hexerei-on-swirl-electro")
83+
c.Core.Events.Subscribe(event.OnSwirlCryo, onSwirlBuff, "venti-hexerei-on-swirl-cryo")
84+
}
85+
86+
func (c *char) hexAttackCB(_ info.AttackCB) {
87+
if !c.IsHexerei {
88+
return
89+
}
90+
if c.Core.Player.GetHexereiCount() < 2 {
91+
return
92+
}
93+
if !c.StatusIsActive(burstKey) {
94+
return
95+
}
96+
if c.StatusIsActive(hexAttackCBICDKey) {
97+
return
98+
}
99+
100+
c.AddStatus(hexAttackCBICDKey, 0.1*60, true)
101+
102+
c.ReduceActionCooldown(action.ActionBurst, -0.5*60)
103+
104+
c.ExtendStatus(burstKey, 1*60)
105+
}

internal/characters/venti/attack.go

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,44 @@ func (c *char) Attack(p map[string]int) (action.Info, error) {
4848

4949
for i, mult := range attack[c.NormalCounter] {
5050
ai.Mult = mult[c.TalentLvlAttack()]
51-
c.Core.QueueAttack(
52-
ai,
53-
combat.NewBoxHit(
51+
52+
if c.IsHexerei && c.Core.Player.GetHexereiCount() > 1 && c.StatusIsActive(burstKey) {
53+
deltaPos := c.Core.Combat.Player().Pos().Sub(c.Core.Combat.PrimaryTarget().Pos())
54+
dist := deltaPos.Magnitude()
55+
56+
ai.Element = attributes.Anemo
57+
58+
ap := combat.NewBoxHit(
5459
c.Core.Combat.Player(),
5560
c.Core.Combat.PrimaryTarget(),
56-
info.Point{Y: -0.5},
61+
info.Point{Y: -dist},
5762
0.1,
58-
1,
59-
),
60-
attackHitmarks[c.NormalCounter][i],
61-
attackHitmarks[c.NormalCounter][i]+travel,
62-
)
63+
15,
64+
)
65+
66+
c.Core.QueueAttack(
67+
ai,
68+
ap,
69+
attackHitmarks[c.NormalCounter][i],
70+
attackHitmarks[c.NormalCounter][i]+travel,
71+
c.hexAttackCB,
72+
)
73+
74+
c.c1(ai, attackHitmarks[c.NormalCounter][i], travel)
75+
} else {
76+
c.Core.QueueAttack(
77+
ai,
78+
combat.NewBoxHit(
79+
c.Core.Combat.Player(),
80+
c.Core.Combat.PrimaryTarget(),
81+
info.Point{Y: -0.5},
82+
0.1,
83+
1,
84+
),
85+
attackHitmarks[c.NormalCounter][i],
86+
attackHitmarks[c.NormalCounter][i]+travel,
87+
)
88+
}
6389
}
6490

6591
defer c.AdvanceNormalIndex()

internal/characters/venti/burst.go

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import (
1111

1212
var burstFrames []int
1313

14-
const burstStart = 94
14+
const (
15+
burstStart = 94
16+
burstKey = "venti-stromeye"
17+
)
1518

1619
func init() {
1720
burstFrames = frames.InitAbilSlice(95) // Q -> N1/CA/E/D
@@ -36,7 +39,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
3639
StrikeType: attacks.StrikeTypeDefault,
3740
Element: attributes.Anemo,
3841
Durability: 25,
39-
Mult: burstDot[c.TalentLvlBurst()],
42+
Mult: burstDot[c.TalentLvlBurst()] * c.burstHexMult,
4043
}
4144
ap := combat.NewCircleHitOnTarget(c.qPos, nil, 4)
4245

@@ -45,6 +48,12 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
4548
c.aiAbsorb.Mult = burstAbsorbDot[c.TalentLvlBurst()]
4649
c.aiAbsorb.Element = attributes.NoElement
4750

51+
c.AddStatus(burstKey, 8*60+81, true)
52+
c.burstSrc = c.Core.F
53+
54+
c.c2SkillBuffInit()
55+
c.c4Hexerei()
56+
4857
// snapshot is around cd frame and 1st tick?
4958
var snap info.Snapshot
5059
c.Core.Tasks.Add(func() {
@@ -58,11 +67,22 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
5867
}
5968

6069
// starts at 106 with 24f interval between ticks. 20 total
61-
for i := range 20 {
70+
for i := range 19 {
6271
c.Core.Tasks.Add(func() {
6372
c.Core.QueueAttackWithSnap(ai, snap, ap, 0, cb)
6473
}, 106+24*i)
6574
}
75+
var prolongBurst func()
76+
77+
prolongBurst = func() {
78+
c.Core.QueueAttackWithSnap(ai, snap, ap, 0, cb)
79+
if !c.StatusIsActive(burstKey) {
80+
return
81+
}
82+
c.Core.Tasks.Add(prolongBurst, 24)
83+
}
84+
85+
c.Core.Tasks.Add(prolongBurst, 106+24*20)
6686
// Infusion usually occurs after 4 ticks of anemo according to KQM library
6787
c.Core.Tasks.Add(c.absorbCheckQ(c.Core.F, 0, int((480-24*4)/18)), 106+24*3)
6888

0 commit comments

Comments
 (0)