@@ -5,28 +5,34 @@ use globals::*;
5
5
#[ skyline:: hook( replace = L2CFighterCommon_FighterStatusGuard__calc_shield_scale ) ]
6
6
pub unsafe fn calc_shield_scale (
7
7
fighter : & mut L2CFighterCommon ,
8
- shield_level : L2CValue ,
8
+ shield_level : L2CValue
9
9
) -> L2CValue {
10
10
let shield_level = shield_level. get_f32 ( ) ;
11
11
let shield_max = WorkModule :: get_float (
12
12
fighter. module_accessor ,
13
- * FIGHTER_INSTANCE_WORK_ID_FLOAT_GUARD_SHIELD_MAX ,
13
+ * FIGHTER_INSTANCE_WORK_ID_FLOAT_GUARD_SHIELD_MAX
14
14
) ;
15
15
16
16
let shield_size = WorkModule :: get_param_float (
17
17
fighter. module_accessor ,
18
18
hash40 ( "common" ) ,
19
- hash40 ( "shield_size" ) ,
19
+ hash40 ( "shield_size" )
20
+ ) ;
21
+ let shield_scale = WorkModule :: get_param_float (
22
+ fighter. module_accessor ,
23
+ hash40 ( "shield_scale" ) ,
24
+ 0
20
25
) ;
21
- let shield_scale =
22
- WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "shield_scale" ) , 0 ) ;
23
26
let shield_scale_min = WorkModule :: get_param_float (
24
27
fighter. module_accessor ,
25
28
hash40 ( "common" ) ,
26
- hash40 ( "shield_scale_min" ) ,
29
+ hash40 ( "shield_scale_min" )
30
+ ) ;
31
+ let shield_radius = WorkModule :: get_param_float (
32
+ fighter. module_accessor ,
33
+ hash40 ( "shield_radius" ) ,
34
+ 0
27
35
) ;
28
- let shield_radius =
29
- WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "shield_radius" ) , 0 ) ;
30
36
31
37
// let analog = InputModule::get_analog_for_guard(fighter.battle_object);
32
38
// let scale = if analog > 0.0 && analog < 1.0 {
@@ -47,18 +53,18 @@ pub unsafe fn check_hit_stop_delay(fighter: &mut L2CFighterCommon, arg: L2CValue
47
53
let hit_stop_delay_stick = WorkModule :: get_param_float (
48
54
fighter. module_accessor ,
49
55
hash40 ( "common" ) ,
50
- hash40 ( "hit_stop_delay_stick" ) ,
56
+ hash40 ( "hit_stop_delay_stick" )
51
57
) ;
52
58
if hit_stop_delay_stick <= stick_x {
53
59
let mut pos = * PostureModule :: pos ( fighter. module_accessor ) ;
54
60
let auto_mul = WorkModule :: get_param_float (
55
61
fighter. module_accessor ,
56
62
hash40 ( "common" ) ,
57
- hash40 ( "hit_stop_delay_stick_auto_mul" ) ,
63
+ hash40 ( "hit_stop_delay_stick_auto_mul" )
58
64
) ;
59
65
let delay_mul = WorkModule :: get_float (
60
66
fighter. module_accessor ,
61
- * FIGHTER_STATUS_GUARD_ON_WORK_FLOAT_DELAY_MUL ,
67
+ * FIGHTER_STATUS_GUARD_ON_WORK_FLOAT_DELAY_MUL
62
68
) ;
63
69
pos. x += stick_x * auto_mul * delay_mul;
64
70
PostureModule :: set_pos ( fighter. module_accessor , & pos) ;
@@ -71,32 +77,34 @@ pub unsafe fn check_hit_stop_delay(fighter: &mut L2CFighterCommon, arg: L2CValue
71
77
#[ skyline:: hook( replace = L2CFighterCommon_FighterStatusGuard__check_hit_stop_delay_flick ) ]
72
78
pub unsafe fn check_hit_stop_delay_flick (
73
79
fighter : & mut L2CFighterCommon ,
74
- user_mul : L2CValue ,
80
+ user_mul : L2CValue
75
81
) -> L2CValue {
76
82
let stick_x = ControlModule :: get_stick_x ( fighter. module_accessor ) . abs ( ) ;
77
83
let sub_x = ControlModule :: get_flick_sub_x ( fighter. module_accessor ) as f32 ;
78
84
let hit_stop_delay_stick = WorkModule :: get_param_float (
79
85
fighter. module_accessor ,
80
86
hash40 ( "common" ) ,
81
- hash40 ( "hit_stop_delay_stick" ) ,
87
+ hash40 ( "hit_stop_delay_stick" )
82
88
) ;
83
- if !WorkModule :: is_flag (
84
- fighter. module_accessor ,
85
- * FIGHTER_STATUS_GUARD_ON_WORK_FLAG_DISABLE_HIT_STOP_DELAY_STICK ,
86
- ) && StopModule :: is_hit ( fighter. module_accessor )
87
- && sub_x < hit_stop_delay_stick
88
- && hit_stop_delay_stick <= stick_x
89
+ if
90
+ !WorkModule :: is_flag (
91
+ fighter. module_accessor ,
92
+ * FIGHTER_STATUS_GUARD_ON_WORK_FLAG_DISABLE_HIT_STOP_DELAY_STICK
93
+ ) &&
94
+ StopModule :: is_hit ( fighter. module_accessor ) &&
95
+ sub_x < hit_stop_delay_stick &&
96
+ hit_stop_delay_stick <= stick_x
89
97
{
90
98
let mut pos = * PostureModule :: pos ( fighter. module_accessor ) ;
91
99
let flick_mul = WorkModule :: get_param_float (
92
100
fighter. module_accessor ,
93
101
hash40 ( "common" ) ,
94
- hash40 ( "hit_stop_delay_flick_mul" ) ,
102
+ hash40 ( "hit_stop_delay_flick_mul" )
95
103
) ;
96
104
let guard_mul = WorkModule :: get_param_float (
97
105
fighter. module_accessor ,
98
106
hash40 ( "common" ) ,
99
- hash40 ( "hit_stop_delay_guard_mul" ) ,
107
+ hash40 ( "hit_stop_delay_guard_mul" )
100
108
) ;
101
109
let user_mul = WorkModule :: get_float ( fighter. module_accessor , user_mul. get_i32 ( ) ) ;
102
110
pos. x += stick_x * flick_mul * guard_mul * user_mul;
@@ -112,12 +120,12 @@ pub unsafe fn check_hit_stop_delay_flick(
112
120
pub unsafe fn is_continue_just_shield_count ( fighter : & mut L2CFighterCommon ) -> L2CValue {
113
121
let just_shield_count = WorkModule :: get_int (
114
122
fighter. module_accessor ,
115
- * FIGHTER_STATUS_GUARD_ON_WORK_INT_JUST_SHEILD_COUNT ,
123
+ * FIGHTER_STATUS_GUARD_ON_WORK_INT_JUST_SHEILD_COUNT
116
124
) ;
117
125
let max_count = WorkModule :: get_param_int (
118
126
fighter. module_accessor ,
119
127
hash40 ( "common" ) ,
120
- hash40 ( "continue_just_shield_count" ) ,
128
+ hash40 ( "continue_just_shield_count" )
121
129
) ;
122
130
L2CValue :: Bool ( just_shield_count <= max_count)
123
131
}
@@ -126,23 +134,23 @@ pub unsafe fn is_continue_just_shield_count(fighter: &mut L2CFighterCommon) -> L
126
134
pub unsafe fn landing_effect_control ( fighter : & mut L2CFighterCommon ) -> L2CValue {
127
135
WorkModule :: dec_int (
128
136
fighter. module_accessor ,
129
- * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME ,
137
+ * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME
130
138
) ;
131
139
let frame = WorkModule :: get_int (
132
140
fighter. module_accessor ,
133
- * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME ,
141
+ * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME
134
142
) ;
135
143
if frame <= 0 {
136
144
MotionAnimcmdModule :: call_script_single (
137
145
fighter. module_accessor ,
138
146
* FIGHTER_ANIMCMD_EFFECT ,
139
147
Hash40 :: new ( "effect_guardlandingeffect" ) ,
140
- -1 ,
148
+ -1
141
149
) ;
142
150
WorkModule :: set_int (
143
151
fighter. module_accessor ,
144
152
8 ,
145
- * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME ,
153
+ * FIGHTER_STATUS_GUARD_ON_WORK_INT_LANDING_EFFECT_FRAME
146
154
) ;
147
155
}
148
156
L2CValue :: I32 ( 0 )
@@ -155,7 +163,7 @@ pub unsafe fn set_guard_blend_motion(
155
163
delta_y : L2CValue ,
156
164
stick_x : L2CValue ,
157
165
stick_y : L2CValue ,
158
- flag : L2CValue ,
166
+ flag : L2CValue
159
167
) -> L2CValue {
160
168
let magnitude = stick_x. get_f32 ( ) . powi ( 2 ) + stick_y. get_f32 ( ) . powi ( 2 ) ;
161
169
let magnitude = magnitude. sqrt ( ) . min ( 1.0 ) ;
@@ -173,7 +181,7 @@ pub unsafe fn set_guard_blend_motion(
173
181
pub unsafe fn set_guard_blend_motion_angle (
174
182
fighter : & mut L2CFighterCommon ,
175
183
delta_x : L2CValue ,
176
- delta_y : L2CValue ,
184
+ delta_y : L2CValue
177
185
) -> L2CValue {
178
186
let delta_x = delta_x. get_f32 ( ) ;
179
187
let delta_y = delta_y. get_f32 ( ) ;
@@ -195,25 +203,28 @@ pub unsafe fn set_just_shield_scale(fighter: &mut L2CFighterCommon) -> L2CValue
195
203
let shield_size = WorkModule :: get_param_float (
196
204
fighter. module_accessor ,
197
205
hash40 ( "common" ) ,
198
- hash40 ( "shield_size" ) ,
206
+ hash40 ( "shield_size" )
199
207
) ;
200
208
let shield_scale_min = WorkModule :: get_param_float (
201
209
fighter. module_accessor ,
202
210
hash40 ( "common" ) ,
203
- hash40 ( "shield_scale_min" ) ,
211
+ hash40 ( "shield_scale_min" )
212
+ ) ;
213
+ let shield_radius = WorkModule :: get_param_float (
214
+ fighter. module_accessor ,
215
+ hash40 ( "shield_radius" ) ,
216
+ 0
204
217
) ;
205
- let shield_radius =
206
- WorkModule :: get_param_float ( fighter. module_accessor , hash40 ( "shield_radius" ) , 0 ) ;
207
218
208
219
let scale = ( ( 1.0 - shield_scale_min) * shield_size + shield_scale_min) * shield_radius;
209
220
ModelModule :: set_joint_scale (
210
221
fighter. module_accessor ,
211
222
Hash40 :: new ( "throw" ) ,
212
- & Vector3f {
223
+ & ( Vector3f {
213
224
x : scale,
214
225
y : scale,
215
226
z : scale,
216
- } ,
227
+ } )
217
228
) ;
218
229
L2CValue :: I32 ( 0 )
219
230
}
@@ -224,11 +235,11 @@ pub unsafe fn set_shield_scale(fighter: &mut L2CFighterCommon, scale: L2CValue)
224
235
ModelModule :: set_joint_scale (
225
236
fighter. module_accessor ,
226
237
Hash40 :: new ( "throw" ) ,
227
- & Vector3f {
238
+ & ( Vector3f {
228
239
x : scale,
229
240
y : scale,
230
241
z : scale,
231
- } ,
242
+ } )
232
243
) ;
233
244
L2CValue :: I32 ( 0 )
234
245
}
0 commit comments