@@ -5,6 +5,7 @@ use globals::*;
5
5
pub fn install ( ) {
6
6
install_status_scripts ! (
7
7
init_specials,
8
+ special_s_back
8
9
) ;
9
10
}
10
11
@@ -15,6 +16,40 @@ pub fn set_gravity_delay_resume_frame(energy: *mut FighterKineticEnergyGravity,
15
16
}
16
17
}
17
18
19
+ #[ status_script( agent = "roy" , status = FIGHTER_ROY_STATUS_KIND_SPECIAL_S4 , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN ) ]
20
+ pub unsafe fn special_s_back ( fighter : & mut L2CFighterCommon ) -> L2CValue {
21
+ if VarModule :: is_flag ( fighter. battle_object , vars:: roy:: instance:: REVERSE_SIDEB ) {
22
+ let lrc = PostureModule :: lr ( fighter. module_accessor ) ;
23
+ let stick_x = ControlModule :: get_stick_x ( fighter. module_accessor ) ;
24
+
25
+ if fighter. global_table [ SITUATION_KIND ] == SITUATION_KIND_GROUND {
26
+ MotionModule :: change_motion_inherit_frame ( fighter. module_accessor , Hash40 :: new ( "special_s4_back" ) , 0.0 , 1.0 , 0.0 , false , false ) ;
27
+ VarModule :: off_flag ( fighter. battle_object , vars:: roy:: instance:: REVERSE_SIDEB ) ;
28
+
29
+ if lrc == 1.0 && stick_x < 0.0 {
30
+ PostureModule :: set_lr ( fighter. module_accessor , -1.0 ) ;
31
+ } else if lrc == -1.0 && stick_x > 0.0 {
32
+ PostureModule :: set_lr ( fighter. module_accessor , 1.0 ) ;
33
+ }
34
+
35
+ return 0 . into ( ) ;
36
+ } else {
37
+ MotionModule :: change_motion_inherit_frame ( fighter. module_accessor , Hash40 :: new ( "special_air_s4_back" ) , 0.0 , 1.0 , 0.0 , false , false ) ;
38
+ VarModule :: off_flag ( fighter. battle_object , vars:: roy:: instance:: REVERSE_SIDEB ) ;
39
+
40
+ if lrc == 1.0 && stick_x < 0.0 {
41
+ PostureModule :: set_lr ( fighter. module_accessor , -1.0 ) ;
42
+ } else if lrc == -1.0 && stick_x > 0.0 {
43
+ PostureModule :: set_lr ( fighter. module_accessor , 1.0 ) ;
44
+ }
45
+
46
+ return 0 . into ( ) ;
47
+ }
48
+ }
49
+
50
+ original ! ( fighter)
51
+ }
52
+
18
53
#[ status_script( agent = "roy" , status = FIGHTER_STATUS_KIND_SPECIAL_S , condition = LUA_SCRIPT_STATUS_FUNC_INIT_STATUS ) ]
19
54
pub unsafe fn init_specials ( fighter : & mut L2CFighterCommon , arg : u64 ) -> L2CValue {
20
55
let fighter_kind = WorkModule :: get_int ( fighter. module_accessor , * FIGHTER_INSTANCE_WORK_ID_INT_KIND ) ;
@@ -76,6 +111,10 @@ pub unsafe fn init_specials(fighter: &mut L2CFighterCommon, arg: u64) -> L2CValu
76
111
smash:: app:: lua_bind:: KineticEnergy :: enable ( motion_energy) ;
77
112
smash:: app:: lua_bind:: KineticModule :: unable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_STOP ) ;
78
113
smash:: app:: lua_bind:: KineticModule :: unable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_GRAVITY ) ;
114
+
115
+ if VarModule :: is_flag ( fighter. battle_object , vars:: roy:: instance:: REVERSE_SIDEB ) {
116
+ MotionModule :: change_motion ( fighter. module_accessor , Hash40 :: new ( "special_s4_back" ) , 0.0 , 1.0 , false , 0.0 , false , false ) ;
117
+ }
79
118
}
80
119
else if current_situation_kind == * SITUATION_KIND_AIR {
81
120
let reset_speed_2f = smash:: phx:: Vector2f { x : 0.0 , y : 0.0 } ;
@@ -84,6 +123,10 @@ pub unsafe fn init_specials(fighter: &mut L2CFighterCommon, arg: u64) -> L2CValu
84
123
smash:: app:: lua_bind:: KineticEnergy :: reset_energy ( gravity_energy, * ENERGY_GRAVITY_RESET_TYPE_GRAVITY , & reset_speed_2f, & reset_speed_3f, fighter. module_accessor ) ;
85
124
smash:: app:: lua_bind:: KineticEnergy :: enable ( stop_energy) ;
86
125
smash:: app:: lua_bind:: KineticEnergy :: enable ( gravity_energy) ;
126
+
127
+ if VarModule :: is_flag ( fighter. battle_object , vars:: roy:: instance:: REVERSE_SIDEB ) {
128
+ MotionModule :: change_motion ( fighter. module_accessor , Hash40 :: new ( "special_air_s4_back" ) , 0.0 , 1.0 , false , 0.0 , false , false ) ;
129
+ }
87
130
}
88
131
}
89
132
KineticModule :: unable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_CONTROL ) ;
0 commit comments