1
+ use super :: * ;
2
+ use globals:: * ;
3
+ use utils:: consts:: vars:: edge;
4
+
5
+ #[ status_script( agent = "edge" , status = FIGHTER_STATUS_KIND_SPECIAL_N , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN ) ]
6
+ unsafe fn special_n_main ( fighter : & mut L2CFighterCommon ) -> L2CValue {
7
+ fighter. sub_change_motion_by_situation ( Hash40 :: new ( "special_n_start" ) . into ( ) , Hash40 :: new ( "special_air_n_start" ) . into ( ) , false . into ( ) ) ;
8
+ fighter. sub_set_special_start_common_kinetic_setting ( hash40 ( "param_special_n" ) . into ( ) ) ;
9
+ special_hi_set_kinetics ( fighter, true ) ;
10
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_EDGE_SPECIAL_N_NONE , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND ) ;
11
+ WorkModule :: off_flag ( fighter. module_accessor , * FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT ) ;
12
+ WorkModule :: set_int ( fighter. module_accessor , -1 , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
13
+ WorkModule :: enable_transition_term ( fighter. module_accessor , * FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_GUARD ) ;
14
+ WorkModule :: enable_transition_term ( fighter. module_accessor , * FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_JUMP ) ;
15
+ WorkModule :: enable_transition_term ( fighter. module_accessor , * FIGHTER_STATUS_TRANSITION_GROUP_CHK_AIR_ESCAPE ) ;
16
+ ControlModule :: set_add_jump_mini_button_life ( fighter. module_accessor , 8 ) ;
17
+ fighter. main_shift ( special_n_main_loop)
18
+ }
19
+
20
+ unsafe extern "C" fn special_n_main_loop ( fighter : & mut L2CFighterCommon ) -> L2CValue {
21
+ if !StatusModule :: is_changing ( fighter. module_accessor ) {
22
+ fighter. sub_change_motion_by_situation ( Hash40 :: new ( "special_n_start" ) . into ( ) , Hash40 :: new ( "special_air_n_start" ) . into ( ) , true . into ( ) ) ;
23
+ fighter. sub_exec_special_start_common_kinetic_setting ( hash40 ( "param_special_n" ) . into ( ) ) ;
24
+ special_hi_set_kinetics ( fighter, false ) ;
25
+ }
26
+ if ControlModule :: check_button_off ( fighter. module_accessor , * CONTROL_PAD_BUTTON_SPECIAL ) {
27
+ WorkModule :: on_flag ( fighter. module_accessor , * FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT ) ;
28
+ }
29
+ if WorkModule :: is_flag ( fighter. module_accessor , * FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT ) {
30
+ if WorkModule :: get_int ( fighter. module_accessor , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND ) != * FIGHTER_EDGE_SPECIAL_N_NONE {
31
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_SHOOT . into ( ) , false . into ( ) ) ;
32
+ return 0 . into ( )
33
+ }
34
+ }
35
+ if MotionModule :: is_end ( fighter. module_accessor ) {
36
+ let status = if fighter. is_situation ( * SITUATION_KIND_GROUND ) { * FIGHTER_STATUS_KIND_WAIT } else { * FIGHTER_STATUS_KIND_FALL } ;
37
+ fighter. change_status ( status. into ( ) , false . into ( ) ) ;
38
+ }
39
+ let cancel_start_frame = WorkModule :: get_param_int ( fighter. module_accessor , hash40 ( "param_special_n" ) , hash40 ( "cancel_start_frame" ) ) ;
40
+ if cancel_start_frame > fighter. status_frame ( ) {
41
+ if fighter. is_situation ( * SITUATION_KIND_AIR ) {
42
+ let mut speed_y = KineticModule :: get_sum_speed_y ( fighter. module_accessor , * KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN ) ;
43
+ let unk1 = WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "param_special_n" ) , 0x18ecc76f9d ) ;
44
+ if unk1 < speed_y {
45
+ speed_y = unk1;
46
+ }
47
+ sv_kinetic_energy ! ( set_speed, fighter, FIGHTER_KINETIC_ENERGY_ID_GRAVITY , speed_y) ;
48
+ }
49
+ }
50
+ else {
51
+ if fighter. sub_check_command_guard ( ) . get_bool ( ) {
52
+ if fighter. is_situation ( * SITUATION_KIND_GROUND ) {
53
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_GUARD_ON , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
54
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , false . into ( ) ) ;
55
+ return 1 . into ( )
56
+ }
57
+ else {
58
+ if !WorkModule :: is_flag ( fighter. module_accessor , * FIGHTER_INSTANCE_WORK_ID_FLAG_DISABLE_ESCAPE_AIR ) {
59
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_ESCAPE_AIR , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
60
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , false . into ( ) ) ;
61
+ return 1 . into ( )
62
+ }
63
+ }
64
+ }
65
+ else {
66
+ if fighter. is_situation ( * SITUATION_KIND_AIR ) {
67
+ if fighter. sub_check_jump_in_charging ( ) . get_bool ( ) {
68
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_JUMP_AERIAL , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
69
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , true . into ( ) ) ;
70
+ }
71
+ }
72
+ else {
73
+ if ( fighter. is_cat_flag ( Cat1 :: JumpButton ) || ( ControlModule :: is_enable_flick_jump ( fighter. module_accessor ) && fighter. is_cat_flag ( Cat1 :: Jump ) && fighter. sub_check_button_frick ( ) . get_bool ( ) ) ) {
74
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_JUMP_SQUAT , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
75
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , true . into ( ) ) ;
76
+ }
77
+ else {
78
+ if fighter. is_cat_flag ( Cat2 :: StickEscapeF ) {
79
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_ESCAPE_F , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
80
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , true . into ( ) ) ;
81
+ }
82
+ else if fighter. is_cat_flag ( Cat2 :: StickEscapeB ) {
83
+ WorkModule :: set_int ( fighter. module_accessor , * FIGHTER_STATUS_KIND_ESCAPE_B , * FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS ) ;
84
+ fighter. change_status ( FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL . into ( ) , true . into ( ) ) ;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ return 0 . into ( )
92
+ }
93
+
94
+ unsafe extern "C" fn special_hi_set_kinetics ( fighter : & mut L2CFighterCommon , param_1 : bool ) {
95
+ if fighter. is_situation ( * SITUATION_KIND_AIR ) {
96
+ if !param_1 && fighter. is_prev_situation ( * SITUATION_KIND_AIR ) {
97
+ return ;
98
+ }
99
+ sv_kinetic_energy ! ( set_needs_set_param, fighter, FIGHTER_KINETIC_ENERGY_ID_GRAVITY , false ) ;
100
+ if KineticModule :: is_enable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_CONTROL ) {
101
+ sv_kinetic_energy ! ( set_needs_set_param, fighter, FIGHTER_KINETIC_ENERGY_ID_CONTROL , false ) ;
102
+ }
103
+ }
104
+ }
105
+
106
+ pub fn install ( ) {
107
+ install_status_scripts ! (
108
+ special_n_main,
109
+ ) ;
110
+ }
0 commit comments