From 7e5290627f6b374d10ded915b55eda9b21846396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=86=E2=9C=A0Sa=CD=A5b=CD=A3e=CD=ABr=F0=9F=91=91?= =?UTF-8?q?=E2=B0=80?= Date: Sun, 7 Dec 2025 14:08:34 +0800 Subject: [PATCH 1/2] FlySpotReset: add route for alpha pikachu --- .../PokemonLZA_ShinyHunt_FlySpotReset.cpp | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp index b71527780..758b7e9ee 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp +++ b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp @@ -15,6 +15,7 @@ #include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h" #include "Pokemon/Pokemon_Strings.h" #include "PokemonLA/Inference/Sounds/PokemonLA_ShinySoundDetector.h" +#include "PokemonLZA/Inference/PokemonLZA_AlertEyeDetector.h" #include "PokemonLZA/Programs/PokemonLZA_BasicNavigation.h" #include "PokemonLZA_ShinyHunt_FlySpotReset.h" @@ -65,7 +66,7 @@ ShinyHunt_FlySpotReset::ShinyHunt_FlySpotReset() {Route::NO_MOVEMENT, "no_movement", "No Movement"}, {Route::WILD_ZONE_19, "wild_zone_19", "Wild Zone 19"}, {Route::ALPHA_PIDGEY, "alpha_pidgey", "Alpha Pidgey (Wild Zone 1)"}, - // {Route::ALPHA_PIKACHU, "alpha_pikachu", "Alpha Pikachu (Wild Zone 6)"}, + {Route::ALPHA_PIKACHU, "alpha_pikachu", "Alpha Pikachu (Wild Zone 6)"}, // {Route::CUSTOMISED_MACRO, "customised_macro", "Customised Macro"}, }, LockMode::LOCK_WHILE_RUNNING, @@ -177,6 +178,61 @@ void route_alpha_pidgey( wait_until_overworld(env.console, context); } +void route_alpha_pikachu( + SingleSwitchProgramEnvironment& env, + ProControllerContext& context, + ShinyHunt_FlySpotReset_Descriptor::Stats& stats, + bool to_zoom_to_max){ + int ret = -1; + { + BlackScreenOverWatcher black_screen(COLOR_BLUE); + ret = run_until( + env.console, context, + [&](ProControllerContext& context){ + ssf_press_button(context, BUTTON_B, 0ms, 500ms, 0ms); + pbf_move_left_joystick(context, 0, 128, 2000ms, 0ms); + pbf_move_left_joystick(context, 128, 0, 2700ms, 0ms); + pbf_move_left_joystick(context, 255, 128, 1000ms, 0ms); + pbf_mash_button(context, BUTTON_A, 500ms); // ladder + pbf_move_left_joystick(context, 128, 0, 5300ms, 0ms); + }, + {black_screen} + ); + } + if (ret == 0){ + wait_until_overworld(env.console, context, 50s); + //TODO: reset game if still get caught by wild pokémon + } + { + AlertEyeOverWatcher eye_watcher(COLOR_WHITE, &env.console.overlay()); + ret = run_until(env.console, context, [&](ProControllerContext& context){ + pbf_move_left_joystick(context, 255, 128, 3600ms, 0ms); + pbf_move_left_joystick(context, 128, 0, 3000ms, 0ms); + }, {{eye_watcher}}); + } + if (ret < 0){ + AlertEyeOverWatcher eye_watcher(COLOR_WHITE, &env.console.overlay()); + ret = wait_until(env.console, context, 30s, {{eye_watcher}}); + } + if (ret < 0){ + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "AlertEyeOverWatcher: Unable to fast travel after 30s", + env.console); + } + open_map(env.console, context, to_zoom_to_max); + pbf_move_left_joystick(context, 148, 20, 100ms, 200ms); + if (fly_from_map(env.console, context) == FastTravelState::SUCCESS) { + wait_until_overworld(env.console, context); + return; + } else { + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "fly_from_map(): Unable to fast travel", + env.console); + } +} + } // namespace void ShinyHunt_FlySpotReset::program(SingleSwitchProgramEnvironment& env, ProControllerContext& context){ @@ -213,6 +269,9 @@ void ShinyHunt_FlySpotReset::program(SingleSwitchProgramEnvironment& env, ProCon case Route::ALPHA_PIDGEY: route = route_alpha_pidgey; break; + case Route::ALPHA_PIKACHU: + route = route_alpha_pikachu; + break; default: OperationFailedException::fire( ErrorReport::SEND_ERROR_REPORT, From 0c1e2dba8f7be6cc652193635fedafcaf8b67711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=86=E2=9C=A0Sa=CD=A5b=CD=A3e=CD=ABr=F0=9F=91=91?= =?UTF-8?q?=E2=B0=80?= Date: Tue, 9 Dec 2025 18:23:23 +0800 Subject: [PATCH 2/2] FlySpotReset: add route for hunting alpha Patrat --- .../PokemonLZA_ShinyHunt_FlySpotReset.cpp | 36 +++++++++++++++++++ .../PokemonLZA_ShinyHunt_FlySpotReset.h | 1 + 2 files changed, 37 insertions(+) diff --git a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp index 758b7e9ee..fe35dfb06 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp +++ b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp @@ -66,6 +66,7 @@ ShinyHunt_FlySpotReset::ShinyHunt_FlySpotReset() {Route::NO_MOVEMENT, "no_movement", "No Movement"}, {Route::WILD_ZONE_19, "wild_zone_19", "Wild Zone 19"}, {Route::ALPHA_PIDGEY, "alpha_pidgey", "Alpha Pidgey (Wild Zone 1)"}, + {Route::ALPHA_PATRAT, "alpha_patrat", "Alpha Patrat (Cafe Cyclone)"}, {Route::ALPHA_PIKACHU, "alpha_pikachu", "Alpha Pikachu (Wild Zone 6)"}, // {Route::CUSTOMISED_MACRO, "customised_macro", "Customised Macro"}, }, @@ -178,6 +179,38 @@ void route_alpha_pidgey( wait_until_overworld(env.console, context); } +void route_alpha_patrat( + SingleSwitchProgramEnvironment& env, + ProControllerContext& context, + ShinyHunt_FlySpotReset_Descriptor::Stats& stats, + bool to_zoom_to_max){ + { + BlackScreenOverWatcher black_screen(COLOR_BLUE); + int ret = run_until( + env.console, context, + [](ProControllerContext& context){ + ssf_press_button(context, BUTTON_B, 0ms, 500ms, 0ms); + pbf_move_left_joystick(context, 0, 128, 2000ms, 0ms); + pbf_move_left_joystick(context, 96, 0, 3500ms, 0ms); + }, + {black_screen} + ); + if (ret == 0){ + wait_until_overworld(env.console, context, 50s); + } + } + open_map(env.console, context, to_zoom_to_max); + pbf_move_left_joystick(context, 128, 255, 50ms, 100ms); + if (fly_from_map(env.console, context) != FastTravelState::SUCCESS){ + OperationFailedException::fire( + ErrorReport::SEND_ERROR_REPORT, + "fly_from_map(): Unable to fast travel", + env.console); + } + wait_until_overworld(env.console, context, 50s); +} + + void route_alpha_pikachu( SingleSwitchProgramEnvironment& env, ProControllerContext& context, @@ -269,6 +302,9 @@ void ShinyHunt_FlySpotReset::program(SingleSwitchProgramEnvironment& env, ProCon case Route::ALPHA_PIDGEY: route = route_alpha_pidgey; break; + case Route::ALPHA_PATRAT: + route = route_alpha_patrat; + break; case Route::ALPHA_PIKACHU: route = route_alpha_pikachu; break; diff --git a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.h b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.h index 5f7f9fed2..47967a044 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.h +++ b/SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.h @@ -38,6 +38,7 @@ class ShinyHunt_FlySpotReset : public SingleSwitchProgramInstance{ NO_MOVEMENT, WILD_ZONE_19, ALPHA_PIDGEY, + ALPHA_PATRAT, ALPHA_PIKACHU, CUSTOMISED_MACRO = 255, };