From 9a0a7ed7e5a6f96f4b5b1987ae5079afaa47a535 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 19 Oct 2025 22:08:24 -0700 Subject: [PATCH 1/8] checkpoint 90: beat nemona --- .../PokemonSV_AutoStory_Segment_34.cpp | 42 ++++++++++++++++++- .../PokemonSV_AutoStory_Segment_34.h | 26 +++++++++--- .../Programs/PokemonSV_WorldNavigation.cpp | 2 +- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index b38c7af64e..224d948ae5 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -29,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_34::name() const{ - return "35: "; + return "34: "; } std::string AutoStory_Segment_34::start_text() const{ @@ -53,7 +53,9 @@ void AutoStory_Segment_34::run_segment( context.wait_for_all_requests(); env.console.log("Start Segment " + name(), COLOR_ORANGE); - // checkpoint_(env, context, options.notif_status_update, stats); + checkpoint_90(env, context, options.notif_status_update, stats); + checkpoint_91(env, context, options.notif_status_update, stats); + checkpoint_92(env, context, options.notif_status_update, stats); context.wait_for_all_requests(); env.console.log("End Segment " + name(), COLOR_GREEN); @@ -63,12 +65,48 @@ void AutoStory_Segment_34::run_segment( void checkpoint_90(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + // Fly to Academy + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 255, 230, 80}, FlyPoint::FAST_TRAVEL); + + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 128, 255, 100); + + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_TIME, NavigationMovementMode::DIRECTIONAL_ONLY, + 128, 0, 30, 30, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 120, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW}); + + env.console.log("Battle Nemona."); + run_trainer_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + + + }); } void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); } void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + + }); } void checkpoint_93(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h index 8c374db0fd..89788b45da 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h @@ -26,28 +26,42 @@ class AutoStory_Segment_34 : public AutoStory_Segment{ ) const override; }; +static constexpr std::string segment_num = "34"; -// start: -// end: + +inline std::string checkpoint90_start(){ return segment_num + ": Beat Geeta. At Pokemon League Pokecenter.";} +inline std::string checkpoint90_end(){ return segment_num + ": Beat Nemona. At dormitory room, next to bed.";} +// start: Beat Geeta. At Pokemon League Pokecenter. +// end: Beat Nemona. At dormitory room, next to bed. void checkpoint_90(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: -// end: +inline std::string checkpoint91_start(){ return checkpoint90_end();} +inline std::string checkpoint91_end(){ return segment_num + ": Beat Penny. At Naranja Academy fly point.";} +// start: Beat Nemona. At dormitory room, next to bed." +// end: Beat Penny. At Naranja Academy fly point. void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: -// end: +inline std::string checkpoint92_start(){ return checkpoint91_end();} +inline std::string checkpoint92_end(){ return segment_num + ": Beat Arven. At Los Platos Pokecenter.";} +// start: Beat Penny. At Naranja Academy fly point. +// end: Beat Arven. At Los Platos Pokecenter. void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); +// std::string checkpoint_start(){ return segment_num + "";} +// std::string checkpoint_end(){ return segment_num + "";} // start: // end: void checkpoint_93(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); +// std::string checkpoint_start(){ return segment_num + "";} +// std::string checkpoint_end(){ return segment_num + "";} // start: // end: void checkpoint_94(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); +// std::string checkpoint_start(){ return segment_num + "";} +// std::string checkpoint_end(){ return segment_num + "";} // start: // end: void checkpoint_95(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); diff --git a/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_WorldNavigation.cpp b/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_WorldNavigation.cpp index 16b80d1e62..bcd6d887fc 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_WorldNavigation.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/PokemonSV_WorldNavigation.cpp @@ -908,7 +908,7 @@ void run_battle_press_A( int ret = wait_until( stream, context, - std::chrono::seconds(90), + std::chrono::seconds(360), callbacks ); context.wait_for(std::chrono::milliseconds(100)); From 9006a9daa318fbd4f9f5b052552eea8b7709f3d3 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 19 Oct 2025 22:57:47 -0700 Subject: [PATCH 2/8] add notes explaining moves for Elite Four 1 --- .../AutoStory/PokemonSV_AutoStory_Segment_33.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_33.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_33.cpp index 276d4939e7..70bd8555d9 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_33.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_33.cpp @@ -298,7 +298,19 @@ void checkpoint_88(SingleSwitchProgramEnvironment& env, ProControllerContext& co SinglesMoveEntry move4{SinglesMoveType::Move4, false}; // Misty Terrain std::vector move_table1 = {move1, move4, move1}; bool terastallized = false; + // use Moonblast to KO the Whiscash. Then setup Misty Terrain on the second pokemon, Camerupt. + // Then spam Moonblast to finish off the rest of the team. + // We setup Misty Terrain to prevent getting poisoned by the Donphan's Poison Jab, since it survives with Sturdy. + // Getting poisoned will cause us to fail the Elite Four since we have no easy way to heal off poison. + // We don't setup Misty Terrain on the Whiscash since Muddy Water can lower our accuracy. bool is_won = run_pokemon(env.console, context, move_table1, true, terastallized); + if (!is_won){// throw exception if we lose + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "Failed to beat the Ground trainer. Reset.", + env.console + ); + } // finished battle mash_button_till_overworld(env.console, context, BUTTON_A); From 8f30528a98f32a6a64e304dafb4d3094a3696d19 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 19 Oct 2025 22:58:44 -0700 Subject: [PATCH 3/8] checkpoint 92: beat Penny --- .../PokemonSV_AutoStory_Segment_34.cpp | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index 224d948ae5..ac58df9013 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -3,7 +3,7 @@ * From: https://github.com/PokemonAutomation/ * */ - +#include "PokemonSV/Programs/Battles/PokemonSV_SinglesBattler.h" #include "CommonFramework/Exceptions/OperationFailedException.h" #include "CommonTools/Async/InferenceRoutines.h" @@ -105,6 +105,85 @@ void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& co checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ + // walk down + pbf_move_left_joystick(context, 128, 255, 100, 100); + // walk right towards door + pbf_move_left_joystick(context, 255, 128, 200, 100); + + wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.193, 0.047, 0.078}, 10); + + env.console.log("Leave dorm for schoolyard."); + pbf_press_dpad(context, DPAD_UP, 13, 20); + pbf_press_dpad(context, DPAD_LEFT, 13, 20); + pbf_press_dpad(context, DPAD_DOWN, 13, 20); + wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.790, 0.047, 0.078}, 10); + pbf_mash_button(context, BUTTON_A, 1000ms); + + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW, CallbackEnum::PROMPT_DIALOG}); + SinglesMoveEntry move1{SinglesMoveType::Move1, true}; // Moonblast + std::vector move_table1 = {move1}; + bool terastallized = false; + bool is_won = run_pokemon(env.console, context, move_table1, true, terastallized); + if (!is_won){// throw exception if we lose + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "Failed to beat the Ground trainer. Reset.", + env.console + ); + } + + mash_button_till_overworld(env.console, context, BUTTON_A); + + // now back in dorm room. + + // walk right towards door + pbf_move_left_joystick(context, 255, 128, 200, 100); + + wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.193, 0.047, 0.078}, 10); + + env.console.log("Leave dorm for Director's office."); + pbf_press_dpad(context, DPAD_DOWN, 13, 20); + pbf_press_dpad(context, DPAD_RIGHT, 13, 20); + pbf_press_dpad(context, DPAD_DOWN, 13, 20); + wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.345, 0.047, 0.078}, 10); + pbf_mash_button(context, BUTTON_A, 1000ms); + + wait_for_overworld(env.program_info(), env.console, context); + + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_ONLY, 30); + + mash_button_till_overworld(env.console, context, BUTTON_A); + + // walk right towards door + pbf_move_left_joystick(context, 255, 128, 200, 100); + + wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.193, 0.047, 0.078}, 10); + mash_button_till_overworld(env.console, context, BUTTON_A); + + // now in school lobby + + pbf_move_left_joystick(context, 128, 255, 1000, 100); + // wait for dialog when leaving school lobby + pbf_wait(context, 3 * TICKS_PER_SECOND); + + mash_button_till_overworld(env.console, context, BUTTON_A); + + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + handle_when_stationary_in_overworld(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_DIALOG, NavigationMovementMode::DIRECTIONAL_SPAM_A, + 128, 0, 60, 60, false); + }, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 255, 40, 50); + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_OLD_MARKER); + } + ); + + mash_button_till_overworld(env.console, context, BUTTON_A); + + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 0, 0, 0}, FlyPoint::FAST_TRAVEL); }); } From f1c2f15e3d4669a7f22eaa74e25c2d4afd74ab6a Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 19 Oct 2025 23:00:37 -0700 Subject: [PATCH 4/8] move checkpoint 92 to 91 --- .../PokemonSV_AutoStory_Segment_34.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index ac58df9013..b8806bde30 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -96,15 +96,7 @@ void checkpoint_90(SingleSwitchProgramEnvironment& env, ProControllerContext& co void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ - - - }); -} - -void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ - checkpoint_reattempt_loop(env, context, notif_status_update, stats, - [&](size_t attempt_number){ - + // walk down pbf_move_left_joystick(context, 128, 255, 100, 100); // walk right towards door @@ -185,6 +177,15 @@ void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& co move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 0, 0, 0}, FlyPoint::FAST_TRAVEL); + + }); +} + +void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + }); } From 0ac431e07174908310b8244d4ad5b63cd52923f6 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 19 Oct 2025 23:57:53 -0700 Subject: [PATCH 5/8] update checkpoint 91 --- .../Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp | 6 +++++- .../Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index b8806bde30..0096713e50 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -111,7 +111,8 @@ void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& co wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.790, 0.047, 0.078}, 10); pbf_mash_button(context, BUTTON_A, 1000ms); - clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW, CallbackEnum::PROMPT_DIALOG}); + clear_dialog(env.console, context, ClearDialogMode::STOP_TIMEOUT, 60, {CallbackEnum::PROMPT_DIALOG}); + pbf_mash_button(context, BUTTON_A, 1000ms); SinglesMoveEntry move1{SinglesMoveType::Move1, true}; // Moonblast std::vector move_table1 = {move1}; bool terastallized = false; @@ -154,6 +155,9 @@ void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& co // now in school lobby + context.wait_for_all_requests(); + context.wait_for(1000ms); + pbf_move_left_joystick(context, 128, 255, 1000, 100); // wait for dialog when leaving school lobby pbf_wait(context, 3 * TICKS_PER_SECOND); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h index 89788b45da..fb4c227761 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.h @@ -37,14 +37,14 @@ inline std::string checkpoint90_end(){ return segment_num + ": Beat Nemona. At d void checkpoint_90(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); inline std::string checkpoint91_start(){ return checkpoint90_end();} -inline std::string checkpoint91_end(){ return segment_num + ": Beat Penny. At Naranja Academy fly point.";} +inline std::string checkpoint91_end(){ return segment_num + ": Beat Penny. At Academy fly point.";} // start: Beat Nemona. At dormitory room, next to bed." -// end: Beat Penny. At Naranja Academy fly point. +// end: Beat Penny. At Academy fly point. void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); inline std::string checkpoint92_start(){ return checkpoint91_end();} inline std::string checkpoint92_end(){ return segment_num + ": Beat Arven. At Los Platos Pokecenter.";} -// start: Beat Penny. At Naranja Academy fly point. +// start: Beat Penny. At Academy fly point. // end: Beat Arven. At Los Platos Pokecenter. void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); From 6ca83d08d1287e4541a6436d6b736df2fd70cd4b Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 20 Oct 2025 18:30:28 -0700 Subject: [PATCH 6/8] update clear_dialog to always mash A --- .../AutoStory/PokemonSV_AutoStoryTools.cpp | 34 +++++++++++++------ .../PokemonSV_AutoStory_Segment_34.cpp | 5 +-- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp index 9177558492..1b518c269e 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp @@ -135,20 +135,32 @@ void clear_dialog(VideoStream& stream, ProControllerContext& context, } - int ret = wait_until( + // int ret = wait_until( + // stream, context, + // std::chrono::seconds(seconds_timeout), + // callbacks + // ); + + WallClock start_inference = current_time(); + int ret = run_until( stream, context, - std::chrono::seconds(seconds_timeout), + [&](ProControllerContext& context){ + + if (mode == ClearDialogMode::STOP_TIMEOUT){ + context.wait_for(Seconds(seconds_timeout)); + }else{ // press A every 8 seconds, until we time out. + auto button_press_period = Seconds(8); + while (true){ + if (current_time() - start_inference + button_press_period > Seconds(seconds_timeout)){ + break; + } + context.wait_for(button_press_period); + pbf_press_button(context, BUTTON_A, 160ms, 0ms); + } + } + }, callbacks ); - // int ret = run_until( - // console, context, - // [&](ProControllerContext& context){ - // for (size_t j = 0; j < seconds_timeout/3; j++){ - // pbf_press_button(context, BUTTON_A, 20, 3*TICKS_PER_SECOND-20); - // } - // }, - // {overworld, prompt, whitebutton, advance_dialog, battle} - // ); context.wait_for(std::chrono::milliseconds(100)); if (ret < 0){ stream.log("clear_dialog(): Timed out."); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index 0096713e50..e28a709dad 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -111,8 +111,9 @@ void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& co wait_for_gradient_arrow(env.program_info(), env.console, context, {0.031, 0.790, 0.047, 0.078}, 10); pbf_mash_button(context, BUTTON_A, 1000ms); - clear_dialog(env.console, context, ClearDialogMode::STOP_TIMEOUT, 60, {CallbackEnum::PROMPT_DIALOG}); - pbf_mash_button(context, BUTTON_A, 1000ms); + // clear_dialog(env.console, context, ClearDialogMode::STOP_TIMEOUT, 60, {CallbackEnum::PROMPT_DIALOG}); + // pbf_mash_button(context, BUTTON_A, 1000ms); + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW, CallbackEnum::PROMPT_DIALOG}); SinglesMoveEntry move1{SinglesMoveType::Move1, true}; // Moonblast std::vector move_table1 = {move1}; bool terastallized = false; From 0dcd237862a6e85643e716ce7595608ff14d887c Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 20 Oct 2025 21:55:58 -0700 Subject: [PATCH 7/8] checkpoint 92: battle Arven --- .../PokemonSV_AutoStory_Segment_34.cpp | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp index e28a709dad..afd5f9c503 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_34.cpp @@ -29,7 +29,7 @@ namespace PokemonSV{ std::string AutoStory_Segment_34::name() const{ - return "34: "; + return "34: Battle Nemona, Penny, Arven"; } std::string AutoStory_Segment_34::start_text() const{ @@ -37,7 +37,7 @@ std::string AutoStory_Segment_34::start_text() const{ } std::string AutoStory_Segment_34::end_text() const{ - return "End: "; + return "End: Beat Nemona, Penny, and Arven. At Los Platos Pokecenter."; } void AutoStory_Segment_34::run_segment( @@ -114,6 +114,7 @@ void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& co // clear_dialog(env.console, context, ClearDialogMode::STOP_TIMEOUT, 60, {CallbackEnum::PROMPT_DIALOG}); // pbf_mash_button(context, BUTTON_A, 1000ms); clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW, CallbackEnum::PROMPT_DIALOG}); + env.console.log("Battle Penny."); SinglesMoveEntry move1{SinglesMoveType::Move1, true}; // Moonblast std::vector move_table1 = {move1}; bool terastallized = false; @@ -189,8 +190,36 @@ void checkpoint_91(SingleSwitchProgramEnvironment& env, ProControllerContext& co void checkpoint_92(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ checkpoint_reattempt_loop(env, context, notif_status_update, stats, [&](size_t attempt_number){ + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::ZOOM_IN, 145, 255, 350}, FlyPoint::FAST_TRAVEL); + handle_unexpected_battles(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_move_left_joystick(context, 0, 128, 1000ms, 100ms); + }); + mash_button_till_overworld(env.console, context, BUTTON_A); + // clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD, CallbackEnum::PROMPT_DIALOG}); + + // leave the inside of the lighthouse and go outside + pbf_move_left_joystick(context, 128, 255, 100, 50); + pbf_move_left_joystick(context, 0, 128, 300, 50); + pbf_move_left_joystick(context, 255, 255, 100, 50); + pbf_wait(context, 3 * TICKS_PER_SECOND); + // wait for overworld after building + wait_for_overworld(env.program_info(), env.console, context, 30); + + realign_player(env.program_info(), env.console, context, PlayerRealignMode::REALIGN_NEW_MARKER, 0, 190, 50); + overworld_navigation(env.program_info(), env.console, context, + NavigationStopCondition::STOP_DIALOG, NavigationMovementMode::DIRECTIONAL_SPAM_A, + 128, 0, 30, 30, false); + + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW, CallbackEnum::PROMPT_DIALOG}); + env.console.log("Battle Arven."); + run_trainer_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG); + + mash_button_till_overworld(env.console, context, BUTTON_A); + + move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 0, 0}, FlyPoint::POKECENTER); }); } From 0a6fa99e66baa04bc0958ae23050bef06d4c43ce Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 20 Oct 2025 22:35:34 -0700 Subject: [PATCH 8/8] enable segment 34 --- .../Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp index f2aafabb2d..d80e43b340 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp @@ -110,7 +110,7 @@ std::vector> make_autoStory_segment_list(){ segment_list.emplace_back(std::make_unique()); segment_list.emplace_back(std::make_unique()); segment_list.emplace_back(std::make_unique()); - // segment_list.emplace_back(std::make_unique()); + segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); return segment_list;