diff --git a/include/sm64.h b/include/sm64.h index f9c44cd092..040ebd23de 100644 --- a/include/sm64.h +++ b/include/sm64.h @@ -262,6 +262,10 @@ enum MarioActionFlags { ACT_FLAG_THROWING = /* 0x80000000 */ (1 << 31), }; +/* State Machine Results */ +#define ACTION_CONTINUE TRUE // Continues running action logic, e.g. after Mario's action changes +#define ACTION_FINISH FALSE // Finishes running action logic for the current frame + #define ACT_UNINITIALIZED 0x00000000 // (0x000) // group 0x000: stationary actions diff --git a/src/game/mario.c b/src/game/mario.c index af26781131..dde8a5b831 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -966,7 +966,7 @@ u32 set_mario_action(struct MarioState *m, u32 action, u32 actionArg) { m->actionState = 0; m->actionTimer = 0; - return TRUE; + return ACTION_CONTINUE; } /** @@ -1021,7 +1021,7 @@ s32 set_jump_from_landing(struct MarioState *m) { m->doubleJumpTimer = 0; - return TRUE; + return ACTION_CONTINUE; } /** @@ -1044,7 +1044,7 @@ s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg) { set_mario_action(m, action, actionArg); } - return TRUE; + return ACTION_CONTINUE; } /** @@ -1083,7 +1083,7 @@ s32 check_common_action_exits(struct MarioState *m) { return set_mario_action(m, ACT_BEGIN_SLIDING, 0); } - return FALSE; + return ACTION_FINISH; } /** @@ -1095,7 +1095,7 @@ s32 check_common_hold_action_exits(struct MarioState *m) { if (m->input & INPUT_OFF_FLOOR ) return set_mario_action(m, ACT_HOLD_FREEFALL, 0); if (m->input & INPUT_NONZERO_ANALOG) return set_mario_action(m, ACT_HOLD_WALKING, 0); if (m->input & INPUT_ABOVE_SLIDE ) return set_mario_action(m, ACT_HOLD_BEGIN_SLIDING, 0); - return FALSE; + return ACTION_FINISH; } /** diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index c6e1526773..e6e8b9af3d 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -130,7 +130,7 @@ s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif - return TRUE; + return ACTION_CONTINUE; } return check_fall_damage(m, hardFallAction); @@ -430,7 +430,7 @@ u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, s32 act_jump(struct MarioState *m) { if (check_kick_or_dive_in_air(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->input & INPUT_Z_PRESSED) { @@ -440,7 +440,7 @@ s32 act_jump(struct MarioState *m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); common_air_action_step(m, ACT_JUMP_LAND, MARIO_ANIM_SINGLE_JUMP, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); - return FALSE; + return ACTION_FINISH; } s32 act_double_jump(struct MarioState *m) { @@ -449,7 +449,7 @@ s32 act_double_jump(struct MarioState *m) { : MARIO_ANIM_DOUBLE_JUMP_FALL; if (check_kick_or_dive_in_air(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->input & INPUT_Z_PRESSED) { @@ -459,7 +459,7 @@ s32 act_double_jump(struct MarioState *m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO); common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); - return FALSE; + return ACTION_FINISH; } s32 act_triple_jump(struct MarioState *m) { @@ -484,7 +484,7 @@ s32 act_triple_jump(struct MarioState *m) { } #endif play_flip_sounds(m, 2, 8, 20); - return FALSE; + return ACTION_FINISH; } s32 act_backflip(struct MarioState *m) { @@ -500,7 +500,7 @@ s32 act_backflip(struct MarioState *m) { } #endif play_flip_sounds(m, 2, 3, 17); - return FALSE; + return ACTION_FINISH; } s32 act_freefall(struct MarioState *m) { @@ -527,7 +527,7 @@ s32 act_freefall(struct MarioState *m) { } common_air_action_step(m, ACT_FREEFALL_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB); - return FALSE; + return ACTION_FINISH; } s32 act_hold_jump(struct MarioState *m) { @@ -546,7 +546,7 @@ s32 act_hold_jump(struct MarioState *m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); common_air_action_step(m, ACT_HOLD_JUMP_LAND, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ, AIR_STEP_CHECK_LEDGE_GRAB); - return FALSE; + return ACTION_FINISH; } s32 act_hold_freefall(struct MarioState *m) { @@ -570,7 +570,7 @@ s32 act_hold_freefall(struct MarioState *m) { } common_air_action_step(m, ACT_HOLD_FREEFALL_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB); - return FALSE; + return ACTION_FINISH; } s32 act_side_flip(struct MarioState *m) { @@ -594,7 +594,7 @@ s32 act_side_flip(struct MarioState *m) { if (m->marioObj->header.gfx.animInfo.animFrame == 6) { play_sound(SOUND_ACTION_SIDE_FLIP_UNK, m->marioObj->header.gfx.cameraToObject); } - return FALSE; + return ACTION_FINISH; } s32 act_wall_kick_air(struct MarioState *m) { @@ -608,7 +608,7 @@ s32 act_wall_kick_air(struct MarioState *m) { play_mario_jump_sound(m); common_air_action_step(m, ACT_JUMP_LAND, MARIO_ANIM_SLIDEJUMP, AIR_STEP_CHECK_LEDGE_GRAB); - return FALSE; + return ACTION_FINISH; } s32 act_long_jump(struct MarioState *m) { @@ -632,7 +632,7 @@ s32 act_long_jump(struct MarioState *m) { queue_rumble_data(5, 40); } #endif - return FALSE; + return ACTION_FINISH; } s32 act_riding_shell_air(struct MarioState *m) { @@ -656,7 +656,7 @@ s32 act_riding_shell_air(struct MarioState *m) { } m->marioObj->header.gfx.pos[1] += 42.0f; - return FALSE; + return ACTION_FINISH; } s32 act_twirling(struct MarioState *m) { @@ -707,7 +707,7 @@ s32 act_twirling(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_dive(struct MarioState *m) { @@ -722,7 +722,7 @@ s32 act_dive(struct MarioState *m) { mario_grab_used_object(m); m->marioBodyState->grabPos = GRAB_POS_LIGHT_OBJ; if (m->action != ACT_DIVE) { - return TRUE; + return ACTION_CONTINUE; } } @@ -774,7 +774,7 @@ s32 act_dive(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_air_throw(struct MarioState *m) { @@ -802,7 +802,7 @@ s32 act_air_throw(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_water_jump(struct MarioState *m) { @@ -834,7 +834,7 @@ s32 act_water_jump(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_hold_water_jump(struct MarioState *m) { @@ -864,7 +864,7 @@ s32 act_hold_water_jump(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_steep_jump(struct MarioState *m) { @@ -894,7 +894,7 @@ s32 act_steep_jump(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_SINGLE_JUMP); m->marioObj->header.gfx.angle[1] = m->marioObj->oMarioSteepJumpYaw; - return FALSE; + return ACTION_FINISH; } s32 act_ground_pound(struct MarioState *m) { @@ -961,7 +961,7 @@ s32 act_ground_pound(struct MarioState *m) { #endif } - return FALSE; + return ACTION_FINISH; } s32 act_burning_jump(struct MarioState *m) { @@ -986,7 +986,7 @@ s32 act_burning_jump(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_burning_fall(struct MarioState *m) { @@ -1008,7 +1008,7 @@ s32 act_burning_fall(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_crazy_box_bounce(struct MarioState *m) { @@ -1072,7 +1072,7 @@ s32 act_crazy_box_bounce(struct MarioState *m) { } m->marioObj->header.gfx.angle[0] = atan2s(m->forwardVel, -m->vel[1]); - return FALSE; + return ACTION_FINISH; } u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFallAction, s32 animation, @@ -1132,34 +1132,34 @@ s32 check_wall_kick(struct MarioState *m) { s32 act_backward_air_kb(struct MarioState *m) { if (check_wall_kick(m)) { - return TRUE; + return ACTION_CONTINUE; } play_knockback_sound(m); common_air_knockback_step(m, ACT_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, -16.0f); - return FALSE; + return ACTION_FINISH; } s32 act_forward_air_kb(struct MarioState *m) { if (check_wall_kick(m)) { - return TRUE; + return ACTION_CONTINUE; } play_knockback_sound(m); common_air_knockback_step(m, ACT_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, MARIO_ANIM_AIR_FORWARD_KB, 16.0f); - return FALSE; + return ACTION_FINISH; } s32 act_hard_backward_air_kb(struct MarioState *m) { play_knockback_sound(m); common_air_knockback_step(m, ACT_HARD_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, -16.0f); - return FALSE; + return ACTION_FINISH; } s32 act_hard_forward_air_kb(struct MarioState *m) { play_knockback_sound(m); common_air_knockback_step(m, ACT_HARD_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, MARIO_ANIM_AIR_FORWARD_KB, 16.0f); - return FALSE; + return ACTION_FINISH; } s32 act_thrown_backward(struct MarioState *m) { @@ -1175,7 +1175,7 @@ s32 act_thrown_backward(struct MarioState *m) { common_air_knockback_step(m, landAction, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, m->forwardVel); m->forwardVel *= 0.98f; - return FALSE; + return ACTION_FINISH; } s32 act_thrown_forward(struct MarioState *m) { @@ -1200,18 +1200,18 @@ s32 act_thrown_forward(struct MarioState *m) { } m->forwardVel *= 0.98f; - return FALSE; + return ACTION_FINISH; } s32 act_soft_bonk(struct MarioState *m) { if (check_wall_kick(m)) { - return TRUE; + return ACTION_CONTINUE; } play_knockback_sound(m); common_air_knockback_step(m, ACT_FREEFALL_LAND, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_GENERAL_FALL, m->forwardVel); - return FALSE; + return ACTION_FINISH; } s32 act_getting_blown(struct MarioState *m) { @@ -1256,7 +1256,7 @@ s32 act_getting_blown(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_air_hit_wall(struct MarioState *m) { @@ -1292,7 +1292,7 @@ s32 act_air_hit_wall(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_START_WALLKICK); - return TRUE; + return ACTION_CONTINUE; } s32 act_forward_rollout(struct MarioState *m) { @@ -1333,7 +1333,7 @@ s32 act_forward_rollout(struct MarioState *m) { if (m->actionState == 1 && is_anim_past_end(m)) { m->actionState = 2; } - return FALSE; + return ACTION_FINISH; } s32 act_backward_rollout(struct MarioState *m) { @@ -1374,7 +1374,7 @@ s32 act_backward_rollout(struct MarioState *m) { if (m->actionState == 1 && m->marioObj->header.gfx.animInfo.animFrame == 2) { m->actionState = 2; } - return FALSE; + return ACTION_FINISH; } s32 act_butt_slide_air(struct MarioState *m) { @@ -1409,7 +1409,7 @@ s32 act_butt_slide_air(struct MarioState *m) { } set_mario_animation(m, MARIO_ANIM_SLIDE); - return FALSE; + return ACTION_FINISH; } s32 act_hold_butt_slide_air(struct MarioState *m) { @@ -1450,7 +1450,7 @@ s32 act_hold_butt_slide_air(struct MarioState *m) { } set_mario_animation(m, MARIO_ANIM_SLIDING_ON_BOTTOM_WITH_LIGHT_OBJ); - return FALSE; + return ACTION_FINISH; } s32 act_lava_boost(struct MarioState *m) { @@ -1519,7 +1519,7 @@ s32 act_lava_boost(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_slide_kick(struct MarioState *m) { @@ -1570,7 +1570,7 @@ s32 act_slide_kick(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_jump_kick(struct MarioState *m) { @@ -1603,7 +1603,7 @@ s32 act_jump_kick(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_shot_from_cannon(struct MarioState *m) { @@ -1663,7 +1663,7 @@ s32 act_shot_from_cannon(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_flying(struct MarioState *m) { @@ -1785,7 +1785,7 @@ s32 act_flying(struct MarioState *m) { play_sound(SOUND_MOVING_FLYING, m->marioObj->header.gfx.cameraToObject); adjust_sound_for_speed(m); - return FALSE; + return ACTION_FINISH; } s32 act_riding_hoot(struct MarioState *m) { @@ -1817,7 +1817,7 @@ s32 act_riding_hoot(struct MarioState *m) { vec3f_set(m->vel, 0.0f, 0.0f, 0.0f); vec3f_set(m->marioObj->header.gfx.pos, m->pos[0], m->pos[1], m->pos[2]); vec3s_set(m->marioObj->header.gfx.angle, 0, 0x4000 - m->faceAngle[1], 0); - return FALSE; + return ACTION_FINISH; } s32 act_flying_triple_jump(struct MarioState *m) { @@ -1887,13 +1887,13 @@ s32 act_flying_triple_jump(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_top_of_pole_jump(struct MarioState *m) { play_mario_jump_sound(m); common_air_action_step(m, ACT_FREEFALL_LAND, MARIO_ANIM_HANDSTAND_JUMP, AIR_STEP_CHECK_LEDGE_GRAB); - return FALSE; + return ACTION_FINISH; } s32 act_vertical_wind(struct MarioState *m) { @@ -1931,7 +1931,7 @@ s32 act_vertical_wind(struct MarioState *m) { m->marioObj->header.gfx.angle[0] = (s16)(6144.0f * intendedMag * coss(intendedDYaw)); m->marioObj->header.gfx.angle[2] = (s16)(-4096.0f * intendedMag * sins(intendedDYaw)); - return FALSE; + return ACTION_FINISH; } s32 act_special_triple_jump(struct MarioState *m) { @@ -1971,7 +1971,7 @@ s32 act_special_triple_jump(struct MarioState *m) { } m->particleFlags |= PARTICLE_SPARKLES; - return FALSE; + return ACTION_FINISH; } s32 check_common_airborne_cancels(struct MarioState *m) { @@ -1988,14 +1988,14 @@ s32 check_common_airborne_cancels(struct MarioState *m) { } m->quicksandDepth = 0.0f; - return FALSE; + return ACTION_FINISH; } s32 mario_execute_airborne_action(struct MarioState *m) { - u32 cancel = FALSE; + u32 cancel = ACTION_FINISH; if (check_common_airborne_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } #ifndef NO_FALL_DAMAGE_SOUND diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 6fd5ea36bc..d100f5b789 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -146,7 +146,7 @@ s32 act_holding_pole(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_IDLE_ON_POLE); } - return FALSE; + return ACTION_FINISH; } s32 act_climbing_pole(struct MarioState *m) { @@ -180,7 +180,7 @@ s32 act_climbing_pole(struct MarioState *m) { play_climbing_sounds(m, 1); } - return FALSE; + return ACTION_FINISH; } s32 act_grab_pole_slow(struct MarioState *m) { @@ -194,7 +194,7 @@ s32 act_grab_pole_slow(struct MarioState *m) { add_tree_leaf_particles(m); } - return FALSE; + return ACTION_FINISH; } s32 act_grab_pole_fast(struct MarioState *m) { @@ -215,7 +215,7 @@ s32 act_grab_pole_fast(struct MarioState *m) { add_tree_leaf_particles(m); } - return FALSE; + return ACTION_FINISH; } s32 act_top_of_pole_transition(struct MarioState *m) { @@ -234,7 +234,7 @@ s32 act_top_of_pole_transition(struct MarioState *m) { } set_pole_position(m, return_mario_anim_y_translation(m)); - return FALSE; + return ACTION_FINISH; } s32 act_top_of_pole(struct MarioState *m) { @@ -249,7 +249,7 @@ s32 act_top_of_pole(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_HANDSTAND_IDLE); set_pole_position(m, return_mario_anim_y_translation(m)); - return FALSE; + return ACTION_FINISH; } s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos) { @@ -404,7 +404,7 @@ s32 act_start_hanging(struct MarioState *m) { set_mario_action(m, ACT_HANGING, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_hanging(struct MarioState *m) { @@ -440,7 +440,7 @@ s32 act_hanging(struct MarioState *m) { update_hang_stationary(m); - return FALSE; + return ACTION_FINISH; } s32 act_hang_moving(struct MarioState *m) { @@ -507,7 +507,7 @@ s32 act_hang_moving(struct MarioState *m) { } #endif - return FALSE; + return ACTION_FINISH; } s32 let_go_of_ledge(struct MarioState *m) { @@ -610,7 +610,7 @@ s32 act_ledge_grab(struct MarioState *m) { stop_and_set_height_to_floor(m); set_mario_animation(m, MARIO_ANIM_IDLE_ON_LEDGE); - return FALSE; + return ACTION_FINISH; } s32 act_ledge_climb_slow(struct MarioState *m) { @@ -636,7 +636,7 @@ s32 act_ledge_climb_slow(struct MarioState *m) { m->action = ACT_LEDGE_CLIMB_SLOW_2; } - return FALSE; + return ACTION_FINISH; } s32 act_ledge_climb_down(struct MarioState *m) { @@ -649,7 +649,7 @@ s32 act_ledge_climb_down(struct MarioState *m) { update_ledge_climb(m, MARIO_ANIM_CLIMB_DOWN_LEDGE, ACT_LEDGE_GRAB); m->actionArg = 1; - return FALSE; + return ACTION_FINISH; } s32 act_ledge_climb_fast(struct MarioState *m) { @@ -666,7 +666,7 @@ s32 act_ledge_climb_fast(struct MarioState *m) { } update_ledge_climb_camera(m); - return FALSE; + return ACTION_FINISH; } s32 act_grabbed(struct MarioState *m) { @@ -684,7 +684,7 @@ s32 act_grabbed(struct MarioState *m) { } set_mario_animation(m, MARIO_ANIM_BEING_GRABBED); - return FALSE; + return ACTION_FINISH; } s32 act_in_cannon(struct MarioState *m) { @@ -751,7 +751,7 @@ s32 act_in_cannon(struct MarioState *m) { queue_rumble_data(60, 70); #endif m->usedObj->oAction = OPENED_CANNON_ACT_SHOOT; - return FALSE; + return ACTION_FINISH; } else if (m->faceAngle[0] != startFacePitch || m->faceAngle[1] != startFaceYaw) { play_sound(SOUND_MOVING_AIM_CANNON, marioObj->header.gfx.cameraToObject); #if ENABLE_RUMBLE @@ -764,7 +764,7 @@ s32 act_in_cannon(struct MarioState *m) { vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); set_mario_animation(m, MARIO_ANIM_DIVE); - return FALSE; + return ACTION_FINISH; } s32 act_tornado_twirling(struct MarioState *m) { @@ -844,7 +844,7 @@ s32 act_tornado_twirling(struct MarioState *m) { reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 check_common_automatic_cancels(struct MarioState *m) { @@ -852,14 +852,14 @@ s32 check_common_automatic_cancels(struct MarioState *m) { return set_water_plunge_action(m); } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_automatic_action(struct MarioState *m) { - s32 cancel = FALSE; + s32 cancel = ACTION_FINISH; if (check_common_automatic_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } m->quicksandDepth = 0.0f; diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index e09a64b4ac..3524076f94 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -374,7 +374,7 @@ s32 act_reading_npc_dialog(struct MarioState *m) { m->actionState++; } - return FALSE; + return ACTION_FINISH; } // puts Mario in a state where he's waiting for (npc) dialog; doesn't do much @@ -383,7 +383,7 @@ s32 act_waiting_for_dialog(struct MarioState *m) { : MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); - return FALSE; + return ACTION_FINISH; } // makes Mario disappear and triggers warp @@ -397,7 +397,7 @@ s32 act_disappeared(struct MarioState *m) { level_trigger_warp(m, m->actionArg >> 16); } } - return FALSE; + return ACTION_FINISH; } s32 act_reading_automatic_dialog(struct MarioState *m) { @@ -450,7 +450,7 @@ s32 act_reading_automatic_dialog(struct MarioState *m) { } // apply head turn vec3s_set(m->marioBodyState->headAngle, m->actionTimer, 0, 0); - return FALSE; + return ACTION_FINISH; } s32 act_reading_sign(struct MarioState *m) { @@ -492,7 +492,7 @@ s32 act_reading_sign(struct MarioState *m) { vec3f_copy(marioObj->header.gfx.pos, m->pos); vec3s_set(marioObj->header.gfx.angle, 0x0, m->faceAngle[1], 0x0); - return FALSE; + return ACTION_FINISH; } s32 act_debug_free_move(struct MarioState *m) { @@ -549,7 +549,7 @@ s32 act_debug_free_move(struct MarioState *m) { f32 floorHeight = find_floor(pos[0], pos[1], pos[2], &floor); f32 ceilHeight = find_mario_ceil(pos, floorHeight, &ceil); - if (floor == NULL) return FALSE; + if (floor == NULL) return ACTION_FINISH; if (ceilHeight - floorHeight >= 160.0f) { if (floor != NULL && pos[1] < floorHeight) { @@ -565,7 +565,7 @@ s32 act_debug_free_move(struct MarioState *m) { vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); - return FALSE; + return ACTION_FINISH; } void general_star_dance_handler(struct MarioState *m, s32 isInWater) { @@ -638,7 +638,7 @@ s32 act_star_dance(struct MarioState *m) { m->marioBodyState->handState = MARIO_HAND_PEACE_SIGN; } stop_and_set_height_to_floor(m); - return FALSE; + return ACTION_FINISH; } s32 act_star_dance_water(struct MarioState *m) { @@ -651,7 +651,7 @@ s32 act_star_dance_water(struct MarioState *m) { if (m->actionState != ACT_STATE_STAR_DANCE_RETURN && m->actionTimer >= 62) { m->marioBodyState->handState = MARIO_HAND_PEACE_SIGN; } - return FALSE; + return ACTION_FINISH; } s32 act_fall_after_star_grab(struct MarioState *m) { @@ -666,7 +666,7 @@ s32 act_fall_after_star_grab(struct MarioState *m) { m->actionArg); } set_mario_animation(m, MARIO_ANIM_GENERAL_FALL); - return FALSE; + return ACTION_FINISH; } s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWarp) { @@ -692,19 +692,19 @@ s32 act_standing_death(struct MarioState *m) { if (m->marioObj->header.gfx.animInfo.animFrame == 77) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); } - return FALSE; + return ACTION_FINISH; } s32 act_electrocution(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); common_death_handler(m, MARIO_ANIM_ELECTROCUTION, 43); - return FALSE; + return ACTION_FINISH; } s32 act_suffocation(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); common_death_handler(m, MARIO_ANIM_SUFFOCATING, 86); - return FALSE; + return ACTION_FINISH; } s32 act_death_on_back(struct MarioState *m) { @@ -712,7 +712,7 @@ s32 act_death_on_back(struct MarioState *m) { if (common_death_handler(m, MARIO_ANIM_DYING_ON_BACK, 54) == 40) { play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); } - return FALSE; + return ACTION_FINISH; } s32 act_death_on_stomach(struct MarioState *m) { @@ -720,7 +720,7 @@ s32 act_death_on_stomach(struct MarioState *m) { if (common_death_handler(m, MARIO_ANIM_DYING_ON_STOMACH, 37) == 37) { play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); } - return FALSE; + return ACTION_FINISH; } s32 act_quicksand_death(struct MarioState *m) { @@ -740,7 +740,7 @@ s32 act_quicksand_death(struct MarioState *m) { } stationary_ground_step(m); play_sound(SOUND_MOVING_QUICKSAND_DEATH, m->marioObj->header.gfx.cameraToObject); - return FALSE; + return ACTION_FINISH; } s32 act_eaten_by_bubba(struct MarioState *m) { @@ -754,7 +754,7 @@ s32 act_eaten_by_bubba(struct MarioState *m) { if (m->actionTimer++ == 60) { level_trigger_warp(m, WARP_OP_DEATH); } - return FALSE; + return ACTION_FINISH; } // set animation and forwardVel; when perform_air_step returns AIR_STEP_LANDED, @@ -809,7 +809,7 @@ s32 act_unlocking_key_door(struct MarioState *m) { } m->actionTimer++; - return FALSE; + return ACTION_FINISH; } s32 act_unlocking_star_door(struct MarioState *m) { @@ -850,7 +850,7 @@ s32 act_unlocking_star_door(struct MarioState *m) { update_mario_pos_for_anim(m); stop_and_set_height_to_floor(m); - return FALSE; + return ACTION_FINISH; } s32 act_entering_star_door(struct MarioState *m) { @@ -911,7 +911,7 @@ s32 act_entering_star_door(struct MarioState *m) { set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_going_through_door(struct MarioState *m) { @@ -943,7 +943,7 @@ s32 act_going_through_door(struct MarioState *m) { } m->actionTimer++; - return FALSE; + return ACTION_FINISH; } s32 act_warp_door_spawn(struct MarioState *m) { @@ -967,7 +967,7 @@ s32 act_warp_door_spawn(struct MarioState *m) { } set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); stop_and_set_height_to_floor(m); - return FALSE; + return ACTION_FINISH; } s32 act_emerge_from_pipe(struct MarioState *m) { @@ -975,7 +975,7 @@ s32 act_emerge_from_pipe(struct MarioState *m) { if (m->actionTimer++ < 11) { marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; - return FALSE; + return ACTION_FINISH; } marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; @@ -995,7 +995,7 @@ s32 act_emerge_from_pipe(struct MarioState *m) { mario_set_forward_vel(m, 0.0f); play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); } - return FALSE; + return ACTION_FINISH; } s32 act_spawn_spin_airborne(struct MarioState *m) { @@ -1027,7 +1027,7 @@ s32 act_spawn_spin_airborne(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_GENERAL_FALL); } - return FALSE; + return ACTION_FINISH; } s32 act_spawn_spin_landing(struct MarioState *m) { @@ -1037,7 +1037,7 @@ s32 act_spawn_spin_landing(struct MarioState *m) { load_level_init_text(0); set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } /** @@ -1062,7 +1062,7 @@ s32 act_exit_airborne(struct MarioState *m) { // rotate him to face away from the entrance m->marioObj->header.gfx.angle[1] += 0x8000; m->particleFlags |= PARTICLE_SPARKLES; - return FALSE; + return ACTION_FINISH; } s32 act_falling_exit_airborne(struct MarioState *m) { @@ -1076,7 +1076,7 @@ s32 act_falling_exit_airborne(struct MarioState *m) { // rotate Mario to face away from the entrance m->marioObj->header.gfx.angle[1] += 0x8000; m->particleFlags |= PARTICLE_SPARKLES; - return FALSE; + return ACTION_FINISH; } s32 act_exit_land_save_dialog(struct MarioState *m) { @@ -1155,7 +1155,7 @@ s32 act_exit_land_save_dialog(struct MarioState *m) { } m->marioObj->header.gfx.angle[1] += 0x8000; - return FALSE; + return ACTION_FINISH; } s32 act_death_exit(struct MarioState *m) { @@ -1176,7 +1176,7 @@ s32 act_death_exit(struct MarioState *m) { #ifdef BREATH_METER m->breath = 0x880; #endif - return FALSE; + return ACTION_FINISH; } s32 act_unused_death_exit(struct MarioState *m) { @@ -1193,7 +1193,7 @@ s32 act_unused_death_exit(struct MarioState *m) { #ifdef BREATH_METER m->breath = 0x880; #endif - return FALSE; + return ACTION_FINISH; } s32 act_falling_death_exit(struct MarioState *m) { @@ -1213,7 +1213,7 @@ s32 act_falling_death_exit(struct MarioState *m) { #ifdef BREATH_METER m->breath = 0x880; #endif - return FALSE; + return ACTION_FINISH; } // waits 11 frames before actually executing, also has reduced fvel @@ -1227,7 +1227,7 @@ s32 act_special_exit_airborne(struct MarioState *m) { if (m->actionTimer++ < 11) { marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; - return FALSE; + return ACTION_FINISH; } if (launch_mario_until_land(m, ACT_EXIT_LAND_SAVE_DIALOG, MARIO_ANIM_SINGLE_JUMP, -24.0f)) { @@ -1242,7 +1242,7 @@ s32 act_special_exit_airborne(struct MarioState *m) { // show Mario marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; - return FALSE; + return ACTION_FINISH; } s32 act_special_death_exit(struct MarioState *m) { @@ -1250,7 +1250,7 @@ s32 act_special_death_exit(struct MarioState *m) { if (m->actionTimer++ < 11) { marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; - return FALSE; + return ACTION_FINISH; } if (launch_mario_until_land(m, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, -24.0f)) { @@ -1270,7 +1270,7 @@ s32 act_special_death_exit(struct MarioState *m) { m->breath = 0x880; #endif - return FALSE; + return ACTION_FINISH; } s32 act_spawn_no_spin_airborne(struct MarioState *m) { @@ -1278,7 +1278,7 @@ s32 act_spawn_no_spin_airborne(struct MarioState *m) { if (m->pos[1] < m->waterLevel - 100) { set_water_plunge_action(m); } - return FALSE; + return ACTION_FINISH; } s32 act_spawn_no_spin_landing(struct MarioState *m) { @@ -1289,7 +1289,7 @@ s32 act_spawn_no_spin_landing(struct MarioState *m) { load_level_init_text(0); set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_bbh_enter_spin(struct MarioState *m) { @@ -1370,7 +1370,7 @@ s32 act_bbh_enter_spin(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_bbh_enter_jump(struct MarioState *m) { @@ -1398,7 +1398,7 @@ s32 act_bbh_enter_jump(struct MarioState *m) { set_mario_action(m, ACT_BBH_ENTER_SPIN, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_teleport_fade_out(struct MarioState *m) { @@ -1425,7 +1425,7 @@ s32 act_teleport_fade_out(struct MarioState *m) { stop_and_set_height_to_floor(m); - return FALSE; + return ACTION_FINISH; } s32 act_teleport_fade_in(struct MarioState *m) { @@ -1461,7 +1461,7 @@ s32 act_teleport_fade_in(struct MarioState *m) { m->pos[1] = m->floorHeight; stop_and_set_height_to_floor(m); - return FALSE; + return ACTION_FINISH; } s32 act_shocked(struct MarioState *m) { @@ -1488,7 +1488,7 @@ s32 act_shocked(struct MarioState *m) { stop_and_set_height_to_floor(m); } - return FALSE; + return ACTION_FINISH; } s32 act_squished(struct MarioState *m) { @@ -1572,7 +1572,7 @@ s32 act_squished(struct MarioState *m) { // instant un-squish m->squishTimer = 0; set_mario_action(m, ACT_IDLE, 0); - return FALSE; + return ACTION_FINISH; } } @@ -1587,7 +1587,7 @@ s32 act_squished(struct MarioState *m) { } stop_and_set_height_to_floor(m); set_mario_animation(m, MARIO_ANIM_A_POSE); - return FALSE; + return ACTION_FINISH; } s32 act_putting_on_cap(struct MarioState *m) { @@ -1607,7 +1607,7 @@ s32 act_putting_on_cap(struct MarioState *m) { } stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFrame, s32 target2, @@ -1642,17 +1642,17 @@ void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFra s32 act_head_stuck_in_ground(struct MarioState *m) { stuck_in_ground_handler(m, MARIO_ANIM_HEAD_STUCK_IN_GROUND, 96, 105, 135, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_butt_stuck_in_ground(struct MarioState *m) { stuck_in_ground_handler(m, MARIO_ANIM_BOTTOM_STUCK_IN_GROUND, 127, 136, -2, ACT_GROUND_POUND_LAND); - return FALSE; + return ACTION_FINISH; } s32 act_feet_stuck_in_ground(struct MarioState *m) { stuck_in_ground_handler(m, MARIO_ANIM_LEGS_STUCK_IN_GROUND, 116, 129, -2, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } /** @@ -1793,7 +1793,7 @@ static s32 act_intro_cutscene(struct MarioState *m) { intro_cutscene_set_mario_to_idle(m); break; } - return FALSE; + return ACTION_FINISH; } // jumbo star cutscene: Mario lands after grabbing the jumbo star @@ -1934,7 +1934,7 @@ static s32 act_jumbo_star_cutscene(struct MarioState *m) { jumbo_star_cutscene_flying(m); break; } - return FALSE; + return ACTION_FINISH; } void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius) { @@ -2516,7 +2516,7 @@ static s32 act_end_peach_cutscene(struct MarioState *m) { sEndCutsceneVp.vp.vtrans[1] = SCREEN_HEIGHT * 2; override_viewport_and_clip(NULL, &sEndCutsceneVp, 0, 0, 0); - return FALSE; + return ACTION_FINISH; } #define TIMER_CREDITS_SHOW 61 @@ -2574,7 +2574,7 @@ static s32 act_credits_cutscene(struct MarioState *m) { m->marioObj->header.gfx.angle[1] += (gCurrCreditsEntry->actNum & 0xC0) << 8; - return FALSE; + return ACTION_FINISH; } static s32 act_end_waving_cutscene(struct MarioState *m) { @@ -2612,7 +2612,7 @@ static s32 act_end_waving_cutscene(struct MarioState *m) { level_trigger_warp(m, WARP_OP_CREDITS_END); } - return FALSE; + return ACTION_FINISH; } static s32 check_for_instant_quicksand(struct MarioState *m) { @@ -2621,14 +2621,14 @@ static s32 check_for_instant_quicksand(struct MarioState *m) { update_mario_sound_and_camera(m); return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0); } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_cutscene_action(struct MarioState *m) { s32 cancel; if (check_for_instant_quicksand(m)) { - return TRUE; + return ACTION_CONTINUE; } /* clang-format off */ diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index 67cd50fa92..98d8a0ecc1 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -775,7 +775,7 @@ s32 act_walking(struct MarioState *m) { } if (check_ground_dive_or_punch(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->input & INPUT_IDLE) { @@ -820,7 +820,7 @@ s32 act_walking(struct MarioState *m) { check_ledge_climb_down(m); tilt_body_walking(m, startYaw); - return FALSE; + return ACTION_FINISH; } s32 act_move_punching(struct MarioState *m) { @@ -855,7 +855,7 @@ s32 act_move_punching(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } s32 act_hold_walking(struct MarioState *m) { @@ -909,7 +909,7 @@ s32 act_hold_walking(struct MarioState *m) { m->particleFlags |= PARTICLE_DUST; } - return FALSE; + return ACTION_FINISH; } s32 act_hold_heavy_walking(struct MarioState *m) { @@ -942,7 +942,7 @@ s32 act_hold_heavy_walking(struct MarioState *m) { } anim_and_audio_for_heavy_walk(m); - return FALSE; + return ACTION_FINISH; } s32 act_turning_around(struct MarioState *m) { @@ -993,7 +993,7 @@ s32 act_turning_around(struct MarioState *m) { } } - return FALSE; + return ACTION_FINISH; } s32 act_finish_turning_around(struct MarioState *m) { @@ -1032,7 +1032,7 @@ s32 act_finish_turning_around(struct MarioState *m) { #else m->marioObj->header.gfx.angle[1] += 0x8000; #endif - return FALSE; + return ACTION_FINISH; } s32 act_braking(struct MarioState *m) { @@ -1067,7 +1067,7 @@ s32 act_braking(struct MarioState *m) { play_sound(SOUND_MOVING_TERRAIN_SLIDE + m->terrainSoundAddend, m->marioObj->header.gfx.cameraToObject); adjust_sound_for_speed(m); set_mario_animation(m, MARIO_ANIM_SKID_ON_GROUND); - return FALSE; + return ACTION_FINISH; } s32 act_decelerating(struct MarioState *m) { @@ -1083,7 +1083,7 @@ s32 act_decelerating(struct MarioState *m) { } if (check_ground_dive_or_punch(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->input & INPUT_NONZERO_ANALOG) { @@ -1129,7 +1129,7 @@ s32 act_decelerating(struct MarioState *m) { play_step_sound(m, 10, 49); } - return FALSE; + return ACTION_FINISH; } s32 act_hold_decelerating(struct MarioState *m) { @@ -1195,7 +1195,7 @@ s32 act_hold_decelerating(struct MarioState *m) { play_step_sound(m, 12, 62); } - return FALSE; + return ACTION_FINISH; } s32 act_riding_shell_ground(struct MarioState *m) { @@ -1242,7 +1242,7 @@ s32 act_riding_shell_ground(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } s32 act_crawling(struct MarioState *m) { @@ -1259,7 +1259,7 @@ s32 act_crawling(struct MarioState *m) { } if (check_ground_dive_or_punch(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->input & INPUT_IDLE) { @@ -1294,7 +1294,7 @@ s32 act_crawling(struct MarioState *m) { s32 animSpeed = (s32)(m->intendedMag * 2.0f * 0x10000); set_mario_anim_with_accel(m, MARIO_ANIM_CRAWLING, animSpeed); play_step_sound(m, 26, 79); - return FALSE; + return ACTION_FINISH; } s32 act_burning_ground(struct MarioState *m) { @@ -1346,7 +1346,7 @@ s32 act_burning_ground(struct MarioState *m) { #if ENABLE_RUMBLE reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } void tilt_body_butt_slide(struct MarioState *m) { @@ -1434,7 +1434,7 @@ s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jump } common_slide_action(m, stopAction, airAction, animation); - return FALSE; + return ACTION_FINISH; } s32 act_butt_slide(struct MarioState *m) { @@ -1517,7 +1517,7 @@ s32 act_slide_kick_slide(struct MarioState *m) { play_sound(SOUND_MOVING_TERRAIN_SLIDE + m->terrainSoundAddend, m->marioObj->header.gfx.cameraToObject); m->particleFlags |= PARTICLE_DUST; - return FALSE; + return ACTION_FINISH; } s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation) { @@ -1538,7 +1538,7 @@ s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s3 } common_slide_action(m, stopAction, airAction, animation); - return FALSE; + return ACTION_FINISH; } s32 act_stomach_slide(struct MarioState *m) { @@ -1577,11 +1577,11 @@ s32 act_dive_slide(struct MarioState *m) { if (mario_check_object_grab(m)) { mario_grab_used_object(m); m->marioBodyState->grabPos = GRAB_POS_LIGHT_OBJ; - return TRUE; + return ACTION_CONTINUE; } common_slide_action(m, ACT_STOMACH_SLIDE_STOP, ACT_FREEFALL, MARIO_ANIM_DIVE); - return FALSE; + return ACTION_FINISH; } s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 checkFrame, s32 playLandingSound, s32 actionArg) { @@ -1646,7 +1646,7 @@ s32 act_hard_backward_ground_kb(struct MarioState *m) { play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_LANDING); } - return FALSE; + return ACTION_FINISH; } s32 act_hard_forward_ground_kb(struct MarioState *m) { @@ -1656,27 +1656,27 @@ s32 act_hard_forward_ground_kb(struct MarioState *m) { set_mario_action(m, ACT_DEATH_ON_STOMACH, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_backward_ground_kb(struct MarioState *m) { common_ground_knockback_action(m, MARIO_ANIM_BACKWARD_KB, 22, TRUE, m->actionArg); - return FALSE; + return ACTION_FINISH; } s32 act_forward_ground_kb(struct MarioState *m) { common_ground_knockback_action(m, MARIO_ANIM_FORWARD_KB, 20, TRUE, m->actionArg); - return FALSE; + return ACTION_FINISH; } s32 act_soft_backward_ground_kb(struct MarioState *m) { common_ground_knockback_action(m, MARIO_ANIM_SOFT_BACK_KB, 100, FALSE, m->actionArg); - return FALSE; + return ACTION_FINISH; } s32 act_soft_forward_ground_kb(struct MarioState *m) { common_ground_knockback_action(m, MARIO_ANIM_SOFT_FRONT_KB, 100, FALSE, m->actionArg); - return FALSE; + return ACTION_FINISH; } s32 act_ground_bonk(struct MarioState *m) { @@ -1685,7 +1685,7 @@ s32 act_ground_bonk(struct MarioState *m) { if (animFrame == 32) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); } - return FALSE; + return ACTION_FINISH; } s32 act_death_exit_land(struct MarioState *m) { @@ -1707,7 +1707,7 @@ s32 act_death_exit_land(struct MarioState *m) { set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } u32 common_landing_action(struct MarioState *m, s16 animation, u32 airAction) { @@ -1777,36 +1777,36 @@ s32 common_landing_cancels(struct MarioState *m, struct LandingAction *landingAc return set_mario_action(m, landingAction->offFloorAction, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_jump_land(struct MarioState *m) { if (common_landing_cancels(m, &sJumpLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } common_landing_action(m, MARIO_ANIM_LAND_FROM_SINGLE_JUMP, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_freefall_land(struct MarioState *m) { if (common_landing_cancels(m, &sFreefallLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } common_landing_action(m, MARIO_ANIM_GENERAL_LAND, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_side_flip_land(struct MarioState *m) { if (common_landing_cancels(m, &sSideFlipLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } if (common_landing_action(m, MARIO_ANIM_SLIDEFLIP_LAND, ACT_FREEFALL) != GROUND_STEP_HIT_WALL) { m->marioObj->header.gfx.angle[1] += 0x8000; } - return FALSE; + return ACTION_FINISH; } s32 act_hold_jump_land(struct MarioState *m) { @@ -1815,11 +1815,11 @@ s32 act_hold_jump_land(struct MarioState *m) { } if (common_landing_cancels(m, &sHoldJumpLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } common_landing_action(m, MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, ACT_HOLD_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_hold_freefall_land(struct MarioState *m) { @@ -1828,11 +1828,11 @@ s32 act_hold_freefall_land(struct MarioState *m) { } if (common_landing_cancels(m, &sHoldFreefallLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } common_landing_action(m, MARIO_ANIM_FALL_LAND_WITH_LIGHT_OBJ, ACT_HOLD_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_long_jump_land(struct MarioState *m) { @@ -1848,7 +1848,7 @@ s32 act_long_jump_land(struct MarioState *m) { } if (common_landing_cancels(m, &sLongJumpLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } if (!(m->input & INPUT_NONZERO_ANALOG)) { @@ -1859,22 +1859,22 @@ s32 act_long_jump_land(struct MarioState *m) { !m->marioObj->oMarioLongJumpIsSlow ? MARIO_ANIM_CROUCH_FROM_FAST_LONGJUMP : MARIO_ANIM_CROUCH_FROM_SLOW_LONGJUMP, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_double_jump_land(struct MarioState *m) { if (common_landing_cancels(m, &sDoubleJumpLandAction, set_triple_jump_action)) { - return TRUE; + return ACTION_CONTINUE; } common_landing_action(m, MARIO_ANIM_LAND_FROM_DOUBLE_JUMP, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_triple_jump_land(struct MarioState *m) { m->input &= ~INPUT_A_PRESSED; if (common_landing_cancels(m, &sTripleJumpLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } if (!(m->input & INPUT_NONZERO_ANALOG)) { @@ -1882,7 +1882,7 @@ s32 act_triple_jump_land(struct MarioState *m) { } common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 act_backflip_land(struct MarioState *m) { @@ -1891,7 +1891,7 @@ s32 act_backflip_land(struct MarioState *m) { } if (common_landing_cancels(m, &sBackflipLandAction, set_jumping_action)) { - return TRUE; + return ACTION_CONTINUE; } if (!(m->input & INPUT_NONZERO_ANALOG)) { @@ -1899,7 +1899,7 @@ s32 act_backflip_land(struct MarioState *m) { } common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL); - return FALSE; + return ACTION_FINISH; } s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, @@ -1925,7 +1925,7 @@ s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animati set_mario_action(m, airAction, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_quicksand_jump_land(struct MarioState *m) { @@ -1961,18 +1961,18 @@ s32 check_common_moving_cancels(struct MarioState *m) { } } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_moving_action(struct MarioState *m) { - s32 cancel = FALSE; + s32 cancel = ACTION_FINISH; if (check_common_moving_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (mario_update_quicksand(m, 0.25f)) { - return TRUE; + return ACTION_CONTINUE; } /* clang-format off */ diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c index 3dd32c3a9f..c95c9a59d5 100644 --- a/src/game/mario_actions_object.c +++ b/src/game/mario_actions_object.c @@ -169,7 +169,7 @@ s32 act_punching(struct MarioState *m) { mario_update_punch_sequence(m); perform_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_picking_up(struct MarioState *m) { @@ -207,7 +207,7 @@ s32 act_picking_up(struct MarioState *m) { } stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_dive_picking_up(struct MarioState *m) { @@ -236,7 +236,7 @@ s32 act_dive_picking_up(struct MarioState *m) { #endif animated_stationary_ground_step(m, MARIO_ANIM_STOP_SLIDE_LIGHT_OBJ, ACT_HOLD_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_placing_down(struct MarioState *m) { @@ -253,7 +253,7 @@ s32 act_placing_down(struct MarioState *m) { } animated_stationary_ground_step(m, MARIO_ANIM_PLACE_LIGHT_OBJ, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_throwing(struct MarioState *m) { @@ -279,7 +279,7 @@ s32 act_throwing(struct MarioState *m) { } animated_stationary_ground_step(m, MARIO_ANIM_GROUND_THROW, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_heavy_throw(struct MarioState *m) { @@ -301,7 +301,7 @@ s32 act_heavy_throw(struct MarioState *m) { } animated_stationary_ground_step(m, MARIO_ANIM_HEAVY_THROW, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_stomach_slide_stop(struct MarioState *m) { @@ -318,7 +318,7 @@ s32 act_stomach_slide_stop(struct MarioState *m) { } animated_stationary_ground_step(m, MARIO_ANIM_SLOW_LAND_FROM_DIVE, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_picking_up_bowser(struct MarioState *m) { @@ -339,7 +339,7 @@ s32 act_picking_up_bowser(struct MarioState *m) { } stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_holding_bowser(struct MarioState *m) { @@ -410,7 +410,7 @@ s32 act_holding_bowser(struct MarioState *m) { m->marioObj->header.gfx.angle[0] = m->angleVel[1]; } - return FALSE; + return ACTION_FINISH; } s32 act_releasing_bowser(struct MarioState *m) { @@ -430,7 +430,7 @@ s32 act_releasing_bowser(struct MarioState *m) { m->angleVel[1] = 0; animated_stationary_ground_step(m, MARIO_ANIM_RELEASE_BOWSER, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 check_common_object_cancels(struct MarioState *m) { @@ -447,18 +447,18 @@ s32 check_common_object_cancels(struct MarioState *m) { return drop_and_set_mario_action(m, ACT_STANDING_DEATH, 0); } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_object_action(struct MarioState *m) { - s32 cancel = FALSE; + s32 cancel = ACTION_FINISH; if (check_common_object_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (mario_update_quicksand(m, 0.5f)) { - return TRUE; + return ACTION_CONTINUE; } /* clang-format off */ diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index b0692e54aa..dc89d6da8e 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -56,7 +56,7 @@ s32 check_common_idle_cancels(struct MarioState *m) { return set_mario_action(m, ACT_START_CROUCHING, 0); } - return FALSE; + return ACTION_FINISH; } s32 check_common_hold_idle_cancels(struct MarioState *m) { @@ -99,7 +99,7 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) { return drop_and_set_mario_action(m, ACT_START_CROUCHING, 0); } - return FALSE; + return ACTION_FINISH; } //! TODO: actionArg names @@ -117,7 +117,7 @@ s32 act_idle(struct MarioState *m) { } if (check_common_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->actionState == ACT_STATE_IDLE_RESET_OR_SLEEP) { @@ -177,7 +177,7 @@ s32 act_idle(struct MarioState *m) { stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound) { @@ -190,7 +190,7 @@ s32 act_start_sleeping(struct MarioState *m) { s32 animFrame = 0; if (check_common_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->quicksandDepth > 30.0f) { @@ -238,7 +238,7 @@ s32 act_start_sleeping(struct MarioState *m) { } stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_sleeping(struct MarioState *m) { @@ -298,7 +298,7 @@ s32 act_sleeping(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_SNORING3, MARIO_ACTION_SOUND_PLAYED); break; } - return FALSE; + return ACTION_FINISH; } s32 act_waking_up(struct MarioState *m) { @@ -331,7 +331,7 @@ s32 act_waking_up(struct MarioState *m) { set_mario_animation(m, !m->actionArg ? MARIO_ANIM_WAKE_FROM_SLEEP : MARIO_ANIM_WAKE_FROM_LYING); - return FALSE; + return ACTION_FINISH; } s32 act_shivering(struct MarioState *m) { @@ -385,14 +385,14 @@ s32 act_shivering(struct MarioState *m) { } break; } - return FALSE; + return ACTION_FINISH; } s32 act_coughing(struct MarioState *m) { s32 animFrame; if (check_common_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } stationary_ground_step(m); @@ -409,7 +409,7 @@ s32 act_coughing(struct MarioState *m) { play_sound(SOUND_MARIO_COUGHING1, m->marioObj->header.gfx.cameraToObject); } - return FALSE; + return ACTION_FINISH; } s32 act_hold_idle(struct MarioState *m) { @@ -426,12 +426,12 @@ s32 act_hold_idle(struct MarioState *m) { } if (check_common_hold_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } stationary_ground_step(m); set_mario_animation(m, MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); - return FALSE; + return ACTION_FINISH; } s32 act_hold_heavy_idle(struct MarioState *m) { @@ -457,7 +457,7 @@ s32 act_hold_heavy_idle(struct MarioState *m) { stationary_ground_step(m); set_mario_animation(m, MARIO_ANIM_IDLE_HEAVY_OBJ); - return FALSE; + return ACTION_FINISH; } s32 act_standing_against_wall(struct MarioState *m) { @@ -479,7 +479,7 @@ s32 act_standing_against_wall(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_STAND_AGAINST_WALL); stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_in_quicksand(struct MarioState *m) { @@ -488,7 +488,7 @@ s32 act_in_quicksand(struct MarioState *m) { } if (check_common_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->quicksandDepth > 70.0f) { @@ -498,7 +498,7 @@ s32 act_in_quicksand(struct MarioState *m) { } stationary_ground_step(m); - return FALSE; + return ACTION_FINISH; } s32 act_crouching(struct MarioState *m) { @@ -536,7 +536,7 @@ s32 act_crouching(struct MarioState *m) { stationary_ground_step(m); set_mario_animation(m, MARIO_ANIM_CROUCHING); - return FALSE; + return ACTION_FINISH; } s32 act_panting(struct MarioState *m) { @@ -549,7 +549,7 @@ s32 act_panting(struct MarioState *m) { } if (check_common_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (set_mario_animation(m, MARIO_ANIM_WALK_PANTING) == 1) { @@ -559,7 +559,7 @@ s32 act_panting(struct MarioState *m) { stationary_ground_step(m); m->marioBodyState->eyeState = MARIO_EYES_HALF_CLOSED; - return FALSE; + return ACTION_FINISH; } s32 act_hold_panting_unused(struct MarioState *m) { @@ -576,13 +576,13 @@ s32 act_hold_panting_unused(struct MarioState *m) { } if (check_common_hold_idle_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } set_mario_animation(m, MARIO_ANIM_WALK_PANTING); stationary_ground_step(m); m->marioBodyState->eyeState = MARIO_EYES_HALF_CLOSED; - return FALSE; + return ACTION_FINISH; } void stopping_step(struct MarioState *m, s32 animID, u32 action) { @@ -612,7 +612,7 @@ s32 act_braking_stop(struct MarioState *m) { } stopping_step(m, MARIO_ANIM_STOP_SKID, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_butt_slide_stop(struct MarioState *m) { @@ -629,7 +629,7 @@ s32 act_butt_slide_stop(struct MarioState *m) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); } - return FALSE; + return ACTION_FINISH; } s32 act_hold_butt_slide_stop(struct MarioState *m) { @@ -650,7 +650,7 @@ s32 act_hold_butt_slide_stop(struct MarioState *m) { } stopping_step(m, MARIO_ANIM_STAND_UP_FROM_SLIDING_WITH_LIGHT_OBJ, ACT_HOLD_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_slide_kick_slide_stop(struct MarioState *m) { @@ -663,7 +663,7 @@ s32 act_slide_kick_slide_stop(struct MarioState *m) { } stopping_step(m, MARIO_ANIM_CROUCH_FROM_SLIDE_KICK, ACT_CROUCHING); - return FALSE; + return ACTION_FINISH; } s32 act_start_crouching(struct MarioState *m) { @@ -688,7 +688,7 @@ s32 act_start_crouching(struct MarioState *m) { if (is_anim_past_end(m)) { set_mario_action(m, ACT_CROUCHING, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_stop_crouching(struct MarioState *m) { @@ -713,7 +713,7 @@ s32 act_stop_crouching(struct MarioState *m) { if (is_anim_past_end(m)) { set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_start_crawling(struct MarioState *m) { @@ -739,7 +739,7 @@ s32 act_start_crawling(struct MarioState *m) { set_mario_action(m, ACT_CRAWLING, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_stop_crawling(struct MarioState *m) { @@ -760,7 +760,7 @@ s32 act_stop_crawling(struct MarioState *m) { if (is_anim_past_end(m)) { set_mario_action(m, ACT_CROUCHING, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_shockwave_bounce(struct MarioState *m) { @@ -797,7 +797,7 @@ s32 act_shockwave_bounce(struct MarioState *m) { vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); set_mario_animation(m, MARIO_ANIM_A_POSE); - return FALSE; + return ACTION_FINISH; } s32 landing_step(struct MarioState *m, s32 animID, u32 action) { @@ -806,7 +806,7 @@ s32 landing_step(struct MarioState *m, s32 animID, u32 action) { if (is_anim_at_end(m)) { return set_mario_action(m, action, 0); } - return FALSE; + return ACTION_FINISH; } s32 check_common_landing_cancels(struct MarioState *m, u32 action) { @@ -834,53 +834,53 @@ s32 check_common_landing_cancels(struct MarioState *m, u32 action) { return set_mario_action(m, ACT_PUNCHING, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_jump_land_stop(struct MarioState *m) { if (check_common_landing_cancels(m, 0)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_LAND_FROM_SINGLE_JUMP, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_double_jump_land_stop(struct MarioState *m) { if (check_common_landing_cancels(m, 0)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_LAND_FROM_DOUBLE_JUMP, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_side_flip_land_stop(struct MarioState *m) { if (check_common_landing_cancels(m, 0)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_SLIDEFLIP_LAND, ACT_IDLE); m->marioObj->header.gfx.angle[1] += 0x8000; - return FALSE; + return ACTION_FINISH; } s32 act_freefall_land_stop(struct MarioState *m) { if (check_common_landing_cancels(m, 0)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_GENERAL_LAND, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_triple_jump_land_stop(struct MarioState *m) { if (check_common_landing_cancels(m, ACT_JUMP)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_backflip_land_stop(struct MarioState *m) { @@ -889,34 +889,34 @@ s32 act_backflip_land_stop(struct MarioState *m) { } if (check_common_landing_cancels(m, ACT_BACKFLIP)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_lava_boost_land(struct MarioState *m) { m->input &= ~(INPUT_FIRST_PERSON | INPUT_B_PRESSED); if (check_common_landing_cancels(m, 0)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, MARIO_ANIM_STAND_UP_FROM_LAVA_BOOST, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_long_jump_land_stop(struct MarioState *m) { m->input &= ~INPUT_B_PRESSED; if (check_common_landing_cancels(m, ACT_JUMP)) { - return TRUE; + return ACTION_CONTINUE; } landing_step(m, !m->marioObj->oMarioLongJumpIsSlow ? MARIO_ANIM_CROUCH_FROM_FAST_LONGJUMP : MARIO_ANIM_CROUCH_FROM_SLOW_LONGJUMP, ACT_CROUCHING); - return FALSE; + return ACTION_FINISH; } s32 act_hold_jump_land_stop(struct MarioState *m) { @@ -937,7 +937,7 @@ s32 act_hold_jump_land_stop(struct MarioState *m) { } landing_step(m, MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_hold_freefall_land_stop(struct MarioState *m) { @@ -957,7 +957,7 @@ s32 act_hold_freefall_land_stop(struct MarioState *m) { return set_mario_action(m, ACT_THROWING, 0); } landing_step(m, MARIO_ANIM_FALL_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_air_throw_land(struct MarioState *m) { @@ -974,7 +974,7 @@ s32 act_air_throw_land(struct MarioState *m) { } landing_step(m, MARIO_ANIM_THROW_LIGHT_OBJECT, ACT_IDLE); - return FALSE; + return ACTION_FINISH; } s32 act_twirl_land(struct MarioState *m) { @@ -1004,7 +1004,7 @@ s32 act_twirl_land(struct MarioState *m) { set_mario_action(m, ACT_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } s32 act_ground_pound_land(struct MarioState *m) { @@ -1022,7 +1022,7 @@ s32 act_ground_pound_land(struct MarioState *m) { } landing_step(m, MARIO_ANIM_GROUND_POUND_LANDING, ACT_BUTT_SLIDE_STOP); - return FALSE; + return ACTION_FINISH; } s32 act_first_person(struct MarioState *m) { @@ -1054,7 +1054,7 @@ s32 act_first_person(struct MarioState *m) { stationary_ground_step(m); set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); - return FALSE; + return ACTION_FINISH; } s32 check_common_stationary_cancels(struct MarioState *m) { @@ -1077,18 +1077,18 @@ s32 check_common_stationary_cancels(struct MarioState *m) { return drop_and_set_mario_action(m, ACT_STANDING_DEATH, 0); } } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_stationary_action(struct MarioState *m) { s32 cancel; if (check_common_stationary_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } if (mario_update_quicksand(m, 0.5f)) { - return TRUE; + return ACTION_CONTINUE; } /* clang-format off */ @@ -1129,7 +1129,7 @@ s32 mario_execute_stationary_action(struct MarioState *m) { case ACT_BRAKING_STOP: cancel = act_braking_stop(m); break; case ACT_BUTT_SLIDE_STOP: cancel = act_butt_slide_stop(m); break; case ACT_HOLD_BUTT_SLIDE_STOP: cancel = act_hold_butt_slide_stop(m); break; - default: cancel = TRUE; break; + default: cancel = ACTION_CONTINUE; break; } /* clang-format on */ diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 6c8a737293..b67d90abfd 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -343,7 +343,7 @@ static s32 act_water_idle(struct MarioState *m) { } common_idle_step(m, MARIO_ANIM_WATER_IDLE, animAccel); - return FALSE; + return ACTION_FINISH; } static s32 act_hold_water_idle(struct MarioState *m) { @@ -364,7 +364,7 @@ static s32 act_hold_water_idle(struct MarioState *m) { } common_idle_step(m, MARIO_ANIM_WATER_IDLE_WITH_OBJ, 0); - return FALSE; + return ACTION_FINISH; } static s32 act_water_action_end(struct MarioState *m) { @@ -384,7 +384,7 @@ static s32 act_water_action_end(struct MarioState *m) { if (is_anim_at_end(m)) { set_mario_action(m, ACT_WATER_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_water_action_end(struct MarioState *m) { @@ -410,7 +410,7 @@ static s32 act_hold_water_action_end(struct MarioState *m) { if (is_anim_at_end(m)) { set_mario_action(m, ACT_HOLD_WATER_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } static void reset_bob_variables(struct MarioState *m) { @@ -502,7 +502,7 @@ static s32 check_water_jump(struct MarioState *m) { } } - return FALSE; + return ACTION_FINISH; } static s32 act_breaststroke(struct MarioState *m) { @@ -523,7 +523,7 @@ static s32 act_breaststroke(struct MarioState *m) { } if (check_water_jump(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->actionTimer < 6) { @@ -562,7 +562,7 @@ static s32 act_breaststroke(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_SWIM_PART1); common_swimming_step(m, sSwimStrength); - return FALSE; + return ACTION_FINISH; } static s32 act_swimming_end(struct MarioState *m) { @@ -579,7 +579,7 @@ static s32 act_swimming_end(struct MarioState *m) { } if (check_water_jump(m)) { - return TRUE; + return ACTION_CONTINUE; } if ((m->input & INPUT_A_DOWN) && m->actionTimer >= 7) { @@ -599,7 +599,7 @@ static s32 act_swimming_end(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_SWIM_PART2); common_swimming_step(m, sSwimStrength); - return FALSE; + return ACTION_FINISH; } static s32 act_flutter_kick(struct MarioState *m) { @@ -628,7 +628,7 @@ static s32 act_flutter_kick(struct MarioState *m) { } common_swimming_step(m, sSwimStrength); - return FALSE; + return ACTION_FINISH; } static s32 act_hold_breaststroke(struct MarioState *m) { @@ -649,7 +649,7 @@ static s32 act_hold_breaststroke(struct MarioState *m) { } if (check_water_jump(m)) { - return TRUE; + return ACTION_CONTINUE; } if (m->actionTimer < 6) { @@ -679,7 +679,7 @@ static s32 act_hold_breaststroke(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_SWIM_WITH_OBJ_PART1); common_swimming_step(m, 160); - return FALSE; + return ACTION_FINISH; } static s32 act_hold_swimming_end(struct MarioState *m) { @@ -700,7 +700,7 @@ static s32 act_hold_swimming_end(struct MarioState *m) { } if (check_water_jump(m)) { - return TRUE; + return ACTION_CONTINUE; } if ((m->input & INPUT_A_DOWN) && m->actionTimer >= 7) { @@ -712,7 +712,7 @@ static s32 act_hold_swimming_end(struct MarioState *m) { m->forwardVel -= 0.25f; set_mario_animation(m, MARIO_ANIM_SWIM_WITH_OBJ_PART2); common_swimming_step(m, 160); - return FALSE; + return ACTION_FINISH; } static s32 act_hold_flutter_kick(struct MarioState *m) { @@ -738,7 +738,7 @@ static s32 act_hold_flutter_kick(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_FLUTTERKICK_WITH_OBJ); } common_swimming_step(m, 160); - return FALSE; + return ACTION_FINISH; } static s32 act_water_shell_swimming(struct MarioState *m) { @@ -763,7 +763,7 @@ static s32 act_water_shell_swimming(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_FLUTTERKICK_WITH_OBJ); common_swimming_step(m, 300); - return FALSE; + return ACTION_FINISH; } static s32 check_water_grab(struct MarioState *m) { @@ -780,11 +780,11 @@ static s32 check_water_grab(struct MarioState *m) { m->usedObj = object; mario_grab_used_object(m); m->marioBodyState->grabPos = GRAB_POS_LIGHT_OBJ; - return TRUE; + return ACTION_CONTINUE; } } - return FALSE; + return ACTION_FINISH; } static s32 act_water_throw(struct MarioState *m) { @@ -810,7 +810,7 @@ static s32 act_water_throw(struct MarioState *m) { set_mario_action(m, ACT_WATER_IDLE, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_water_punch(struct MarioState *m) { @@ -856,7 +856,7 @@ static s32 act_water_punch(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } static void common_water_knockback_step(struct MarioState *m, s32 animation, u32 endAction, s32 actionArg) { @@ -877,12 +877,12 @@ static void common_water_knockback_step(struct MarioState *m, s32 animation, u32 static s32 act_backward_water_kb(struct MarioState *m) { common_water_knockback_step(m, MARIO_ANIM_BACKWARDS_WATER_KB, ACT_WATER_IDLE, m->actionArg); - return FALSE; + return ACTION_FINISH; } static s32 act_forward_water_kb(struct MarioState *m) { common_water_knockback_step(m, MARIO_ANIM_WATER_FORWARD_KB, ACT_WATER_IDLE, m->actionArg); - return FALSE; + return ACTION_FINISH; } static s32 act_water_shocked(struct MarioState *m) { @@ -903,7 +903,7 @@ static s32 act_water_shocked(struct MarioState *m) { stationary_slow_down(m); perform_water_step(m); m->marioBodyState->headAngle[0] = 0; - return FALSE; + return ACTION_FINISH; } static s32 act_drowning(struct MarioState *m) { @@ -929,7 +929,7 @@ static s32 act_drowning(struct MarioState *m) { stationary_slow_down(m); perform_water_step(m); - return FALSE; + return ACTION_FINISH; } static s32 act_water_death(struct MarioState *m) { @@ -943,7 +943,7 @@ static s32 act_water_death(struct MarioState *m) { level_trigger_warp(m, WARP_OP_DEATH); } - return FALSE; + return ACTION_FINISH; } static s32 act_water_plunge(struct MarioState *m) { @@ -1030,7 +1030,7 @@ static s32 act_water_plunge(struct MarioState *m) { } m->particleFlags |= PARTICLE_PLUNGE_BUBBLE; - return FALSE; + return ACTION_FINISH; } static s32 act_caught_in_whirlpool(struct MarioState *m) { @@ -1090,7 +1090,7 @@ static s32 act_caught_in_whirlpool(struct MarioState *m) { reset_rumble_timers_slip(); #endif - return FALSE; + return ACTION_FINISH; } static void play_metal_water_jumping_sound(struct MarioState *m, u32 landing) { @@ -1196,7 +1196,7 @@ static s32 act_metal_water_standing(struct MarioState *m) { m->particleFlags |= PARTICLE_IDLE_WATER_WAVE; } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_standing(struct MarioState *m) { @@ -1218,7 +1218,7 @@ static s32 act_hold_metal_water_standing(struct MarioState *m) { stop_and_set_height_to_floor(m); set_mario_animation(m, MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); - return FALSE; + return ACTION_FINISH; } static s32 act_metal_water_walking(struct MarioState *m) { @@ -1258,7 +1258,7 @@ static s32 act_metal_water_walking(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_walking(struct MarioState *m) { @@ -1300,7 +1300,7 @@ static s32 act_hold_metal_water_walking(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } static s32 act_metal_water_jump(struct MarioState *m) { @@ -1325,7 +1325,7 @@ static s32 act_metal_water_jump(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_jump(struct MarioState *m) { @@ -1354,7 +1354,7 @@ static s32 act_hold_metal_water_jump(struct MarioState *m) { break; } - return FALSE; + return ACTION_FINISH; } static s32 act_metal_water_falling(struct MarioState *m) { @@ -1373,7 +1373,7 @@ static s32 act_metal_water_falling(struct MarioState *m) { set_mario_action(m, ACT_METAL_WATER_FALL_LAND, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_falling(struct MarioState *m) { @@ -1396,7 +1396,7 @@ static s32 act_hold_metal_water_falling(struct MarioState *m) { set_mario_action(m, ACT_HOLD_METAL_WATER_FALL_LAND, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_metal_water_jump_land(struct MarioState *m) { @@ -1417,7 +1417,7 @@ static s32 act_metal_water_jump_land(struct MarioState *m) { return set_mario_action(m, ACT_METAL_WATER_STANDING, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_jump_land(struct MarioState *m) { @@ -1442,7 +1442,7 @@ static s32 act_hold_metal_water_jump_land(struct MarioState *m) { return set_mario_action(m, ACT_HOLD_METAL_WATER_STANDING, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_metal_water_fall_land(struct MarioState *m) { @@ -1463,7 +1463,7 @@ static s32 act_metal_water_fall_land(struct MarioState *m) { return set_mario_action(m, ACT_METAL_WATER_STANDING, 0); } - return FALSE; + return ACTION_FINISH; } static s32 act_hold_metal_water_fall_land(struct MarioState *m) { @@ -1488,7 +1488,7 @@ static s32 act_hold_metal_water_fall_land(struct MarioState *m) { return set_mario_action(m, ACT_HOLD_METAL_WATER_STANDING, 0); } - return FALSE; + return ACTION_FINISH; } static s32 check_common_submerged_cancels(struct MarioState *m) { @@ -1520,14 +1520,14 @@ static s32 check_common_submerged_cancels(struct MarioState *m) { set_mario_action(m, ACT_DROWNING, 0); } - return FALSE; + return ACTION_FINISH; } s32 mario_execute_submerged_action(struct MarioState *m) { - s32 cancel = FALSE; + s32 cancel = ACTION_FINISH; if (check_common_submerged_cancels(m)) { - return TRUE; + return ACTION_CONTINUE; } m->quicksandDepth = 0.0f;