@@ -16,8 +16,9 @@ import (
1616)
1717
1818const (
19- c4key = "mona-c4"
20- c6Key = "mona-c6"
19+ c2icdkey = "mona-c2-icd"
20+ c4key = "mona-c4"
21+ c6Key = "mona-c6"
2122)
2223
2324// C1:
@@ -78,34 +79,49 @@ func (c *char) c1() {
7879// C2:
7980// When a Normal Attack hits, there is a 20% chance that it will be automatically followed by a Charged Attack.
8081// This effect can only occur once every 5s.
81- func (c * char ) c2 (a info.AttackCB ) {
82- trg := a .Target
82+ func (c * char ) c2 () {
8383 if c .Base .Cons < 2 {
8484 return
8585 }
86- if a .Target .Type () != info .TargettableEnemy {
87- return
88- }
89- if c .Core .Rand .Float64 () > .2 {
90- return
91- }
92- if c .c2icd > c .Core .F {
93- return
94- }
95- c .c2icd = c .Core .F + 300 // every 5 seconds
96- ai := info.AttackInfo {
97- ActorIndex : c .Index (),
98- Abil : "Charge Attack" ,
99- AttackTag : attacks .AttackTagExtra ,
100- ICDTag : attacks .ICDTagNone ,
101- ICDGroup : attacks .ICDGroupDefault ,
102- StrikeType : attacks .StrikeTypeDefault ,
103- Element : attributes .Hydro ,
104- Durability : 25 ,
105- Mult : charge [c .TalentLvlAttack ()],
106- }
86+ c .Core .Events .Subscribe (event .OnEnemyDamage , func (args ... any ) bool {
87+ trg , ok := args [0 ].(* enemy.Enemy )
88+ if ! ok {
89+ return false
90+ }
10791
108- c .Core .QueueAttack (ai , combat .NewCircleHitOnTarget (trg , nil , 3 ), 0 , 0 )
92+ atk := args [1 ].(* info.AttackEvent )
93+ if atk .Info .ActorIndex != c .Index () {
94+ return false
95+ }
96+ if atk .Info .AttackTag != attacks .AttackTagNormal {
97+ return false
98+ }
99+
100+ if c .Core .Rand .Float64 () > .2 {
101+ return false
102+ }
103+ if c .StatusIsActive (c2icdkey ) {
104+ return false
105+ }
106+ c .AddStatus (c2icdkey , 5 * 60 , true )
107+
108+ c .QueueCharTask (func () {
109+ ai := info.AttackInfo {
110+ ActorIndex : c .Index (),
111+ Abil : "Charge Attack" ,
112+ AttackTag : attacks .AttackTagExtra ,
113+ ICDTag : attacks .ICDTagNone ,
114+ ICDGroup : attacks .ICDGroupDefault ,
115+ StrikeType : attacks .StrikeTypeDefault ,
116+ Element : attributes .Hydro ,
117+ Durability : 25 ,
118+ Mult : charge [c .TalentLvlAttack ()],
119+ }
120+ c .Core .QueueAttack (ai , combat .NewCircleHitOnTarget (trg , nil , 3 ), 0 , 0 )
121+ }, .7 * 60 )
122+
123+ return false
124+ }, "mona-c2-followup" )
109125}
110126
111127// C4:
0 commit comments