Skip to content

Commit 4703a89

Browse files
naussikaGin890
authored andcommitted
fly sport reset: add route for alpha pidgey
1 parent fa8845a commit 4703a89

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

SerialPrograms/Source/PokemonLZA/Programs/ShinyHunting/PokemonLZA_ShinyHunt_FlySpotReset.cpp

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
#include "CommonFramework/Notifications/ProgramNotifications.h"
1010
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
1111
#include "CommonTools/Async/InferenceRoutines.h"
12+
#include "CommonTools/VisualDetectors/BlackScreenDetector.h"
1213
#include "CommonTools/StartupChecks/VideoResolutionCheck.h"
1314
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
15+
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
1416
#include "Pokemon/Pokemon_Strings.h"
1517
#include "PokemonLA/Inference/Sounds/PokemonLA_ShinySoundDetector.h"
1618
#include "PokemonLZA/Programs/PokemonLZA_BasicNavigation.h"
@@ -62,7 +64,7 @@ ShinyHunt_FlySpotReset::ShinyHunt_FlySpotReset()
6264
{
6365
{Route::NO_MOVEMENT, "no_movement", "No Movement"},
6466
{Route::WILD_ZONE_19, "wild_zone_19", "Wild Zone 19"},
65-
// {Route::ALPHA_PIDGEY, "alpha_pidgey", "Alpha Pidgey (Wild Zone 1)"},
67+
{Route::ALPHA_PIDGEY, "alpha_pidgey", "Alpha Pidgey (Wild Zone 1)"},
6668
// {Route::ALPHA_PIKACHU, "alpha_pikachu", "Alpha Pikachu (Wild Zone 6)"},
6769
// {Route::CUSTOMISED_MACRO, "customised_macro", "Customised Macro"},
6870
},
@@ -141,6 +143,40 @@ void route_wild_zone_19(
141143
wait_until_overworld(env.console, context, 50s);
142144
}
143145

146+
void route_alpha_pidgey(
147+
SingleSwitchProgramEnvironment& env,
148+
ProControllerContext& context,
149+
ShinyHunt_FlySpotReset_Descriptor::Stats& stats,
150+
bool to_zoom_to_max){
151+
int ret = -1;
152+
{
153+
BlackScreenOverWatcher black_screen(COLOR_BLUE);
154+
ret = run_until<ProControllerContext>(
155+
env.console, context,
156+
[&](ProControllerContext& context){
157+
ssf_press_button(context, BUTTON_B, 0ms, 500ms, 0ms);
158+
pbf_move_left_joystick(context, 255, 128, 4000ms, 0ms);
159+
pbf_move_left_joystick(context, 128, 255, 7400ms, 0ms);
160+
pbf_move_left_joystick(context, 0, 128, 3000ms, 0ms);
161+
pbf_press_button(context, BUTTON_A, 500ms, 2500ms); // elevator up
162+
pbf_move_left_joystick(context, 255, 128, 100ms, 0ms);
163+
pbf_press_button(context, BUTTON_L, 100ms, 1000ms);
164+
},
165+
{black_screen}
166+
);
167+
}
168+
if (ret == 0){
169+
wait_until_overworld(env.console, context, 50s);
170+
}
171+
open_map(env.console, context, to_zoom_to_max);
172+
pbf_move_left_joystick(context, 128, 255, 200ms, 100ms);
173+
if (fly_from_map(env.console, context) == FastTravelState::NOT_AT_FLY_SPOT) {
174+
pbf_move_left_joystick(context, 255, 128, 100ms, 100ms);
175+
fly_from_map(env.console, context);
176+
}
177+
wait_until_overworld(env.console, context);
178+
}
179+
144180
} // namespace
145181

146182
void ShinyHunt_FlySpotReset::program(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
@@ -174,6 +210,9 @@ void ShinyHunt_FlySpotReset::program(SingleSwitchProgramEnvironment& env, ProCon
174210
case Route::WILD_ZONE_19:
175211
route = route_wild_zone_19;
176212
break;
213+
case Route::ALPHA_PIDGEY:
214+
route = route_alpha_pidgey;
215+
break;
177216
default:
178217
OperationFailedException::fire(
179218
ErrorReport::SEND_ERROR_REPORT,

0 commit comments

Comments
 (0)