-- name: Skip Common Cutscenes -- description: Skip Common Cutscenes by MegAmi\nSkips commonly seen cutscenes and dialog, such as unlocking star doors, opening cannons, or stepping on cap switches. -- Star Choose Exit compatibility disable_save = true for i in pairs(gActiveMods) do if gActiveMods[i].name == "Star Choose Exit" then disable_save = false end end -- Don't skip star dialog if SCE is on if disable_save == true then gBehaviorValues.ShowStarDialog = false end gBehaviorValues.ShowStarMilestones = false local function before_set_mario_action(m, nextAction) if m.playerIndex ~= 0 then return end if nextAction == ACT_EXIT_LAND_SAVE_DIALOG then -- Skip the course complete screen mario_set_forward_vel(m, 0) play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING) m.faceAngle.y = m.faceAngle.y + 0x8000 if m.area.camera.cutscene == CUTSCENE_EXIT_PAINTING_SUCC or m.area.camera.cutscene == CUTSCENE_EXIT_BOWSER_SUCC or m.area.camera.cutscene == CUTSCENE_EXIT_SPECIAL_SUCC then m.area.camera.cutscene = 0 m.statusForCamera.action = ACT_JUMP_LAND_STOP m.statusForCamera.cameraEvent = 0 soft_reset_camera(m.area.camera) end return ACT_JUMP_LAND_STOP elseif m.action == ACT_DEATH_EXIT or m.action == ACT_UNUSED_DEATH_EXIT or m.action == ACT_FALLING_DEATH_EXIT or m.action == ACT_SPECIAL_DEATH_EXIT and (nextAction == ACT_DEATH_EXIT_LAND or nextAction == ACT_HARD_BACKWARD_GROUND_KB) then -- Skip the get up animation mario_set_forward_vel(m, 0) play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING) if m.area.camera.cutscene == CUTSCENE_DEATH_EXIT or m.area.camera.cutscene == CUTSCENE_NONPAINTING_DEATH then m.area.camera.cutscene = 0 m.statusForCamera.action = ACT_JUMP_LAND_STOP m.statusForCamera.cameraEvent = 0 soft_reset_camera(m.area.camera) end return ACT_JUMP_LAND_STOP elseif nextAction == ACT_UNLOCKING_KEY_DOOR then -- Skip the unlock animation if m.usedObj ~= 0 and ((m.usedObj.oBehParams >> 24) == 1) then save_file_set_flags(SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR) save_file_clear_flags(SAVE_FLAG_HAVE_KEY_2) else save_file_set_flags(SAVE_FLAG_UNLOCKED_BASEMENT_DOOR) save_file_clear_flags(SAVE_FLAG_HAVE_KEY_1) end return ACT_WALKING elseif nextAction == ACT_UNLOCKING_STAR_DOOR then -- Skip the unlock animation save_file_set_flags(get_door_save_file_flag(m.usedObj)) return ACT_WALKING end end hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) function bhv_custom_capswitch_loop(obj) -- Skip cap switch pressed dialog if obj.oAction == 2 and obj.oPrevAction == 2 and obj.oTimer >= 5 then obj.oAction = 3 save_file_do_save(get_current_save_file_num() - 1, false) end end id_bhvCustomCapSwitch = hook_behavior(id_bhvCapSwitch, OBJ_LIST_SURFACE, false, nil, bhv_custom_capswitch_loop) function bhv_custom_bobomb_buddy_loop(obj) -- Skip cannon opening cutscene if obj.oBobombBuddyCannonStatus == BOBOMB_BUDDY_CANNON_OPENING then local cannonClosed = obj_get_first_with_behavior_id(id_bhvCannonClosed) while cannonClosed do cannonClosed.oAction = CANNON_TRAP_DOOR_ACT_OPEN cannonClosed.activeFlags = ACTIVE_FLAG_DEACTIVATED cannonClosed = obj_get_next_with_same_behavior_id(cannonClosed) end obj.oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_STOP_TALKING end end id_bhvCustomBobombBuddyOpensCannon = hook_behavior(id_bhvBobombBuddyOpensCannon, OBJ_LIST_GENACTOR, false, nil, bhv_custom_bobomb_buddy_loop)