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 @@ -11,8 +11,9 @@
* the executor turns that into a failed step.
*
* They are in files by area: _Events_Lake (00.00 to 00.03), _Sandgem
* (00.04), _Jubilife (00.05, 01.01, 01.06 to 01.08), _Oreburgh (01.02 to
* 01.05) and _Route204 (01.09 to 01.11).
* (00.04), _Jubilife (00.05, 01.01), _Route203 (01.02), _Oreburgh (01.03
* and 01.04) and _Route204 (01.09's Rock Smash, 01.11). 01.05 to 01.10
* are planned walks in the story table.
*
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* BDSP AutoStory - Events: Jubilife City (00.05, 01.01, 01.07)
/* BDSP AutoStory - Events: Jubilife City (00.05, 01.01)
*
* From: https://github.com/PokemonAutomation/
*
* The Jubilife beats of 00.05 the story table cannot plan (up the steps,
* Barry's Town Map, the talk to a wandering clown), and segment 01's walks
* out of the Center to Barry and up to Rowan's scene.
* Barry's Town Map, the talk to a wandering clown), and segment 01's walk
* out of the Center to Barry.
*
*/

Expand Down Expand Up @@ -209,37 +209,6 @@ void east_to_barry(VideoStream& stream, ProControllerContext& context){
}
}

// 01.07: west along Jubilife's long road to the crossroads.
void west_to_the_crossroads(VideoStream& stream, ProControllerContext& context){
// Route 203's row 18 carries on as Jubilife's long road. From the first
// tile the crossroads with the street north to Route 204 is 14 tiles
// west; the street is about 4 tiles wide, so a stick hold does (by hand,
// 2026-10-31: 2 x 1120 ms landed mid-street; 7 D-pad taps stopped below
// a building, and 18 went on to the road down to Route 202, r230b).
route_turn(stream, context, Direction::WEST);
pbf_move_left_joystick(context, {-1, 0}, route_open_hold(Direction::WEST, 14), 300ms);
context.wait_for_all_requests();
}

// 01.07: north up the street until Rowan's scene starts.
void north_to_rowan(VideoStream& stream, ProControllerContext& context){
// North up the street: Rowan's scene starts a few tiles up (by hand, a
// 6 s walk). It opens with a cutscene, not a dialog box, so the walk
// reads as stopped; wait for his first line. The green-haired man walks
// about the crossroads and may stand in our way: wait and walk again.
bool scene = false;
for (size_t tries = 0; tries < 3 && !scene; tries++){
const WalkResult up = walk_dir(stream, context, Direction::NORTH, 6000ms, "north up the street to Route 204");
scene = up.stop == WalkStop::DIALOG || dialogue_opens(stream, context, 8000ms);
if (!scene){
pbf_wait(context, 2500ms);
}
}
if (!scene){
fail_step(stream, "Jubilife: Rowan's scene did not start up the street north.");
}
}

}


Expand All @@ -249,8 +218,6 @@ void add_jubilife_events(StoryEvents& events){
events.emplace("talk_to_wanderer", talk_to_wanderer);
events.emplace("jubilife_center_to_street", console_event(jubilife_center_to_street));
events.emplace("east_to_barry", console_event(east_to_barry));
events.emplace("west_to_the_crossroads", console_event(west_to_the_crossroads));
events.emplace("north_to_rowan", console_event(north_to_rowan));
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* BDSP AutoStory - Events: Oreburgh (01.03 to 01.05)
/* BDSP AutoStory - Events: Oreburgh (01.03 to 01.04)

Check warning on line 1 in SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Events_Oreburgh.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=522 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
* Segment 01's walks in Oreburgh: the mine and Roark, the Gym, and back
* out of the Oreburgh Gate, as they ran on the console (2026-10-29 to
* 10-31).
* Segment 01's walks in Oreburgh: the mine and Roark, and the Gym, as
* they ran on the console (2026-10-29 to 10-31).
*
*/

Expand All @@ -21,7 +20,6 @@
#include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_Maps.h"
#include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_StoryMaps.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Indoors.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Location.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.h"
Expand Down Expand Up @@ -504,42 +502,6 @@
}
}

// 01.05: out of the gym onto its doorstep.
void out_of_the_gym(VideoStream& stream, ProControllerContext& context){
// 01.04 ends in front of Roark, just after his battle: its save at
// 01.05's start is right after the win (2026-10-31, at the user's
// request), so a failure later never has to beat him again.
// No trip back to the Oreburgh Center (2026-10-31, the user): talk_or_fight()
// gives a Potion after Roark when HP is low, and Jubilife's Center is on
// the way. Out of the gym onto its doorstep, which is on the Center door's
// row: west along it reaches the stairs' cliff.
if (!dpad_out_of_building(stream, context, 40, "out of the gym")){
fail_step(stream, "Oreburgh Gym: did not leave by its door.");
}
}

// 01.05: up to the platform by the Oreburgh Gate and into it (Barry bumps into us there).
void into_oreburgh_gate(VideoStream& stream, ProControllerContext& context){
// From the gym's doorstep, as walked by hand on 2026-10-29.
walk_dir(stream, context, Direction::WEST, 20000ms, "west to the stairs' cliff");
walk_dir(stream, context, Direction::NORTH, 10000ms, "north along the cliff");
hold_tiles(stream, context, Direction::EAST, 2);
walk_dir(stream, context, Direction::NORTH, 5000ms, "north up the stairs");
walk_dir(stream, context, Direction::WEST, 6000ms, "west along the platform");
hold_tiles(stream, context, Direction::SOUTH, 1);
// Barry runs into us on the platform ("*thud*") the first time; his lines
// end with no battle.
west_until_transition(stream, context, "Into Oreburgh Gate", 8);
}

