@@ -5,16 +5,18 @@ unsafe extern "C" fn wait_main(weapon: &mut L2CWeaponCommon) -> L2CValue {
5
5
MotionModule :: change_motion ( weapon. module_accessor , Hash40 :: new ( "wait" ) , 0.0 , 1.0 , false , 0.0 , false , false ) ;
6
6
let owner_id = WorkModule :: get_int ( weapon. module_accessor , * WEAPON_INSTANCE_WORK_ID_INT_LINK_OWNER ) as u32 ;
7
7
let edge = utils:: util:: get_battle_object_from_id ( owner_id) ;
8
+ GroundModule :: set_collidable ( weapon. module_accessor , false ) ;
9
+ if ( & mut * ( * edge) . module_accessor ) . kind ( ) != * FIGHTER_KIND_EDGE {
10
+ StatusModule :: change_status_force ( weapon. module_accessor , statuses:: edge_flash:: BURST , false ) ;
11
+ return 1 . into ( )
12
+ }
8
13
let life = ParamModule :: get_int ( edge, ParamType :: Agent , "param_flash.life" ) ;
9
14
VarModule :: set_int ( weapon. battle_object , vars:: edge_flash:: status:: LIFE , life) ;
10
- GroundModule :: set_collidable ( weapon. module_accessor , false ) ;
11
- if ( & mut * ( * edge) . module_accessor ) . kind ( ) == * FIGHTER_KIND_EDGE {
12
- if VarModule :: is_flag ( edge, vars:: edge:: status:: FLASH_HOLD ) {
13
- let pos_x = PostureModule :: pos_x ( weapon. module_accessor ) ;
14
- let pos_y = PostureModule :: pos_y ( weapon. module_accessor ) ;
15
- let offset_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.hold_offset_x" ) ;
16
- PostureModule :: set_pos ( weapon. module_accessor , & Vector3f :: new ( pos_x + ( offset_x * PostureModule :: lr ( weapon. module_accessor ) ) , pos_y, 0.0 ) ) ;
17
- }
15
+ if VarModule :: is_flag ( edge, vars:: edge:: status:: FLASH_HOLD ) {
16
+ let pos_x = PostureModule :: pos_x ( weapon. module_accessor ) ;
17
+ let pos_y = PostureModule :: pos_y ( weapon. module_accessor ) ;
18
+ let offset_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.hold_offset_x" ) ;
19
+ PostureModule :: set_pos ( weapon. module_accessor , & Vector3f :: new ( pos_x + ( offset_x * PostureModule :: lr ( weapon. module_accessor ) ) , pos_y, 0.0 ) ) ;
18
20
}
19
21
weapon. fastshift ( L2CValue :: Ptr ( wait_main_loop as * const ( ) as _ ) )
20
22
}
@@ -27,46 +29,48 @@ unsafe extern "C" fn wait_main_loop(weapon: &mut L2CWeaponCommon) -> L2CValue {
27
29
StatusModule :: change_status_force ( weapon. module_accessor , statuses:: edge_flash:: VANISH , false ) ;
28
30
return 1 . into ( )
29
31
}
30
- // burst
31
- if edge_boma. is_status_one_of ( & [ * FIGHTER_EDGE_STATUS_KIND_SPECIAL_HI_RUSH , * FIGHTER_EDGE_STATUS_KIND_SPECIAL_HI_CHARGED_RUSH ] ) {
32
- let pos_x = PostureModule :: pos_x ( weapon. module_accessor ) - PostureModule :: pos_x ( edge_boma) ;
33
- let pos_y = PostureModule :: pos_y ( weapon. module_accessor ) - PostureModule :: pos_y ( edge_boma) ;
34
- let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.burst_dist_mod_x" ) * PostureModule :: scale ( weapon. module_accessor ) ;
35
- let dist_mod_y = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.burst_dist_mod_y" ) * PostureModule :: scale ( weapon. module_accessor ) ;
36
- if pos_x. abs ( ) < dist_mod_x && pos_y. abs ( ) < dist_mod_y {
37
- if PostureModule :: lr ( edge_boma) . signum ( ) != PostureModule :: lr ( weapon. module_accessor ) . signum ( ) {
38
- PostureModule :: reverse_lr ( weapon. module_accessor ) ;
32
+ if edge_boma. kind ( ) == * FIGHTER_KIND_EDGE {
33
+ // burst
34
+ if edge_boma. is_status_one_of ( & [ * FIGHTER_EDGE_STATUS_KIND_SPECIAL_HI_RUSH , * FIGHTER_EDGE_STATUS_KIND_SPECIAL_HI_CHARGED_RUSH ] ) {
35
+ let pos_x = PostureModule :: pos_x ( weapon. module_accessor ) - PostureModule :: pos_x ( edge_boma) ;
36
+ let pos_y = PostureModule :: pos_y ( weapon. module_accessor ) - PostureModule :: pos_y ( edge_boma) ;
37
+ let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.burst_dist_mod_x" ) * PostureModule :: scale ( weapon. module_accessor ) ;
38
+ let dist_mod_y = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.burst_dist_mod_y" ) * PostureModule :: scale ( weapon. module_accessor ) ;
39
+ if pos_x. abs ( ) < dist_mod_x && pos_y. abs ( ) < dist_mod_y {
40
+ if PostureModule :: lr ( edge_boma) . signum ( ) != PostureModule :: lr ( weapon. module_accessor ) . signum ( ) {
41
+ PostureModule :: reverse_lr ( weapon. module_accessor ) ;
42
+ }
43
+ SoundModule :: play_se ( weapon. module_accessor , Hash40 :: new ( "se_edge_special_l04" ) , true , false , false , false , app:: enSEType ( 0 ) ) ;
44
+ StatusModule :: change_status_force ( weapon. module_accessor , statuses:: edge_flash:: BURST , false ) ;
45
+ return 1 . into ( )
39
46
}
40
- SoundModule :: play_se ( weapon. module_accessor , Hash40 :: new ( "se_edge_special_l04" ) , true , false , false , false , app:: enSEType ( 0 ) ) ;
41
- StatusModule :: change_status_force ( weapon. module_accessor , statuses:: edge_flash:: BURST , false ) ;
42
- return 1 . into ( )
43
47
}
44
- }
45
- // refine flare
46
- if VarModule :: get_int ( edge, vars:: edge:: instance:: FIRE_ID ) != - 1 {
47
- let pos_x = VarModule :: get_float ( edge, vars:: edge:: instance:: FIRE_POS_X ) - PostureModule :: pos_x ( weapon. module_accessor ) ;
48
- let pos_y = VarModule :: get_float ( edge, vars :: edge :: instance :: FIRE_POS_Y ) - PostureModule :: pos_y ( weapon. module_accessor ) ;
49
- let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refine_dist_mod_x " ) * PostureModule :: scale ( weapon. module_accessor ) ;
50
- let dist_mod_y = ParamModule :: get_float ( edge , ParamType :: Agent , "param_flash.refine_dist_mod_y" ) * PostureModule :: scale ( weapon . module_accessor ) ;
51
- if pos_x . abs ( ) < dist_mod_x && pos_y . abs ( ) < dist_mod_y {
52
- if VarModule :: get_int ( weapon . battle_object , vars :: edge_flash :: status :: REFINE_COOLDOWN ) <= 0 {
53
- let cooldown = ParamModule :: get_int ( edge , ParamType :: Agent , "param_flash.refine_cooldown" ) ;
54
- VarModule :: set_int ( weapon . battle_object , vars:: edge_flash :: status :: REFINE_COOLDOWN , cooldown ) ;
55
- VarModule :: on_flag ( edge , vars :: edge :: instance :: FLASH_REFINE ) ;
48
+ // refine flare
49
+ if VarModule :: get_int ( edge , vars :: edge :: instance :: FIRE_ID ) != - 1 {
50
+ let pos_x = VarModule :: get_float ( edge, vars:: edge:: instance:: FIRE_POS_X ) - PostureModule :: pos_x ( weapon . module_accessor ) ;
51
+ let pos_y = VarModule :: get_float ( edge, vars:: edge:: instance:: FIRE_POS_Y ) - PostureModule :: pos_y ( weapon. module_accessor ) ;
52
+ let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refine_dist_mod_x" ) * PostureModule :: scale ( weapon. module_accessor ) ;
53
+ let dist_mod_y = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refine_dist_mod_y " ) * PostureModule :: scale ( weapon. module_accessor ) ;
54
+ if pos_x . abs ( ) < dist_mod_x && pos_y . abs ( ) < dist_mod_y {
55
+ if VarModule :: get_int ( weapon . battle_object , vars :: edge_flash :: status :: REFINE_COOLDOWN ) <= 0 {
56
+ let cooldown = ParamModule :: get_int ( edge , ParamType :: Agent , "param_flash.refine_cooldown" ) ;
57
+ VarModule :: set_int ( weapon . battle_object , vars :: edge_flash :: status :: REFINE_COOLDOWN , cooldown ) ;
58
+ VarModule :: on_flag ( edge , vars:: edge :: instance :: FLASH_REFINE ) ;
59
+ }
56
60
}
57
61
}
58
- }
59
- // refract shadow flare
60
- if VarModule :: get_int ( edge, vars:: edge:: instance:: FLARE1_ID ) != - 1 {
61
- let pos_x = VarModule :: get_float ( edge, vars:: edge:: instance:: FLARE1_POS_X ) - PostureModule :: pos_x ( weapon. module_accessor ) ;
62
- let pos_y = VarModule :: get_float ( edge, vars :: edge :: instance :: FLARE2_POS_Y ) - PostureModule :: pos_y ( weapon. module_accessor ) ;
63
- let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refract_dist_mod_x " ) * PostureModule :: scale ( weapon. module_accessor ) ;
64
- let dist_mod_y = ParamModule :: get_float ( edge , ParamType :: Agent , "param_flash.refract_dist_mod_y" ) * PostureModule :: scale ( weapon . module_accessor ) ;
65
- if pos_x . abs ( ) < dist_mod_x && pos_y . abs ( ) < dist_mod_y {
66
- let cooldown = ParamModule :: get_int ( edge , ParamType :: Agent , "param_flash.refract_cooldown" ) ;
67
- VarModule :: set_int ( weapon . battle_object , vars:: edge_flash :: status :: REFRACT_COOLDOWN , cooldown ) ;
68
- VarModule :: on_flag ( edge , vars :: edge :: instance :: FLASH_REFRACT ) ;
69
- }
62
+ // refract shadow flare
63
+ if VarModule :: get_int ( edge , vars :: edge :: instance :: FLARE1_ID ) != - 1 {
64
+ let pos_x = VarModule :: get_float ( edge, vars:: edge:: instance:: FLARE1_POS_X ) - PostureModule :: pos_x ( weapon . module_accessor ) ;
65
+ let pos_y = VarModule :: get_float ( edge, vars:: edge:: instance:: FLARE2_POS_Y ) - PostureModule :: pos_y ( weapon. module_accessor ) ;
66
+ let dist_mod_x = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refract_dist_mod_x" ) * PostureModule :: scale ( weapon. module_accessor ) ;
67
+ let dist_mod_y = ParamModule :: get_float ( edge, ParamType :: Agent , "param_flash.refract_dist_mod_y " ) * PostureModule :: scale ( weapon. module_accessor ) ;
68
+ if pos_x . abs ( ) < dist_mod_x && pos_y . abs ( ) < dist_mod_y {
69
+ let cooldown = ParamModule :: get_int ( edge , ParamType :: Agent , "param_flash.refract_cooldown" ) ;
70
+ VarModule :: set_int ( weapon . battle_object , vars :: edge_flash :: status :: REFRACT_COOLDOWN , cooldown ) ;
71
+ VarModule :: on_flag ( edge , vars:: edge :: instance :: FLASH_REFRACT ) ;
72
+ }
73
+ }
70
74
}
71
75
72
76
return 0 . into ( )
0 commit comments