1
1
use super :: * ;
2
2
use globals:: * ;
3
3
4
+
5
+ pub const SPECIAL_S_KIND_F : i32 = 1 ;
6
+ pub const SPECIAL_S_KIND_B : i32 = 2 ;
7
+ pub const SPECIAL_S_KIND_LW_G : i32 = 3 ;
8
+ pub const SPECIAL_S_KIND_LW_A : i32 = 4 ;
9
+
4
10
unsafe extern "C" fn specials_situation_helper ( fighter : & mut L2CFighterCommon , is_start : bool ) {
5
11
let motion_g;
6
12
let motion_a;
7
13
let throw_input = VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) ;
8
- let is_Ground = StatusModule :: situation_kind ( fighter. module_accessor ) == * SITUATION_KIND_GROUND ;
14
+ let is_Ground = fighter. is_situation ( * SITUATION_KIND_GROUND ) ;
9
15
10
- if throw_input == - 2 {
11
- motion_g = Hash40 :: new ( "special_s_throwlw " ) ;
16
+ if throw_input == SPECIAL_S_KIND_LW_A {
17
+ motion_g = Hash40 :: new ( "special_air_s_squat " ) ;
12
18
motion_a = Hash40 :: new ( "special_air_s_squat" ) ;
13
19
}
14
- else if throw_input > 0 {
20
+ else if throw_input == SPECIAL_S_KIND_LW_G {
21
+ motion_g = Hash40 :: new ( "special_s_throwlw" ) ;
22
+ motion_a = Hash40 :: new ( "special_s_throwlw" ) ;
23
+ }
24
+ else if throw_input == SPECIAL_S_KIND_F {
15
25
motion_g = Hash40 :: new ( "special_s_throwf" ) ;
16
26
motion_a = Hash40 :: new ( "special_air_s_throwf" ) ;
17
27
}
18
- else if throw_input < 0 {
28
+ else if throw_input == SPECIAL_S_KIND_B {
19
29
motion_g = Hash40 :: new ( "special_s_throwb" ) ;
20
30
motion_a = Hash40 :: new ( "special_air_s_throwb" ) ;
21
31
}
@@ -88,7 +98,7 @@ unsafe extern "C" fn specials_situation_helper(fighter: &mut L2CFighterCommon, i
88
98
89
99
unsafe extern "C" fn special_s_kinetic_exec ( fighter : & mut L2CFighterCommon ) {
90
100
let is_Ground = StatusModule :: situation_kind ( fighter. module_accessor ) == * SITUATION_KIND_GROUND ;
91
- let is_Landing = VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) == - 2 ;
101
+ let is_Landing = VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) == SPECIAL_S_KIND_LW_A ;
92
102
if is_Ground || is_Landing {
93
103
if !KineticModule :: is_enable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_GRAVITY ) {
94
104
KineticModule :: unable_energy ( fighter. module_accessor , * FIGHTER_KINETIC_ENERGY_ID_GRAVITY ) ;
@@ -201,18 +211,21 @@ unsafe extern "C" fn specials_squat_main_loop(fighter: &mut L2CFighterCommon) ->
201
211
let throw_Lw = ControlModule :: get_stick_y ( fighter. module_accessor ) < WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "common" ) , hash40 ( "attack_lw4_stick_y" ) ) ;
202
212
203
213
let mut throw_input = 1 ;
204
- if throw_Lw {
205
- throw_input = -2 ;
206
- fighter. change_status ( FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_JUMP . into ( ) , false . into ( ) ) ;
214
+ let mut next_status = FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_LANDING ;
215
+ if throw_Lw && fighter. is_situation ( * SITUATION_KIND_AIR ) {
216
+ throw_input = SPECIAL_S_KIND_LW_A ;
217
+ next_status = FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_JUMP ;
218
+ }
219
+ else if throw_Lw {
220
+ throw_input = SPECIAL_S_KIND_LW_G ;
207
221
}
208
222
else {
209
223
let throw_F = PostureModule :: lr ( fighter. module_accessor ) . signum ( ) == ControlModule :: get_stick_x ( fighter. module_accessor ) . signum ( )
210
224
|| ControlModule :: get_stick_x ( fighter. module_accessor ) . abs ( ) < 0.2 ;
211
- throw_input = if throw_F { 1 } else { - 1 } ;
225
+ throw_input = if throw_F { SPECIAL_S_KIND_F } else { SPECIAL_S_KIND_B } ;
212
226
}
213
227
214
228
VarModule :: set_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE , throw_input) ;
215
- let next_status = if throw_Lw { FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_JUMP } else { FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_LANDING } ;
216
229
fighter. change_status ( next_status. into ( ) , false . into ( ) ) ;
217
230
return 0 . into ( ) ;
218
231
}
@@ -336,7 +349,7 @@ unsafe fn specials_landing_init(fighter: &mut L2CFighterCommon) -> L2CValue {
336
349
337
350
#[ status_script( agent = "koopa" , status = FIGHTER_KOOPA_STATUS_KIND_SPECIAL_S_LANDING , condition = LUA_SCRIPT_STATUS_FUNC_STATUS_PRE ) ]
338
351
unsafe fn specials_landing_pre ( fighter : & mut L2CFighterCommon ) -> L2CValue {
339
- if VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) == - 2 {
352
+ if VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) == SPECIAL_S_KIND_LW_A {
340
353
return original ! ( fighter) ;
341
354
}
342
355
let kinetic = KineticModule :: get_kinetic_type ( fighter. module_accessor ) ;
@@ -372,7 +385,7 @@ unsafe fn specials_landing_pre(fighter: &mut L2CFighterCommon) -> L2CValue {
372
385
unsafe fn specials_landing_main ( fighter : & mut L2CFighterCommon ) -> L2CValue {
373
386
let throw_input = VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) ;
374
387
375
- if throw_input == - 2 {
388
+ if throw_input == SPECIAL_S_KIND_LW_A {
376
389
let start_y = WorkModule :: get_float ( fighter. module_accessor , * FIGHTER_KOOPA_STATUS_SPECIAL_S_WORK_FLOAT_START_Y ) ;
377
390
let mut max_dist = WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "param_special_s" ) , hash40 ( "special_s_attack_power_max_dist" ) ) ;
378
391
max_dist*=10.0 ;
@@ -388,14 +401,14 @@ unsafe fn specials_landing_main(fighter: &mut L2CFighterCommon) -> L2CValue {
388
401
return fighter. sub_shift_status_main ( L2CValue :: Ptr ( specials_landing_main_loop as * const ( ) as _ ) ) ;
389
402
}
390
403
391
- let throw_F = throw_input == 1 ;
404
+ let throw_B = throw_input == SPECIAL_S_KIND_B ;
392
405
let capture_id = LinkModule :: get_node_object_id ( fighter. module_accessor , * LINK_NO_CAPTURE ) ;
393
406
if capture_id != 0x50000000 {
394
407
let capture_boma = sv_battle_object:: module_accessor ( capture_id as u32 ) ;
395
408
396
409
let motion_share = WorkModule :: get_param_int ( fighter. module_accessor , 0xad2ee25eu64 , 0x7d88ea0u64 ) ;
397
- let throw_motion = if throw_F { 36603360558 as u64 } else { 36554879287 as u64 } ; //39642420386 lw 41418534085 hi 36603360558 f 36554879287 b
398
- let throw_rate = if throw_F { 1.7 } else { 1.0 } ;
410
+ let throw_motion = if !throw_B { 36603360558 as u64 } else { 36554879287 as u64 } ; //39642420386 lw 41418534085 hi 36603360558 f 36554879287 b
411
+ let throw_rate = if !throw_B { 1.7 } else { 1.0 } ;
399
412
400
413
let mut share_type = 0 ;
401
414
if motion_share == * FIGHTER_MOTION_SHARE_TYPE_TARO {
@@ -437,7 +450,7 @@ unsafe extern "C" fn specials_landing_main_loop(fighter: &mut L2CFighterCommon)
437
450
438
451
if !StatusModule :: is_changing ( fighter. module_accessor )
439
452
&& StatusModule :: is_situation_changed ( fighter. module_accessor ) {
440
- if VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) != - 2
453
+ if VarModule :: get_int ( fighter. battle_object , vars:: koopa:: instance:: SPECIAL_S_THROW_TYPE ) != SPECIAL_S_KIND_LW_A
441
454
{
442
455
specials_situation_helper ( fighter, false ) ;
443
456
}
0 commit comments