// 01.05: west through the Gate until Route 203's banner shows.
void out_of_oreburgh_gate(VideoStream& stream, ProControllerContext& context){
// The cave's fade out of the Gate does not always read as a transition
// (r89), so the walk west ends on Route 203's location banner, which
// shows for a few seconds as we step out. 01.06 starts there, from a save.
west_until_transition(stream, context, "West out of Oreburgh Gate", 8, location_banner_showing);
}

}


Expand All @@ -551,9 +513,6 @@
events.emplace("oreburgh_center_heal", console_event(oreburgh_center_heal));
events.emplace("out_of_the_center", console_event(out_of_the_center));
events.emplace("gym_until_roark_beaten", console_event(gym_until_roark_beaten));
events.emplace("out_of_the_gym", console_event(out_of_the_gym));
events.emplace("into_oreburgh_gate", console_event(into_oreburgh_gate));
events.emplace("out_of_oreburgh_gate", console_event(out_of_oreburgh_gate));
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* BDSP AutoStory - Events: Route 203 (01.02, 01.06)
/* BDSP AutoStory - Events: Route 203 (01.02)
*
* From: https://github.com/PokemonAutomation/
*
* Segment 01's walks along Route 203: east to the Oreburgh Gate and through
* it to Oreburgh, and back west to Jubilife, as they ran on the console
* (2026-10-29 to 10-31).
* it to Oreburgh, as they ran on the console (2026-10-29 to 10-31).
*
*/

Expand All @@ -18,16 +17,12 @@
#include "CommonTools/Async/InferenceRoutines.h"
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
#include "PokemonBDSP/Inference/PokemonBDSP_DialogDetector.h"
#include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_StoryMaps.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Location.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.h"
#include "PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.h"
#include "PokemonBDSP_AutoStory_Talks.h"
#include "PokemonBDSP_AutoStory_Walks.h"
#include "PokemonBDSP_AutoStory_WildBattle.h"
#include "PokemonBDSP_AutoStory_Events.h"
#include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_Maps.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
Expand Down Expand Up @@ -188,51 +183,11 @@ void oreburgh_welcome(VideoStream& stream, ProControllerContext& context){
context.wait_for_all_requests();
}

// 01.06: Route 203 on its grid to row 18, below the girl.
Pokemon::Outcome route_203_to_row_18(StoryExecutor& executor, Pokemon::RunState& state, const Pokemon::StoryStep&){
VideoStream& stream = executor.stream();
ProControllerContext& context = executor.context();
// On the grid (Maps/Route203.json, from the decomp,
// its east stretch checked by hand): south from the Gate down the sand,
// west along the sand's bottom row and on under the girl's row, which
// runs straight to Jubilife as row 18. Trainers the map does not list
// are fought where they stop us.
RouteTrainers trainers{{}, [&](const std::string& who){
talk_or_fight(stream, context, "Route 203: " + who);
}};
const std::vector<Pokemon::TilePos> at = walk_route(stream, context, run_from_wild_battle, route203_maps(), map_region("Route203", "gate_exit"), trainers, RouteWalkPlan{on_route203_west_line, "Route 203 to row 18", {}, route_plan_costs()});
if (at.size() != 1){
fail_step(stream, "Route 203: the walk to row 18 did not end on a known tile.");
}
return Pokemon::outcome_ok(Pokemon::tile_pose("Route203", at));
}

// 01.06: west along row 18 into Jubilife, counting tiles.
Pokemon::Outcome row_18_into_jubilife(StoryExecutor& executor, Pokemon::RunState& state, const Pokemon::StoryStep&){
VideoStream& stream = executor.stream();
ProControllerContext& context = executor.context();
const std::vector<Pokemon::TilePos> at = Pokemon::tiles_of(state.pose);
if (at.size() != 1){
fail_step(stream, "Route 203: row 18's walk needs the one tile the walk to it ended on.");
}
// Row 18 has no wall before Jubilife, so count the tiles: from column
// `x` it is x + 1 taps to Jubilife's first tile (by hand from column 31:
// 32 taps, Jubilife's banner on the last one). 01.07 starts there.
dpad_tiles(stream, context, DPAD_LEFT, (size_t)at[0].x + 1, "west along row 18 into Jubilife");
context.wait_for_all_requests();
if (!location_banner_showing(*stream.video().snapshot().frame)){
fail_step(stream, "Route 203: no Jubilife banner after counting the tiles west.");
}
return Pokemon::outcome_ok();
}

}


void add_route203_events(StoryEvents& events){
events.emplace("route_203_east_to_the_gate", route_203_east_to_the_gate);
events.emplace("route_203_to_row_18", route_203_to_row_18);
events.emplace("row_18_into_jubilife", row_18_into_jubilife);
events.emplace("the_hiker", console_event(the_hiker));
events.emplace("hidden_moves_card", console_event(hidden_moves_card));
events.emplace("gate_east_to_oreburgh", console_event(gate_east_to_oreburgh));
Expand Down
Loading
Loading