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 @@ -78,6 +78,7 @@ StatsReset::StatsReset()
{GiftPokemon::FLOETTE, "floette", "Floette" },
{GiftPokemon::GENESECT, "genesect", "Genesect" },
{GiftPokemon::MAGEARNA, "magearna", "Magearna"},
{GiftPokemon::MARSHADOW, "marshadow", "Marshadow"},
{GiftPokemon::MELTAN, "meltan", "Meltan" },
{GiftPokemon::MELMETAL, "melmetal", "Melmetal"},
{GiftPokemon::VOLCANION,"volcanion","Volcanion"},
Expand Down Expand Up @@ -155,7 +156,7 @@ StatsReset::~StatsReset(){
}

void StatsReset::on_config_value_changed(void* object){
ConfigOptionState state_ball = (POKEMON == GiftPokemon::GENESECT || POKEMON == GiftPokemon::MELTAN || POKEMON == GiftPokemon::VOLCANION)
ConfigOptionState state_ball = (POKEMON == GiftPokemon::GENESECT || POKEMON == GiftPokemon::MARSHADOW || POKEMON == GiftPokemon::MELTAN || POKEMON == GiftPokemon::VOLCANION)
? ConfigOptionState::ENABLED : ConfigOptionState::HIDDEN;
ConfigOptionState state_donut = (POKEMON == GiftPokemon::GENESECT || POKEMON == GiftPokemon::MELMETAL || POKEMON == GiftPokemon::HOOPA)
? ConfigOptionState::ENABLED : ConfigOptionState::HIDDEN;
Expand Down Expand Up @@ -198,15 +199,15 @@ void StatsReset::enter_portal(SingleSwitchProgramEnvironment& env, ProController
{
overworld,
}
);
);

if (ret == 0){
env.log("Detected overworld");
context.wait_for_all_requests();
}
}

void StatsReset::run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context, bool attempt_move, bool use_plus_move){
void StatsReset::run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context, bool attempt_move, bool use_plus_move, bool use_mega){
RunFromBattleWatcher battle_menu(COLOR_GREEN, &env.console.overlay(), 10ms);

context.wait_for_all_requests();
Expand All @@ -218,10 +219,14 @@ void StatsReset::run_battle(SingleSwitchProgramEnvironment& env, ProControllerCo
{
battle_menu,
}
);
);

if (ret == 0){
env.log("Detected battle menu");
if (use_mega){
pbf_press_button(context, BUTTON_RCLICK, 50ms, 500ms);
pbf_wait(context, 12s);
}
if (attempt_move){
pbf_press_button(context, BUTTON_Y, 50ms, 500ms);
ssf_press_button(context, BUTTON_ZL, 0ms, 4s, 200ms);
Expand Down Expand Up @@ -253,7 +258,7 @@ void StatsReset::run_catch(SingleSwitchProgramEnvironment& env, ProControllerCon
BUTTON_ZL | BUTTON_ZR,
500ms, 500ms + (hold + cool) * scrolls,
0ms
);
);

while (scrolls != 0){
pbf_press_dpad(context, direction, hold, cool);
Expand Down Expand Up @@ -286,7 +291,7 @@ void StatsReset::program(SingleSwitchProgramEnvironment& env, ProControllerConte
ErrorReport::SEND_ERROR_REPORT,
"Failed to travel to Quasartico Inc.",
env.console
);
);
}
context.wait_for(100ms);
env.log("Detected overworld. Fast traveled to Quasartico Inc.");
Expand Down Expand Up @@ -324,7 +329,7 @@ void StatsReset::program(SingleSwitchProgramEnvironment& env, ProControllerConte
ErrorReport::SEND_ERROR_REPORT,
"Failed to travel to Lysandre Café",
env.console
);
);
}
context.wait_for(100ms);
env.log("Detected overworld. Fast traveled to Lysandre Café");
Expand Down Expand Up @@ -381,7 +386,7 @@ void StatsReset::program(SingleSwitchProgramEnvironment& env, ProControllerConte
ErrorReport::SEND_ERROR_REPORT,
"Failed to travel to Wild Zone 13",
env.console
);
);
}
context.wait_for(100ms);
env.log("Detected overworld. Fast traveled to Wild Zone 13");
Expand Down Expand Up @@ -449,6 +454,25 @@ void StatsReset::program(SingleSwitchProgramEnvironment& env, ProControllerConte
pbf_mash_button(context, BUTTON_A, 20s);
}

if (POKEMON == GiftPokemon::MARSHADOW){
// assume user is already at the nearest Pokémon Center, run towards the shadow
// no additional flying since this is time sensitive
pbf_move_left_joystick(context, {-0.3, -1}, 4500ms, 500ms);
pbf_press_button(context, BUTTON_L, 50ms, 500ms);
pbf_move_left_joystick(context, {-0.5, 1}, 100ms, 500ms);
pbf_press_button(context, BUTTON_L, 50ms, 500ms);
context.wait_for_all_requests();
run_towards_gate_with_A_button(env.console, context, 0, +1, Seconds(10));

pbf_mash_button(context, BUTTON_A, 20s);
run_battle(env, context, true, true, true);
// additional delay because Dragon Ascent takes longer to launch
pbf_wait(context, 1s);

run_catch(env, context);
pbf_mash_button(context, BUTTON_A, 7s);
}

if (POKEMON == GiftPokemon::HOOPA){
// run to holovator from bleu pokemon center
pbf_move_left_joystick(context, {1, -0.5}, 200ms, 500ms);
Expand Down Expand Up @@ -573,7 +597,7 @@ void StatsReset::program(SingleSwitchProgramEnvironment& env, ProControllerConte
overworld,
battle_menu
}
);
);
switch (result){
case 0:
env.log(STRING_POKEMON + " dialog finished.", COLOR_PURPLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class StatsReset : public SingleSwitchProgramInstance, public ConfigOption::List

private:
virtual void enter_portal(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
virtual void run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context, bool attempt_move = false, bool use_plus_move = false);
virtual void run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context, bool attempt_move = false, bool use_plus_move = false, bool use_mega = false);
virtual void run_catch(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
virtual void on_config_value_changed(void* object) override;
StartInGripOrGameOption START_LOCATION;
Expand All @@ -55,6 +55,7 @@ class StatsReset : public SingleSwitchProgramInstance, public ConfigOption::List
FLOETTE,
GENESECT,
MAGEARNA,
MARSHADOW,
MELTAN,
MELMETAL,
VOLCANION,
Expand Down
Loading