s32 act_dive_slide(struct MarioState *m) {
if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) {
#if ENABLE_RUMBLE
queue_rumble_data(5, 80);
#endif
return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT,
0);
}
play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
//! If the dive slide ends on the same frame that we pick up on object,
// Mario will not be in the dive slide action for the call to
// mario_check_object_grab, and so will end up in the regular picking action,
// rather than the picking up after dive action.
if (update_sliding(m, 8.0f) && is_anim_at_end(m)) {
mario_set_forward_vel(m, 0.0f);
set_mario_action(m, ACT_STOMACH_SLIDE_STOP, 0);
}
if (mario_check_object_grab(m)) {
mario_grab_used_object(m);
m->marioBodyState->grabPos = GRAB_POS_LIGHT_OBJ;
return TRUE;
}
common_slide_action(m, ACT_STOMACH_SLIDE_STOP, ACT_FREEFALL, MARIO_ANIM_DIVE);
return FALSE;
}