diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp index 1cddcfabb2..807ff345db 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp @@ -711,6 +711,10 @@ void AutoStory::run_autostory(SingleSwitchProgramEnvironment& env, ProController NOTIFICATION_STATUS_UPDATE }; + if (get_start_segment_index() > get_end_segment_index()){ + throw UserSetupError(env.logger(), "The start segment cannot be later than the end segment."); + } + for (size_t segment_index = get_start_segment_index(); segment_index <= get_end_segment_index(); segment_index++){ ALL_AUTO_STORY_SEGMENT_LIST()[segment_index]->run_segment(env, context, options); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_00.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_00.cpp index 3ffaf6e96d..f07edee59d 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_00.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_00.cpp @@ -39,7 +39,7 @@ void AutoStory_Segment_00::run_segment( ProControllerContext& context, AutoStoryOptions options ) const{ - AutoStoryStats& stats = env.current_stats(); + // AutoStoryStats& stats = env.current_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 00: Intro Cutscene", COLOR_ORANGE); @@ -48,8 +48,6 @@ void AutoStory_Segment_00::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 00: Intro Cutscene", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_01.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_01.cpp index aa8cf395ae..9616af0ffa 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_01.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_01.cpp @@ -53,6 +53,8 @@ void AutoStory_Segment_01::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 01: Pick Starter", COLOR_ORANGE); @@ -62,8 +64,6 @@ void AutoStory_Segment_01::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 01: Pick Starter", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -93,7 +93,7 @@ AutoStoryStats& stats = env.current_stats(); context.wait_for_all_requests(); break; - }catch(...){ + }catch(OperationFailedException&){ // (void)e; first_attempt = false; context.wait_for_all_requests(); @@ -185,7 +185,7 @@ void checkpoint_02( leave_phone_to_overworld(env.program_info(), env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -278,7 +278,7 @@ void checkpoint_03( leave_box_system_to_overworld(env.program_info(), env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_02.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_02.cpp index 1c2b515b1a..13317ee8e0 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_02.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_02.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Programs/PokemonSV_GameEntry.h" @@ -48,15 +49,15 @@ void AutoStory_Segment_02::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 02: First Nemona Battle", COLOR_ORANGE); checkpoint_04(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 02: First Nemona Battle", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment 02: First Nemona Battle", COLOR_GREEN); } @@ -93,7 +94,7 @@ void checkpoint_04( env.console.log("Finished battle."); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_03.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_03.cpp index 73becf4f43..5dd13458f8 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_03.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_03.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -43,6 +44,8 @@ std::string AutoStory_Segment_03::end_text() const{ void AutoStory_Segment_03::run_segment(SingleSwitchProgramEnvironment& env, ProControllerContext& context, AutoStoryOptions options) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 03: Catch Tutorial", COLOR_ORANGE); @@ -52,8 +55,6 @@ void AutoStory_Segment_03::run_segment(SingleSwitchProgramEnvironment& env, ProC context.wait_for_all_requests(); env.console.log("End Segment 03: Catch Tutorial", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -84,7 +85,7 @@ void checkpoint_05( env.console.overlay().add_log("Get mom's sandwich", COLOR_WHITE); mash_button_till_overworld(env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -134,7 +135,7 @@ void checkpoint_06( env.console.overlay().add_log("Finished catch tutorial", COLOR_WHITE); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -188,7 +189,7 @@ void checkpoint_07( env.console.overlay().add_log("Mystery cry", COLOR_WHITE); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_04.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_04.cpp index a1d9345c37..32cde6a1ce 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_04.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_04.cpp @@ -49,6 +49,8 @@ void AutoStory_Segment_04::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 04: Rescue Legendary", COLOR_ORANGE); @@ -56,8 +58,6 @@ void AutoStory_Segment_04::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 04: Rescue Legendary", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -193,7 +193,7 @@ void checkpoint_08( mash_button_till_overworld(env.console, context, BUTTON_A); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_05.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_05.cpp index 575bdd013f..5b56380f66 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_05.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_05.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -47,6 +48,8 @@ void AutoStory_Segment_05::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 05: First Arven Battle", COLOR_ORANGE); @@ -55,8 +58,6 @@ void AutoStory_Segment_05::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 05: First Arven Battle", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -101,7 +102,7 @@ void checkpoint_09( env.console.overlay().add_log("Receive legendary ball", COLOR_WHITE); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -143,7 +144,7 @@ void checkpoint_10( mash_button_till_overworld(env.console, context, BUTTON_A); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_06.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_06.cpp index 0500b7a65e..0add7006eb 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_06.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_06.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/PokemonSV_TutorialDetector.h" @@ -46,6 +47,8 @@ void AutoStory_Segment_06::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 06: Go to Los Platos", COLOR_ORANGE); @@ -53,8 +56,6 @@ void AutoStory_Segment_06::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 06: Go to Los Platos", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -109,7 +110,7 @@ void checkpoint_11( env.console.overlay().add_log("Reached Los Platos", COLOR_WHITE); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_07.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_07.cpp index 74ff02c30f..cc6b2dc7bd 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_07.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_07.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -46,6 +47,8 @@ void AutoStory_Segment_07::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 07: Go to Mesagoza South", COLOR_ORANGE); @@ -63,8 +66,6 @@ void AutoStory_Segment_07::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 07: Go to Mesagoza South", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -120,7 +121,7 @@ void checkpoint_12( env.console.log("Reached Mesagoza (South) Pokecenter."); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp index 44e2a39401..367f3be5c7 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/PokemonSV_TutorialDetector.h" #include "PokemonSV/Programs/PokemonSV_GameEntry.h" @@ -44,6 +45,8 @@ void AutoStory_Segment_08::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 08: Beat Team Star and arrive at School", COLOR_ORANGE); @@ -54,8 +57,6 @@ void AutoStory_Segment_08::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 08: Beat Team Star and arrive at School", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -100,7 +101,7 @@ void checkpoint_13( break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -158,7 +159,7 @@ void checkpoint_14( clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -201,7 +202,7 @@ void checkpoint_15( {CallbackEnum::PROMPT_DIALOG, CallbackEnum::OVERWORLD}); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_09.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_09.cpp index 5ea17d0e09..e7cf88c809 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_09.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_09.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/PokemonSV_TutorialDetector.h" @@ -44,6 +45,8 @@ void AutoStory_Segment_09::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); env.console.log("Start Segment 09: Complete tutorial", COLOR_ORANGE); @@ -55,8 +58,6 @@ void AutoStory_Segment_09::run_segment( context.wait_for_all_requests(); env.console.log("End Segment 09: Complete tutorial", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); } @@ -105,7 +106,7 @@ void checkpoint_16( break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -160,7 +161,7 @@ void checkpoint_17( break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -206,7 +207,7 @@ void checkpoint_18( {CallbackEnum::OVERWORLD, CallbackEnum::PROMPT_DIALOG}); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -250,7 +251,7 @@ void checkpoint_19( break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -303,7 +304,7 @@ void checkpoint_20( mash_button_till_overworld(env.console, context, BUTTON_A, 360); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_10.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_10.cpp index ef5d26d23b..fc6d5cbbff 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_10.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_10.cpp @@ -30,7 +30,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_10::name() const{ - return "10.1: Cortondo Gym - Go to Cortondo city"; + return "10: Cortondo Gym (Bug): Go to Cortondo city"; } std::string AutoStory_Segment_10::start_text() const{ @@ -48,17 +48,17 @@ void AutoStory_Segment_10::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 10.1: Cortondo Gym - Go to Cortondo city", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_21(env, context, options.notif_status_update); checkpoint_22(env, context, options.notif_status_update); checkpoint_23(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 10.1: Cortondo Gym - Go to Cortondo city", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -117,7 +117,7 @@ void checkpoint_21( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -184,7 +184,7 @@ void checkpoint_22( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -303,7 +303,7 @@ void checkpoint_23( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_11.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_11.cpp index aadc8cd65d..f2b90716d1 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_11.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_11.cpp @@ -37,7 +37,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_11::name() const{ - return "10.2: Cortondo Gym - Gym challenge"; + return "11: Cortondo Gym (Bug): Gym challenge"; } std::string AutoStory_Segment_11::start_text() const{ @@ -55,8 +55,10 @@ void AutoStory_Segment_11::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 10.2: Cortondo Gym - Gym challenge", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_24(env, context, options.notif_status_update); checkpoint_25(env, context, options.notif_status_update); @@ -64,9 +66,7 @@ void AutoStory_Segment_11::run_segment( checkpoint_27(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 10.2: Cortondo Gym - Gym challenge", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -124,7 +124,7 @@ void checkpoint_24( break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -211,7 +211,7 @@ void checkpoint_25( enter_menu_from_overworld(env.program_info(), env.console, context, -1); break; - }catch(...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_12.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_12.cpp index 94cda1507c..73de52c5a9 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_12.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_12.cpp @@ -32,7 +32,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_12::name() const{ - return "10.3: Cortondo Gym - Gym battle"; + return "12: Cortondo Gym (Bug): Gym battle"; } std::string AutoStory_Segment_12::start_text() const{ @@ -51,15 +51,15 @@ void AutoStory_Segment_12::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 10.3: Cortondo Gym - Gym battle", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_28(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 10.3: Cortondo Gym - Gym battle", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -135,7 +135,7 @@ void checkpoint_28( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_13.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_13.cpp index af77ce98a7..38957b4660 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_13.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_13.cpp @@ -28,7 +28,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_13::name() const{ - return "11.1: Bombirdier Titan: Go to West Province Area One Central Pokecenter"; + return "13: Bombirdier Titan: Go to West Province Area One Central Pokecenter"; } std::string AutoStory_Segment_13::start_text() const{ @@ -46,15 +46,15 @@ void AutoStory_Segment_13::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 11.1: Bombirdier Titan: Go to West Province Area One Central Pokecenter", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_29(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 11.1: Bombirdier Titan: Go to West Province Area One Central Pokecenter", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -192,7 +192,7 @@ void checkpoint_29( break; - }catch (...){ // try again if fall into water + }catch(OperationFailedException&){ // try again if fall into water pbf_mash_button(context, BUTTON_A, 250); // walk back to start position before bridge @@ -311,7 +311,7 @@ void checkpoint_29( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_14.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_14.cpp index 756a8fa92c..3d589395f6 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_14.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_14.cpp @@ -29,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_14::name() const{ - return "11.2: Bombirdier Titan: Battle Bombirdier"; + return "14: Bombirdier Titan: Battle Bombirdier"; } std::string AutoStory_Segment_14::start_text() const{ @@ -47,16 +47,16 @@ void AutoStory_Segment_14::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 11.2: Bombirdier Titan: Battle Bombirdier", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_30(env, context, options.notif_status_update); checkpoint_31(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 11.2: Bombirdier Titan: Battle Bombirdier", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -234,7 +234,7 @@ void checkpoint_30( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -300,7 +300,7 @@ void checkpoint_31( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_15.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_15.cpp index f7fb3e8fbb..e500ddb242 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_15.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_15.cpp @@ -32,7 +32,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_15::name() const{ - return "12: Team Star (Dark)"; + return "15: Team Star (Dark)"; } std::string AutoStory_Segment_15::start_text() const{ @@ -50,8 +50,10 @@ void AutoStory_Segment_15::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 12: Team Star (Dark)", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_32(env, context, options.notif_status_update); checkpoint_33(env, context, options.notif_status_update); @@ -59,9 +61,7 @@ void AutoStory_Segment_15::run_segment( context.wait_for_all_requests(); - env.console.log("End Segment 12: Team Star (Dark)", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -132,7 +132,7 @@ void checkpoint_32( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -258,7 +258,7 @@ void checkpoint_33( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -322,7 +322,7 @@ void checkpoint_34( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_16.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_16.cpp index c38e5a7806..2de8913d99 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_16.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_16.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -28,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_16::name() const{ - return "13.1: Cascarrafa Gym (Water): Get Kofu's wallet"; + return "16: Cascarrafa Gym (Water): Get Kofu's wallet"; } std::string AutoStory_Segment_16::start_text() const{ @@ -46,16 +47,16 @@ void AutoStory_Segment_16::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 13.1: Cascarrafa Gym (Water): Get Kofu's wallet", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_35(env, context, options.notif_status_update); checkpoint_36(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 13.1: Cascarrafa Gym (Water): Get Kofu's wallet", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -99,7 +100,7 @@ void checkpoint_35( mash_button_till_overworld(env.console, context, BUTTON_A); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -178,7 +179,7 @@ void checkpoint_36( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp index 1d4574d920..7b0ff3c6d7 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -28,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_17::name() const{ - return "13.2: Cascarrafa Gym (Water): Gym challenge and Gym battle"; + return "17: Cascarrafa Gym (Water): Gym challenge and Gym battle"; } std::string AutoStory_Segment_17::start_text() const{ @@ -46,16 +47,16 @@ void AutoStory_Segment_17::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 13.2: Cascarrafa Gym (Water): Gym battle", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_37(env, context, options.notif_status_update); checkpoint_38(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 13.2: Cascarrafa Gym (Water): Gym battle", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -102,7 +103,7 @@ void checkpoint_37( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -173,7 +174,7 @@ void checkpoint_38( mash_button_till_overworld(env.console, context, BUTTON_A, 360); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.cpp index d406383e8e..fc09a3f283 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_18.cpp @@ -30,7 +30,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_18::name() const{ - return "14: Great Tusk/Iron Treads titan"; + return "18: Great Tusk/Iron Treads titan"; } std::string AutoStory_Segment_18::start_text() const{ @@ -48,16 +48,16 @@ void AutoStory_Segment_18::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 14: Great Tusk/Iron Treads titan", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_39(env, context, options.notif_status_update); checkpoint_40(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 14: Great Tusk/Iron Treads titan", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -229,7 +229,7 @@ void checkpoint_39( mash_button_till_overworld(env.console, context, BUTTON_A, 360); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -353,7 +353,7 @@ void checkpoint_40( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_19.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_19.cpp index 3b1cf9f720..567526ca5e 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_19.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_19.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -28,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_19::name() const{ - return "15.1: Klawf Titan: Battle Klawf"; + return "19: Klawf Titan: Battle Klawf"; } std::string AutoStory_Segment_19::start_text() const{ @@ -46,16 +47,16 @@ void AutoStory_Segment_19::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment 15.2: Klawf Titan: Battle Klawf", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_41(env, context, options.notif_status_update); checkpoint_42(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment 15.2: Klawf Titan: Battle Klawf", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -245,7 +246,7 @@ void checkpoint_41( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -356,7 +357,7 @@ void checkpoint_42( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp index 420e872ab4..24654bb9da 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp @@ -31,7 +31,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_20::name() const{ - return "16: Artazon Gym (Grass)"; + return "20: Artazon Gym (Grass)"; } std::string AutoStory_Segment_20::start_text() const{ @@ -49,17 +49,17 @@ void AutoStory_Segment_20::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment ", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_43(env, context, options.notif_status_update); checkpoint_44(env, context, options.notif_status_update); checkpoint_45(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment ", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -131,7 +131,7 @@ void checkpoint_43( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -477,7 +477,7 @@ void checkpoint_44( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -540,7 +540,7 @@ void checkpoint_45( mash_button_till_overworld(env.console, context, BUTTON_A); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_21.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_21.cpp index daa7d080bc..372f866501 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_21.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_21.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h" @@ -28,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_21::name() const{ - return "17.1: Team Star (Fire): Go to East Province (Area One) Pokecenter"; + return "21: Team Star (Fire): Go to East Province (Area One) Pokecenter"; } std::string AutoStory_Segment_21::start_text() const{ @@ -46,15 +47,15 @@ void AutoStory_Segment_21::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment ", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); checkpoint_46(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment ", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -110,7 +111,7 @@ void checkpoint_46( fly_to_overlapping_flypoint(env.program_info(), env.console, context); break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_22.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_22.cpp index 693f1eb20e..571181cc28 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_22.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_22.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "PokemonSV/Programs/PokemonSV_GameEntry.h" #include "PokemonSV/Programs/PokemonSV_SaveGame.h" @@ -25,7 +26,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_22::name() const{ - return "17.1: Team Star (Fire): Beat Team Star"; + return "22: Team Star (Fire): Beat Team Star"; } std::string AutoStory_Segment_22::start_text() const{ @@ -43,15 +44,15 @@ void AutoStory_Segment_22::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment ", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); // checkpoint_(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment ", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } @@ -82,7 +83,7 @@ void checkpoint_47( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -120,7 +121,7 @@ void checkpoint_48( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); @@ -158,7 +159,7 @@ void checkpoint_49( break; - }catch (...){ + }catch(OperationFailedException&){ context.wait_for_all_requests(); env.console.log("Resetting from checkpoint."); reset_game(env.program_info(), env.console, context); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_23.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_23.cpp index 0850353eab..df9981ec3d 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_23.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_23.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "PokemonSV/Programs/PokemonSV_GameEntry.h" #include "PokemonSV/Programs/PokemonSV_SaveGame.h" @@ -42,15 +43,15 @@ void AutoStory_Segment_23::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment ", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); // checkpoint_(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment ", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_24.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_24.cpp index 93f7a96131..58e4f047eb 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_24.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_24.cpp @@ -4,6 +4,7 @@ * */ +#include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "PokemonSV/Programs/PokemonSV_GameEntry.h" #include "PokemonSV/Programs/PokemonSV_SaveGame.h" @@ -42,15 +43,15 @@ void AutoStory_Segment_24::run_segment( ) const{ AutoStoryStats& stats = env.current_stats(); + stats.m_segment++; + env.update_stats(); context.wait_for_all_requests(); - env.console.log("Start Segment ", COLOR_ORANGE); + env.console.log("Start Segment " + name(), COLOR_ORANGE); // checkpoint_(env, context, options.notif_status_update); context.wait_for_all_requests(); - env.console.log("End Segment ", COLOR_GREEN); - stats.m_segment++; - env.update_stats(); + env.console.log("End Segment " + name(), COLOR_GREEN); }