diff --git a/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.cpp b/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.cpp index 027478efab..8d6dc7b6e9 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.cpp +++ b/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.cpp @@ -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"}, @@ -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; @@ -198,7 +199,7 @@ void StatsReset::enter_portal(SingleSwitchProgramEnvironment& env, ProController { overworld, } - ); + ); if (ret == 0){ env.log("Detected overworld"); @@ -206,7 +207,7 @@ void StatsReset::enter_portal(SingleSwitchProgramEnvironment& env, ProController } } -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(); @@ -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); @@ -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); @@ -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."); @@ -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é"); @@ -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"); @@ -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); @@ -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); diff --git a/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.h b/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.h index 1cbb995b2c..8316d73966 100644 --- a/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.h +++ b/SerialPrograms/Source/PokemonLZA/Programs/NonShinyHunting/PokemonLZA_StatsReset.h @@ -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; @@ -55,6 +55,7 @@ class StatsReset : public SingleSwitchProgramInstance, public ConfigOption::List FLOETTE, GENESECT, MAGEARNA, + MARSHADOW, MELTAN, MELMETAL, VOLCANION,