Skip to content

Commit e3198d2

Browse files
committed
Improve sequence to navigate to the egg basket.
1 parent 1a7f3e0 commit e3198d2

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 56;
29-
const int PROGRAM_VERSION_PATCH = 1;
29+
const int PROGRAM_VERSION_PATCH = 2;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggFetcher.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ void EggFetcher::program(SingleSwitchProgramEnvironment& env, ProControllerConte
102102
picnic_at_zero_gate(env.program_info(), env.console, context);
103103
// Now we are at picnic. We are at one end of picnic table while the egg basket is at the other end
104104

105+
#if 1
105106
bool can_make_sandwich = eat_egg_sandwich_at_picnic(env, env.console, context,
106107
EGG_SANDWICH.EGG_SANDWICH_TYPE, LANGUAGE);
107108
if (can_make_sandwich == false){
108109
throw UserSetupError(env.console, "No sandwich recipe or ingredients. Cannot open and select the sandwich recipe.");
109110
}
110-
111+
#endif
111112
stats.m_sandwiches++;
112113
env.update_stats();
113114

@@ -119,8 +120,14 @@ void EggFetcher::program(SingleSwitchProgramEnvironment& env, ProControllerConte
119120
};
120121

121122
const size_t basket_wait_seconds = (EGG_SANDWICH.EGG_SANDWICH_TYPE == EggSandwichType::GREAT_PEANUT_BUTTER ? 180 : 120);
122-
collect_eggs_after_sandwich(env.program_info(), env.console, context, basket_wait_seconds,
123-
EGGS_TO_FETCH, num_eggs_collected, basket_check_callback);
123+
collect_eggs_after_sandwich(
124+
env.program_info(),
125+
env.console, context,
126+
basket_wait_seconds,
127+
EGGS_TO_FETCH,
128+
num_eggs_collected,
129+
basket_check_callback
130+
);
124131

125132
leave_picnic(env.program_info(), env.console, context);
126133

SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,27 @@ void collect_eggs_after_sandwich(
351351
// Recall your ride to reduce obstacles.
352352
pbf_press_button(context, BUTTON_PLUS, 20, 105);
353353

354+
#if 1
355+
// Move left
356+
pbf_move_left_joystick(context, 0, 128, 80ms, 480ms);
357+
pbf_press_button(context, BUTTON_L, 120ms, 120ms);
358+
pbf_move_left_joystick(context, 128, 0, 320ms, 480ms);
359+
360+
// Move forward to pass table
361+
pbf_move_left_joystick(context, 255, 128, 80ms, 480ms);
362+
pbf_press_button(context, BUTTON_L, 120ms, 120ms);
363+
pbf_move_left_joystick(context, 128, 0, 640ms, 320ms);
364+
365+
// Move right
366+
pbf_move_left_joystick(context, 255, 128, 80ms, 480ms);
367+
pbf_press_button(context, BUTTON_L, 120ms, 120ms);
368+
pbf_move_left_joystick(context, 128, 0, 320ms, 320ms);
369+
370+
// Move back to face basket
371+
pbf_move_left_joystick(context, 255, 128, 80ms, 320ms);
372+
pbf_press_button(context, BUTTON_L, 120ms, 120ms);
373+
pbf_move_left_joystick(context, 128, 0, 160ms, 320ms);
374+
#else
354375
// Move left
355376
pbf_move_left_joystick(context, 0, 128, 40, 40);
356377
// Move forward to pass table
@@ -363,6 +384,7 @@ void collect_eggs_after_sandwich(
363384
// Move closer to the basket.
364385
pbf_press_button(context, BUTTON_L, 20, 105);
365386
pbf_move_left_joystick(context, 128, 0, 10, 40);
387+
#endif
366388

367389

368390
context.wait_for_all_requests();

SerialPrograms/Source/PokemonSwSh/Programs/DenHunting/PokemonSwSh_DaySkipperUS.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,14 @@ void DaySkipperUS::run_switch1(SingleSwitchProgramEnvironment& env, ProControlle
148148
void DaySkipperUS::run_switch2(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
149149
using namespace DateSkippers::Switch2;
150150

151+
#if 1
151152
if (context->performance_class() != ControllerPerformanceClass::SerialPABotBase_Wired){
152153
throw UserSetupError(
153154
env.logger(),
154155
"This program requires a tick precise wired controller."
155156
);
156157
}
158+
#endif
157159

158160
SkipperStats& stats = env.current_stats<SkipperStats>();
159161
stats.total_skips = SKIPS;

0 commit comments

Comments
 (0)