@@ -3,6 +3,25 @@ utils::import_noreturn!(common::opff::fighter_common_opff);
3
3
use super :: * ;
4
4
use globals:: * ;
5
5
6
+ // allow fair and bair to transition into their angled variants when the stick is angled up/down
7
+ unsafe fn whip_angling ( fighter : & mut L2CFighterCommon , boma : & mut BattleObjectModuleAccessor , frame : f32 , stick_y : f32 ) {
8
+ if fighter. is_motion_one_of ( & [ Hash40 :: new ( "attack_air_f" ) , Hash40 :: new ( "attack_air_f_hi" ) , Hash40 :: new ( "attack_air_f_lw" ) ] )
9
+ && ( 11.0 ..12.0 ) . contains ( & frame) {
10
+ if stick_y > 0.5 { // stick is held up
11
+ MotionModule :: change_motion_inherit_frame ( boma, Hash40 :: new ( "attack_air_f_hi" ) , -1.0 , 1.0 , 0.0 , false , false ) ;
12
+ } else if stick_y < -0.5 { // stick is held down
13
+ MotionModule :: change_motion_inherit_frame ( boma, Hash40 :: new ( "attack_air_f_lw" ) , -1.0 , 1.0 , 0.0 , false , false ) ;
14
+ }
15
+ }
16
+ else if fighter. is_motion_one_of ( & [ Hash40 :: new ( "attack_air_b" ) , Hash40 :: new ( "attack_air_b_hi" ) , Hash40 :: new ( "attack_air_b_lw" ) ] )
17
+ && ( 11.0 ..12.0 ) . contains ( & frame) {
18
+ if stick_y > 0.5 { // stick is held up
19
+ MotionModule :: change_motion_inherit_frame ( boma, Hash40 :: new ( "attack_air_b_hi" ) , -1.0 , 1.0 , 0.0 , false , false ) ;
20
+ } else if stick_y < -0.5 { // stick is held down
21
+ MotionModule :: change_motion_inherit_frame ( boma, Hash40 :: new ( "attack_air_b_lw" ) , -1.0 , 1.0 , 0.0 , false , false ) ;
22
+ }
23
+ }
24
+ }
6
25
7
26
unsafe fn fastfall_specials ( fighter : & mut L2CFighterCommon ) {
8
27
if !fighter. is_in_hitlag ( )
@@ -36,7 +55,8 @@ unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
36
55
}
37
56
}
38
57
39
- pub unsafe fn moveset ( fighter : & mut L2CFighterCommon ) {
58
+ pub unsafe fn moveset ( fighter : & mut L2CFighterCommon , boma : & mut BattleObjectModuleAccessor , id : usize , cat : [ i32 ; 4 ] , status_kind : i32 , situation_kind : i32 , motion_kind : u64 , stick_x : f32 , stick_y : f32 , facing : f32 , frame : f32 ) {
59
+ whip_angling ( fighter, boma, frame, stick_y) ;
40
60
fastfall_specials ( fighter) ;
41
61
}
42
62
@@ -50,6 +70,6 @@ pub fn richter_frame_wrapper(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
50
70
51
71
pub unsafe fn richter_frame ( fighter : & mut smash:: lua2cpp:: L2CFighterCommon ) {
52
72
if let Some ( info) = FrameInfo :: update_and_get ( fighter) {
53
- moveset ( fighter) ;
73
+ moveset ( fighter, & mut * info . boma , info . id , info . cat , info . status_kind , info . situation_kind , info . motion_kind . hash , info . stick_x , info . stick_y , info . facing , info . frame ) ;
54
74
}
55
75
}
0 commit comments