Skip to content

Commit 64af268

Browse files
authored
Merge pull request #604 from kichithewolf/bbq-date-time-fix
BBQ farmer: reset date after skipping
2 parents 152a987 + 0f609f5 commit 64af268

File tree

4 files changed

+227
-172
lines changed

4 files changed

+227
-172
lines changed

SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_BBQSoloFarmer.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ BBQSoloFarmer::BBQSoloFarmer()
7171
void BBQSoloFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
7272
assert_16_9_720p_min(env.logger(), env.console);
7373
BBQSoloFarmer_Descriptor::Stats& stats = env.current_stats<BBQSoloFarmer_Descriptor::Stats>();
74+
75+
//Make sure console type is set
76+
if (env.console.state().console_type() == ConsoleType::Unknown) {
77+
throw UserSetupError(env.console, "Console Type (Switch 1 or 2) must be specified.");
78+
}
7479

7580
//Fly to plaza
7681
open_map_from_overworld(env.program_info(), env.console, context);
@@ -83,7 +88,7 @@ void BBQSoloFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerCo
8388

8489
//Test a specific quest
8590
/*
86-
BBQuests test_quest = BBQuests::catch_bug;
91+
BBQuests test_quest = BBQuests::catch_water;
8792
bool questTest = process_and_do_quest(env, env.console, context, BBQ_OPTIONS, test_quest, eggs_hatched);
8893
if (questTest){
8994
env.log("Finished quest.");
@@ -131,6 +136,16 @@ void BBQSoloFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerCo
131136
//Clear out the todo list
132137
quests_to_do.clear();
133138

139+
//Fix the time to prevent running out of years
140+
pbf_wait(context, 250);
141+
context.wait_for_all_requests();
142+
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY1);
143+
home_to_date_time(env.console, context, false);
144+
pbf_press_button(context, BUTTON_A, 20, 105);
145+
pbf_press_button(context, BUTTON_A, 20, 105);
146+
pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
147+
resume_game_from_home(env.console, context);
148+
134149
uint64_t temp_save_num_option = BBQ_OPTIONS.SAVE_NUM_QUESTS;
135150
if (temp_save_num_option != 0 && num_completed_quests % temp_save_num_option == 0){
136151
env.log("Saving and resetting.");

0 commit comments

Comments
 (0)