1
+ use super :: * ;
2
+
3
+ #[ no_mangle]
4
+ unsafe fn attack_air_float_pre ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue {
5
+ let prev_status_kind = fighter. global_table [ PREV_STATUS_KIND ] . get_i32 ( ) ;
6
+ let keep = if prev_status_kind == float_status. get_i32 ( ) {
7
+ (
8
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ALL_FLAG ,
9
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ALL_INT ,
10
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ALL_FLOAT
11
+ )
12
+ }
13
+ else {
14
+ (
15
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ATTACK_AIR_FLAG ,
16
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ATTACK_AIR_INT ,
17
+ * FIGHTER_STATUS_WORK_KEEP_FLAG_ATTACK_AIR_FLOAT
18
+ )
19
+ } ;
20
+ StatusModule :: init_settings (
21
+ fighter. module_accessor ,
22
+ SituationKind ( * SITUATION_KIND_AIR ) ,
23
+ * FIGHTER_KINETIC_TYPE_MOTION_FALL ,
24
+ * GROUND_CORRECT_KIND_AIR as u32 ,
25
+ GroundCliffCheckKind ( * GROUND_CLIFF_CHECK_KIND_NONE ) ,
26
+ true ,
27
+ keep. 0 ,
28
+ keep. 1 ,
29
+ keep. 2 ,
30
+ * FS_SUCCEEDS_KEEP_VISIBILITY | * FS_SUCCEEDS_KEEP_ATTACK | * FS_SUCCEEDS_KEEP_EFFECT
31
+ ) ;
32
+ FighterStatusModuleImpl :: set_fighter_status_data (
33
+ fighter. module_accessor ,
34
+ false ,
35
+ * FIGHTER_TREADED_KIND_NO_REAC ,
36
+ false ,
37
+ false ,
38
+ false ,
39
+ * FIGHTER_LOG_MASK_FLAG_ACTION_CATEGORY_KEEP as u64 ,
40
+ * FIGHTER_STATUS_ATTR_CLEAR_MOTION_ENERGY as u32 ,
41
+ * FIGHTER_POWER_UP_ATTACK_BIT_ATTACK_AIR as u32 ,
42
+ 0
43
+ ) ;
44
+ 0 . into ( )
45
+ }
46
+
47
+ #[ no_mangle]
48
+ unsafe fn attack_air_float_main ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue {
49
+ let prev_status_kind = fighter. global_table [ PREV_STATUS_KIND ] . get_i32 ( ) ;
50
+ if prev_status_kind != float_status. get_i32 ( ) {
51
+ return smashline:: original_status ( Main , fighter, * FIGHTER_STATUS_KIND_ATTACK_AIR ) ( fighter) ;
52
+ }
53
+
54
+ let motion = MotionModule :: motion_kind ( fighter. module_accessor ) ;
55
+
56
+ let log = match motion {
57
+ 0xc3a4e2597 => Some ( FIGHTER_LOG_ATTACK_KIND_ATTACK_AIR_N ) ,
58
+ 0xc3495ada5 => Some ( FIGHTER_LOG_ATTACK_KIND_ATTACK_AIR_F ) ,
59
+ 0xc33f869bc => Some ( FIGHTER_LOG_ATTACK_KIND_ATTACK_AIR_B ) ,
60
+ 0xdde67d935 => Some ( FIGHTER_LOG_ATTACK_KIND_ATTACK_AIR_HI ) ,
61
+ 0xd40042152 => Some ( FIGHTER_LOG_ATTACK_KIND_ATTACK_AIR_LW ) ,
62
+ _ => None
63
+ } ;
64
+
65
+ if let Some ( log) = log {
66
+ notify_event_msc_cmd ! ( fighter, Hash40 :: new_raw( 0x2b94de0d96 ) , FIGHTER_LOG_ACTION_CATEGORY_KEEP , log) ;
67
+ }
68
+
69
+ // fighter.status_AttackAir_Main_common();
70
+ WorkModule :: set_int64 ( fighter. module_accessor , motion as i64 , * FIGHTER_STATUS_ATTACK_AIR_WORK_INT_MOTION_KIND ) ;
71
+
72
+ // allow fast fall during float release aerials
73
+ if !StopModule :: is_stop ( fighter. module_accessor ) {
74
+ fighter. sub_fall_common_uniq ( false . into ( ) ) ;
75
+ }
76
+ fighter. global_table [ SUB_STATUS ] . assign ( & L2CValue :: Ptr ( L2CFighterCommon_sub_fall_common_uniq as * const ( ) as _ ) ) ;
77
+
78
+ fighter. sub_shift_status_main ( L2CValue :: Ptr ( L2CFighterCommon_status_AttackAir_Main as * const ( ) as _ ) )
79
+ }
80
+
81
+ #[ skyline:: hook( replace = L2CFighterCommon_status_AttackAir_Main_common ) ]
82
+ unsafe extern "C" fn status_attackair_main_common ( fighter : & mut L2CFighterCommon ) -> L2CValue {
83
+ if !CancelModule :: is_enable_cancel ( fighter. module_accessor )
84
+ && VarModule :: is_flag ( fighter. battle_object , vars:: common:: instance:: OMNI_FLOAT )
85
+ && !VarModule :: is_flag ( fighter. battle_object , vars:: common:: instance:: IS_FLOAT )
86
+ && ControlModule :: check_button_on ( fighter. module_accessor , * CONTROL_PAD_BUTTON_JUMP ) {
87
+ let mut dive_cont_value = WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "common" ) , hash40 ( "dive_cont_value" ) ) ;
88
+ let mut dive_flick_frame_value = WorkModule :: get_param_int ( fighter. module_accessor , hash40 ( "common" ) , hash40 ( "dive_flick_frame_value" ) ) ;
89
+ if fighter. left_stick_y ( ) <= dive_cont_value
90
+ && VarModule :: get_int ( fighter. battle_object , vars:: common:: instance:: LEFT_STICK_FLICK_Y ) < dive_flick_frame_value {
91
+ let status_kind = VarModule :: get_int ( fighter. battle_object , vars:: common:: instance:: FLOAT_STATUS_KIND ) ;
92
+ if status_kind != 0 {
93
+ VarModule :: on_flag ( fighter. battle_object , vars:: common:: status:: FLOAT_INHERIT_AERIAL ) ;
94
+ fighter. change_status ( status_kind. into ( ) , true . into ( ) ) ;
95
+ return 0 . into ( ) ;
96
+ }
97
+ }
98
+ }
99
+ original ! ( ) ( fighter)
100
+ }
101
+
102
+ fn nro_hook ( info : & skyline:: nro:: NroInfo ) {
103
+ if info. name == "common" {
104
+ skyline:: install_hooks!(
105
+ status_attackair_main_common
106
+ ) ;
107
+ }
108
+ }
109
+ pub fn install ( ) {
110
+ skyline:: nro:: add_hook ( nro_hook) ;
111
+ }
0 commit comments