Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Autostory tools. added UnexpectedBattleException. #493

Merged
merged 4 commits into from
Oct 6, 2024

Conversation

jw098
Copy link
Collaborator

@jw098 jw098 commented Oct 5, 2024

  • added UnexpectedBattleException.

  • added battle detection for functions that need to detect overworld.

  • Updated DestionationMarker detector so that it can be detected within the minimap (where it alternates between orange and yellow).

  • I also added handle_when_stationary_in_overworld(). It's commented out for now, since it requires StationaryOverworldWatcher, which hasn't been merged yet. I'll submit this in another PR later.

namespace PokemonAutomation{


UnexpectedBattleException::UnexpectedBattleException(ErrorReport error_report, Logger& logger, std::string message)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, there will be 4 exception classes with near identical implementations. I'll probably revisit this in future to try to merge away some of this duplicate code.

return fly_to_overworld_from_map(info, console, context, true);

}catch (UnexpectedBattleException& e){
(void) e;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you omit the parameter name in the catch declaration, you don't need to do this.

}catch (UnexpectedBattleException&){

open_map_from_overworld(info, console, context);
fly_to_closest_pokecenter_on_map(info, console, context);
}catch (UnexpectedBattleException& e){
(void) e;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

throw OperationFailedException(
ErrorReport::SEND_ERROR_REPORT, console,
"leave_phone_to_overworld(): Unknown state after 10 button Y presses.",
true
);
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how these random trailing spaces get added.

@Mysticial Mysticial merged commit 52f8e86 into PokemonAutomation:main Oct 6, 2024
4 of 6 checks passed
@jw098 jw098 deleted the autostory-tools branch October 7, 2024 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants