@@ -5,32 +5,32 @@ use globals::*;
5
5
// This file contains code for aerial glide tosses, wavelanding
6
6
7
7
pub fn install ( ) {
8
- install_status_scripts ! (
9
- status_pre_EscapeAir,
10
- status_EscapeAir,
11
- status_end_EscapeAir
12
- ) ;
13
- install_hooks ! (
14
- sub_escape_air_common,
15
- sub_escape_air_uniq,
16
- sub_escape_air_common_main,
17
- sub_escape_air_common_strans_main
18
- ) ;
19
8
skyline:: nro:: add_hook ( nro_hook) ;
9
+ Agent :: new ( "common" )
10
+ . status ( Pre , * FIGHTER_STATUS_KIND_ESCAPE_AIR , status_pre_EscapeAir)
11
+ . status ( Main , * FIGHTER_STATUS_KIND_ESCAPE_AIR , status_EscapeAir)
12
+ . status ( End , * FIGHTER_STATUS_KIND_ESCAPE_AIR , status_end_EscapeAir)
13
+ . install ( ) ;
20
14
}
21
15
22
16
fn nro_hook ( info : & skyline:: nro:: NroInfo ) {
23
17
if info. name == "common" {
24
18
skyline:: install_hooks!(
25
19
setup_escape_air_slide_common,
26
- exec_escape_air_slide
20
+ exec_escape_air_slide,
21
+ sub_escape_air_common,
22
+ sub_escape_air_uniq,
23
+ sub_escape_air_common_main,
24
+ sub_escape_air_common_strans_main,
25
+ status_pre_EscapeAir,
26
+ status_EscapeAir,
27
+ status_end_EscapeAir
27
28
) ;
28
29
}
29
30
}
30
31
31
32
// pre status
32
- #[ common_status_script( status = FIGHTER_STATUS_KIND_ESCAPE_AIR , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_PRE ,
33
- symbol = "_ZN7lua2cpp16L2CFighterCommon20status_pre_EscapeAirEv" ) ]
33
+ #[ skyline:: hook( replace = L2CFighterCommon_status_pre_EscapeAir ) ]
34
34
pub unsafe fn status_pre_EscapeAir ( fighter : & mut L2CFighterCommon ) -> L2CValue {
35
35
// handles instant wavedashes/wavelands
36
36
// we make sure to include this before change_motion so we check for proximity to the ground using our jumpsquat animation's ECB, rather than airdodge anim's ECB
@@ -76,8 +76,7 @@ pub unsafe fn status_pre_EscapeAir(fighter: &mut L2CFighterCommon) -> L2CValue {
76
76
0 . into ( )
77
77
}
78
78
79
- #[ common_status_script( status = FIGHTER_STATUS_KIND_ESCAPE_AIR , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN ,
80
- symbol = "_ZN7lua2cpp16L2CFighterCommon16status_EscapeAirEv" ) ]
79
+ #[ skyline:: hook( replace = L2CFighterCommon_status_EscapeAir ) ]
81
80
unsafe fn status_EscapeAir ( fighter : & mut L2CFighterCommon ) -> L2CValue {
82
81
fighter. sub_escape_air_common ( ) ;
83
82
if WorkModule :: is_flag ( fighter. module_accessor , * FIGHTER_STATUS_ESCAPE_AIR_FLAG_SLIDE ) {
@@ -116,8 +115,7 @@ unsafe extern "C" fn status_EscapeAir_Main(fighter: &mut L2CFighterCommon) -> L2
116
115
}
117
116
118
117
// end status
119
- #[ common_status_script( status = FIGHTER_STATUS_KIND_ESCAPE_AIR , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_END ,
120
- symbol = "_ZN7lua2cpp16L2CFighterCommon20status_end_EscapeAirEv" ) ]
118
+ #[ skyline:: hook( replace = L2CFighterCommon_status_end_EscapeAir ) ]
121
119
pub unsafe fn status_end_EscapeAir ( fighter : & mut L2CFighterCommon ) -> L2CValue {
122
120
let status_kind = fighter. global_table [ STATUS_KIND ] . get_i32 ( ) ;
123
121
if [ * FIGHTER_STATUS_KIND_FALL , * FIGHTER_STATUS_KIND_LANDING ] . contains ( & status_kind)
@@ -162,7 +160,7 @@ pub unsafe fn status_end_EscapeAir(fighter: &mut L2CFighterCommon) -> L2CValue {
162
160
}
163
161
164
162
// common air dodge init code
165
- #[ hook( module = "common" , symbol = "_ZN7lua2cpp16L2CFighterCommon21sub_escape_air_commonEv" ) ]
163
+ #[ skyline :: hook( replace = L2CFighterCommon_sub_escape_air_common ) ]
166
164
unsafe fn sub_escape_air_common ( fighter : & mut L2CFighterCommon ) {
167
165
ControlModule :: reset_trigger ( fighter. module_accessor ) ;
168
166
WorkModule :: set_int ( fighter. module_accessor , 0 , * FIGHTER_STATUS_ESCAPE_WORK_INT_FRAME ) ;
@@ -188,7 +186,7 @@ unsafe fn sub_escape_air_common(fighter: &mut L2CFighterCommon) {
188
186
}
189
187
190
188
// custom substatus for airdodges
191
- #[ hook( module = "common" , symbol = "_ZN7lua2cpp16L2CFighterCommon19sub_escape_air_uniqEN3lib8L2CValueE" ) ]
189
+ #[ skyline :: hook( replace = L2CFighterCommon_sub_escape_air_uniq ) ]
192
190
unsafe extern "C" fn sub_escape_air_uniq ( fighter : & mut L2CFighterCommon , arg : L2CValue ) -> L2CValue {
193
191
if arg. get_bool ( ) {
194
192
WorkModule :: inc_int ( fighter. module_accessor , * FIGHTER_STATUS_ESCAPE_WORK_INT_FRAME ) ;
@@ -276,7 +274,7 @@ unsafe extern "C" fn sub_escape_air_uniq(fighter: &mut L2CFighterCommon, arg: L2
276
274
0 . into ( )
277
275
}
278
276
279
- #[ hook( module = "common" , symbol = "_ZN7lua2cpp16L2CFighterCommon26sub_escape_air_common_mainEv" ) ]
277
+ #[ skyline :: hook( replace = L2CFighterCommon_sub_escape_air_common_main ) ]
280
278
unsafe extern "C" fn sub_escape_air_common_main ( fighter : & mut L2CFighterCommon ) -> L2CValue {
281
279
let id = VarModule :: get_int ( fighter. battle_object , vars:: common:: instance:: COSTUME_SLOT_NUMBER ) as usize ;
282
280
let curr_frame = fighter. global_table [ CURRENT_FRAME ] . get_i32 ( ) ;
@@ -349,7 +347,7 @@ unsafe extern "C" fn sub_escape_air_common_main(fighter: &mut L2CFighterCommon)
349
347
L2CValue :: Bool ( true )
350
348
}
351
349
352
- #[ hook( module = "common" , symbol = "_ZN7lua2cpp16L2CFighterCommon33sub_escape_air_common_strans_mainEv" ) ]
350
+ #[ skyline :: hook( replace = L2CFighterCommon_sub_escape_air_common_strans_main ) ]
353
351
unsafe extern "C" fn sub_escape_air_common_strans_main ( fighter : & mut L2CFighterCommon ) -> L2CValue {
354
352
let trigger_frame = WorkModule :: get_param_int ( fighter. module_accessor , hash40 ( "common" ) , hash40 ( "air_escape_passive_trigger_frame" ) ) as f32 ;
355
353
let curr_frame = WorkModule :: get_int ( fighter. module_accessor , * FIGHTER_STATUS_ESCAPE_WORK_INT_FRAME ) ;
0 commit comments