11package 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+ }
0 commit comments