1
1
use super :: * ;
2
- use globals:: * ;
3
- utils:: import!( common:: djc:: attack_air_main_status) ;
4
- // status script import
5
-
6
- extern "Rust" {
7
- #[ link_name = "attack_air_float_pre" ]
8
- fn attack_air_float_pre ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue ;
9
- #[ link_name = "attack_air_float_main" ]
10
- fn attack_air_float_main ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue ;
11
- }
12
-
13
- unsafe extern "C" fn attack_air_pre ( fighter : & mut L2CFighterCommon ) -> L2CValue {
14
- attack_air_float_pre ( fighter, statuses:: mewtwo:: FLOAT . into ( ) )
15
- }
16
2
17
- unsafe extern "C" fn attack_air_init ( fighter : & mut L2CFighterCommon ) -> L2CValue {
3
+ #[ no_mangle]
4
+ unsafe fn attack_air_float_pre ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue {
18
5
let prev_status_kind = fighter. global_table [ PREV_STATUS_KIND ] . get_i32 ( ) ;
19
- if prev_status_kind != statuses:: mewtwo:: FLOAT {
20
- return smashline:: original_status ( Init , fighter, * FIGHTER_STATUS_KIND_ATTACK_AIR ) ( fighter) ;
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
+ )
21
12
}
22
- fighter. sub_attack_air_uniq_process_init ( )
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 ( )
23
45
}
24
46
25
- pub unsafe extern "C" fn attack_air_main ( fighter : & mut L2CFighterCommon ) -> L2CValue {
47
+ #[ no_mangle]
48
+ unsafe fn attack_air_float_main ( fighter : & mut L2CFighterCommon , float_status : L2CValue ) -> L2CValue {
26
49
let prev_status_kind = fighter. global_table [ PREV_STATUS_KIND ] . get_i32 ( ) ;
27
- if prev_status_kind != statuses :: mewtwo :: FLOAT {
28
- return common :: djc :: attack_air_main_status ( fighter) ;
50
+ if prev_status_kind != float_status . get_i32 ( ) {
51
+ return smashline :: original_status ( Main , fighter , * FIGHTER_STATUS_KIND_ATTACK_AIR ) ( fighter) ;
29
52
}
30
53
31
54
let motion = MotionModule :: motion_kind ( fighter. module_accessor ) ;
@@ -45,13 +68,44 @@ pub unsafe extern "C" fn attack_air_main(fighter: &mut L2CFighterCommon) -> L2CV
45
68
46
69
// fighter.status_AttackAir_Main_common();
47
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
+
48
78
fighter. sub_shift_status_main ( L2CValue :: Ptr ( L2CFighterCommon_status_AttackAir_Main as * const ( ) as _ ) )
49
79
}
50
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
+ }
51
109
pub fn install ( ) {
52
- smashline:: Agent :: new ( "mewtwo" )
53
- . status ( Pre , * FIGHTER_STATUS_KIND_ATTACK_AIR , attack_air_pre)
54
- . status ( Init , * FIGHTER_STATUS_KIND_ATTACK_AIR , attack_air_init)
55
- . status ( Main , * FIGHTER_STATUS_KIND_ATTACK_AIR , attack_air_main)
56
- . install ( ) ;
110
+ skyline:: nro:: add_hook ( nro_hook) ;
57
111
}
0 commit comments