Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::vector<std::unique_ptr<AutoStory_Segment>> make_autoStory_segment_list(){
segment_list.emplace_back(std::make_unique<AutoStory_Segment_30>());
segment_list.emplace_back(std::make_unique<AutoStory_Segment_31>());
segment_list.emplace_back(std::make_unique<AutoStory_Segment_32>());
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_33>());
segment_list.emplace_back(std::make_unique<AutoStory_Segment_33>());
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_34>());
// segment_list.emplace_back(std::make_unique<AutoStory_Segment_35>());

Expand Down Expand Up @@ -253,7 +253,7 @@ AutoStory::AutoStory()
"For Start Points that are at Pokecenters, ensure that you fly there so that your character is in the exactly correct start position."
}
, MAINSTORY_NOTE{
"Ensure you have a level 100 Gardevoir with the moves in the following order: Moonblast, Dazzling Gleam, Psychic, Mystical Fire.<br>"
"Ensure you have a level 100 Gardevoir with the moves in the following order: Moonblast, Dazzling Gleam, Mystical Fire, Misty Terrain.<br>"
"Also, make sure you have two other strong pokemon (e.g. level 100 Talonflames)<br>"
"Refer to the documentation on github for more details."
}
Expand Down Expand Up @@ -537,10 +537,10 @@ AutoStory::AutoStory()
}

void AutoStory::on_config_value_changed(void* object){
ConfigOptionState state = (STARTPOINT_TUTORIAL.index() <= 1 && STORY_SECTION == StorySection::TUTORIAL)
? ConfigOptionState::ENABLED
: ConfigOptionState::HIDDEN;
STARTERCHOICE.set_visibility(state);
// ConfigOptionState state = (STARTPOINT_TUTORIAL.index() <= 1 && STORY_SECTION == StorySection::TUTORIAL)
// ? ConfigOptionState::ENABLED
// : ConfigOptionState::HIDDEN;
// STARTERCHOICE.set_visibility(state);

if (STORY_SECTION == StorySection::TUTORIAL){
STARTPOINT_TUTORIAL.set_visibility(ConfigOptionState::ENABLED);
Expand Down Expand Up @@ -730,10 +730,15 @@ void AutoStory::test_checkpoints(
checkpoint_list.push_back([&](){checkpoint_84(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_85(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_86(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_87(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_87(env, context, notif_status_update, stats, language, starter_choice);});
checkpoint_list.push_back([&](){checkpoint_88(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_89(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_90(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_91(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_92(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_93(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_94(env, context, notif_status_update, stats);});
checkpoint_list.push_back([&](){checkpoint_95(env, context, notif_status_update, stats);});


if (end == 0){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void clear_dialog(VideoStream& stream, ProControllerContext& context,

AdvanceDialogWatcher advance_dialog(COLOR_RED);
OverworldWatcher overworld(stream.logger(), COLOR_CYAN);
PromptDialogWatcher prompt(COLOR_YELLOW, {0.50, 0.30, 0.40, 0.60});
PromptDialogWatcher prompt(COLOR_YELLOW, {0.50, 0.25, 0.40, 0.65});
WhiteButtonWatcher whitebutton(COLOR_GREEN, WhiteButton::ButtonA_DarkBackground, {0.725, 0.833, 0.024, 0.045}); // {0.650, 0.650, 0.140, 0.240}
DialogArrowWatcher dialog_arrow(COLOR_RED, stream.overlay(), {0.850, 0.820, 0.020, 0.050}, 0.8365, 0.846);
NormalBattleMenuWatcher battle(COLOR_ORANGE);
Expand Down Expand Up @@ -653,6 +653,40 @@ void handle_unexpected_battles(
}
}

void do_action_and_monitor_for_overworld(
const ProgramInfo& info,
VideoStream& stream,
ProControllerContext& context,
std::function<
void(const ProgramInfo& info,
VideoStream& stream,
ProControllerContext& context)
>&& action
){

OverworldWatcher overworld(stream.logger(), COLOR_CYAN);

int ret = run_until<ProControllerContext>(
stream, context,
[&](ProControllerContext& context){
context.wait_for_all_requests();
action(info, stream, context);
},
{overworld}
);
if (ret < 0){
// successfully completed action detecting the overworld
return;
}else if (ret == 0){
OperationFailedException::fire(
ErrorReport::SEND_ERROR_REPORT,
"do_action_and_monitor_for_overworld(): Failed to complete action. Detected overworld.",
stream
);
}

}

void handle_when_stationary_in_overworld(
const ProgramInfo& info,
VideoStream& stream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ void handle_unexpected_battles(
>&& action
);

// run the given `action`. if detect the overworld, stop the action, and throw exception
void do_action_and_monitor_for_overworld(
const ProgramInfo& info,
VideoStream& stream,
ProControllerContext& context,
std::function<void(const ProgramInfo& info,
VideoStream& stream,
ProControllerContext& context)>&& action
);

// if stationary in overworld for an amount of time (seconds_stationary), run `recovery_action` then try `action` again
// return once successfully completed `action`
// throw exception if fails to complete `action` within a certain amount of time (minutes_timeout).
Expand Down
Loading