@@ -209,13 +209,9 @@ pub unsafe fn check_guard_attack_special_hi(
209
209
false . into ( )
210
210
}
211
211
212
- pub unsafe fn check_escape_oos ( fighter : & mut L2CFighterCommon ) -> L2CValue {
212
+ pub unsafe fn check_cstick_escape_oos ( fighter : & mut L2CFighterCommon ) -> L2CValue {
213
213
let boma = fighter. module_accessor ;
214
214
215
- if fighter. check_guard_hold ( ) . get_bool ( ) {
216
- return false . into ( ) ;
217
- }
218
-
219
215
let c_stick_override = fighter. is_button_on ( Buttons :: CStickOverride ) ;
220
216
let c_stick_on = dbg ! (
221
217
!VarModule :: is_flag(
@@ -238,22 +234,54 @@ pub unsafe fn check_escape_oos(fighter: &mut L2CFighterCommon) -> L2CValue {
238
234
let escapes = [
239
235
(
240
236
* FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE ,
241
- // checks if Cat2::StickEscape, or CStickOn and stick is vertical and below zero
242
- fighter. is_cat_flag ( Cat2 :: StickEscape ) || ( c_stick_on && stick_vertical) ,
237
+ c_stick_on && stick_vertical,
238
+ * FIGHTER_STATUS_KIND_ESCAPE ,
239
+ ) ,
240
+ (
241
+ * FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_F ,
242
+ c_stick_on && !stick_vertical && sub_stick_x >= 0.0 ,
243
+ * FIGHTER_STATUS_KIND_ESCAPE_F ,
244
+ ) ,
245
+ (
246
+ * FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_B ,
247
+ c_stick_on && !stick_vertical && sub_stick_x < 0.0 ,
248
+ * FIGHTER_STATUS_KIND_ESCAPE_B ,
249
+ ) ,
250
+ ] ;
251
+
252
+ for ( term, condition, status) in escapes. iter ( ) {
253
+ if WorkModule :: is_enable_transition_term ( boma, * term) && * condition {
254
+ // NOTE: DO NOT TOUCH
255
+ // We must pass `false` to `change_status` so that the game does not clear our buffer/pad flag.
256
+ // When it is done via `change_status`, the game will regenerate them the next time `sub_shift_status_main` is called.
257
+ fighter. change_status ( ( * status) . into ( ) , false . into ( ) ) ;
258
+ // We then must pass `true` to `clear_command` so that game "forgets" that we cleared our buffer
259
+ // and will not regenerate our pad flags
260
+ ControlModule :: clear_command ( fighter. module_accessor , true ) ;
261
+ return true . into ( ) ;
262
+ }
263
+ }
264
+
265
+ return false . into ( ) ;
266
+ }
267
+
268
+ pub unsafe fn check_escape_oos ( fighter : & mut L2CFighterCommon ) -> L2CValue {
269
+ let boma = fighter. module_accessor ;
270
+
271
+ let escapes = [
272
+ (
273
+ * FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE ,
274
+ fighter. is_cat_flag ( Cat2 :: StickEscape ) ,
243
275
* FIGHTER_STATUS_KIND_ESCAPE ,
244
276
) ,
245
277
(
246
278
* FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_F ,
247
- // checks if Cat2::StickEscape, or CStickOn and stick is horizontal and above zero
248
- fighter. is_cat_flag ( Cat2 :: StickEscapeF ) ||
249
- ( c_stick_on && !stick_vertical && sub_stick_x >= 0.0 ) ,
279
+ fighter. is_cat_flag ( Cat2 :: StickEscapeF ) ,
250
280
* FIGHTER_STATUS_KIND_ESCAPE_F ,
251
281
) ,
252
282
(
253
283
* FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ESCAPE_B ,
254
- // checks if Cat2::StickEscape, or CStickOn and stick is horizontal and above zero
255
- fighter. is_cat_flag ( Cat2 :: StickEscapeB ) ||
256
- ( c_stick_on && !stick_vertical && sub_stick_x < 0.0 ) ,
284
+ fighter. is_cat_flag ( Cat2 :: StickEscapeB ) ,
257
285
* FIGHTER_STATUS_KIND_ESCAPE_B ,
258
286
) ,
259
287
] ;
@@ -398,8 +426,10 @@ pub unsafe fn sub_guard_cont(fighter: &mut L2CFighterCommon) -> L2CValue {
398
426
return true . into ( ) ;
399
427
}
400
428
401
- if check_escape_oos ( fighter) . get_bool ( ) {
402
- return true . into ( ) ;
429
+ if !guard_hold {
430
+ if check_escape_oos ( fighter) . get_bool ( ) || check_cstick_escape_oos ( fighter) . get_bool ( ) {
431
+ return true . into ( ) ;
432
+ }
403
433
}
404
434
405
435
if ItemModule :: is_have_item ( fighter. module_accessor , 0 ) {
0 commit comments