Skip to content

Commit 73608e0

Browse files
committed
update checkpoint 61: add routine to clear minimap pokemon.
1 parent 066858d commit 73608e0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_26.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
8+
#include "CommonFramework/VideoPipeline/VideoFeed.h"
89

910
#include "CommonFramework/Exceptions/OperationFailedException.h"
1011
#include "CommonTools/Async/InferenceRoutines.h"
@@ -106,6 +107,13 @@ void checkpoint_61(
106107
);
107108

108109
DirectionDetector direction;
110+
VideoSnapshot snapshot = env.console.video().snapshot();
111+
double current_direction = direction.get_current_direction(env.console, snapshot);
112+
if (current_direction == -1){ // if unable to detect current direction, fly to neighbouring Pokecenter, then fly back. To hopefully clear any pokemon covering the Minimap.
113+
move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 0, 0});
114+
move_cursor_towards_flypoint_and_go_there(env.program_info(), env.console, context, {ZoomChange::KEEP_ZOOM, 0, 0, 0});
115+
}
116+
109117
direction.change_direction(env.program_info(), env.console, context, 0.278620);
110118
pbf_move_left_joystick(context, 128, 0, 400, 50);
111119

@@ -200,7 +208,7 @@ void checkpoint_62(
200208
// lemon
201209
pbf_press_dpad(context, DPAD_DOWN, 13, 20);
202210
pbf_press_button(context, BUTTON_A, 50, 50);
203-
clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD});
211+
clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD}, false);
204212

205213

206214
pbf_mash_button(context, BUTTON_A, 1000ms);

0 commit comments

Comments
 (0)