102 {
106 f32 moveSpeedDamping;
107 f32 moveAngle, moveSpeed;
108 f32 sinAngle, cosAngle;
109 f32 x, y, z;
110 f32 depth;
111
112
113
114
116
118 moveSpeedDamping = 80.0f;
119 } else {
120 moveSpeedDamping = 32.0f;
121 }
122
123 if (moveSpeed != 0.0f) {
124 f32 changeDirDamping = 8.0f;
125 f32 sameDirDamping = 32.0f;
126
127 if (N(InputStickX) * N(InertialStickX) > 0.0f) {
128 N(InertialStickX) += N(InputStickX) / sameDirDamping;
129 } else {
130 N(InertialStickX) += N(InputStickX) / changeDirDamping;
131 }
132 if (N(InputStickX) > 0.0f) {
133 if (N(InputStickX) < N(InertialStickX)) {
134 N(InertialStickX) = N(InputStickX);
135 }
136 } else {
137 if (N(InertialStickX) < N(InputStickX)) {
138 N(InertialStickX) = N(InputStickX);
139 }
140 }
141
142 if (N(InputStickY) * N(InertialStickY) > 0.0f) {
143 N(InertialStickY) += N(InputStickY) / sameDirDamping;
144 } else {
145 N(InertialStickY) += N(InputStickY) / changeDirDamping;
146 }
147 if (N(InputStickY) > 0.0f) {
148 if (N(InputStickY) < N(InertialStickY)) {
149 N(InertialStickY) = N(InputStickY);
150 }
151 } else {
152 if (N(InertialStickY) < N(InputStickY)) {
153 N(InertialStickY) = N(InputStickY);
154 }
155 }
156
158 if (N(InertialMoveSpeed) <= moveSpeed) {
159 N(InertialMoveSpeed) += (moveSpeed - N(InertialMoveSpeed)) / moveSpeedDamping;
160 if (N(InertialMoveSpeed) > moveSpeed) {
161 N(InertialMoveSpeed) = moveSpeed;
162 }
163 } else {
164 N(InertialMoveSpeed) += (moveSpeed - N(InertialMoveSpeed)) / moveSpeedDamping;
165 }
166 moveSpeed = N(InertialMoveSpeed);
167 N(InertialMoveAngle) = moveAngle;
169 N(UnusedMoveX) += ( moveSpeed * sinAngle) / moveSpeedDamping;
170 N(UnusedMoveZ) += (-moveSpeed * cosAngle) / moveSpeedDamping;
171 } else {
172 N(InertialMoveSpeed) -= 0.15;
173 if (N(InertialMoveSpeed) < 0.0f) {
174 N(InertialMoveSpeed) = 0.0f;
175 N(InertialStickY) = 0.0f;
176 N(InertialStickX) = 0.0f;
177 }
178 moveSpeed = N(InertialMoveSpeed);
179 moveAngle = N(InertialMoveAngle);
181 N(UnusedMoveX) = moveSpeed * sinAngle;
182 N(UnusedMoveZ) = -moveSpeed * cosAngle;
183 }
184
185
186
187
189 if (moveSpeed != 0.0f) {
190 sushie->
yaw = moveAngle;
197 {
200 N(TouchDockTime)++;
201 } else {
202 N(TouchDockTime) = 0;
203 }
204 sushie->
pos.
x += (x - sushie->
pos.
x) * 0.5f;
205 sushie->
pos.
z += (z - sushie->
pos.
z) * 0.5f;
206 } else {
209 }
210 moveSpeed = 2.0f;
218 {
219 sushie->
pos.
x += (x - sushie->
pos.
x) / 5.0f;
220 sushie->
pos.
z += (z - sushie->
pos.
z) / 5.0f;
221 }
229 {
230 sushie->
pos.
x += (x - sushie->
pos.
x) / 5.0f;
231 sushie->
pos.
z += (z - sushie->
pos.
z) / 5.0f;
232 }
233 }
234
235
236
237
244 N(DiveTime) = 0;
248 } else {
249 return;
250 }
251 }
252 }
256 }
257 }
258 N(DiveTime)++;
269 }
270 } else {
273 }
274 if (N(DiveTime) % 6 == 0) {
277 }
278 if (N(DiveTime) == 1) {
280 sushie->
curAnim = ANIM_WorldSushie_Ride;
281 }
282 if (!N(IsUnderwater) && (playerStatus->
pos.
y + (playerStatus->
colliderHeight * 0.5f) < N(WaterSurfaceY))) {
283 N(IsUnderwater) = TRUE;
287 }
288 if (N(DiveTime) >= 10) {
290 sushie->
curAnim = ANIM_WorldSushie_Rise;
293 }
294 }
295 }
296
302#if VERSION_JP
304#else
306#endif
307 if (N(DiveTime) % 9 == 0) {
310 }
312 N(ResurfaceVelY) += 0.14;
313 if (N(ResurfaceVelY) > 1.8) {
314 N(ResurfaceVelY) = 1.8f;
315 }
317 if (N(DiveTime) % 9 == 0) {
320 }
322 if (N(IsUnderwater)) {
323 N(IsUnderwater) = FALSE;
326 }
328 sushie->
curAnim = ANIM_WorldSushie_Ride;
331 }
332 }
333}
AnimID trueAnimation
Encoding back-facing sprite.
@ COLLIDER_FLAGS_SURFACE_TYPE_MASK
@ SOUND_ID_TRIGGER_CHANGE_SOUND
void suggest_player_anim_always_forward(AnimID anim)
s32 get_collider_flags(s32 colliderID)
HitID npc_raycast_up_corners(s32 ignoreFlags, f32 *posX, f32 *posY, f32 *posZ, f32 *hitDepth, f32 yaw, f32 radius)
b32 npc_test_move_taller_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
void npc_set_imgfx_params(Npc *npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID)
void set_player_imgfx_all(s32 animID, ImgFXType imgfxType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
PlayerStatus gPlayerStatus
void N test_for_water_level(s32 ignoreFlags, f32 posX, f32 posY, f32 posZ, f32 yaw, f32 radius)
void N get_movement_from_input(f32 *outAngle, f32 *outSpeed)