Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
71246af
FRLG AutoStory stage 4: Cerulean City
dayfine Nov 3, 2026
8d2da7e
FRLG AutoStory battle: read SLP, use Awakenings, log each heal choice
dayfine Nov 3, 2026
2148c96
FRLG AutoStory: bridge trainer lines, preparation once per save, 50% …
dayfine Nov 3, 2026
831a22c
FRLG AutoStory battle: size the Potion on the foe AI's likely turn
dayfine Nov 3, 2026
4e3cf21
Merge commit 'e36b1b50cc86215c12f7c53c641ff54919b5b5b3' into HEAD
dayfine Nov 5, 2026
e6b1746
FRLG AutoStory stage 4: align with PR #231 lint conventions
dayfine Nov 6, 2026
fc304ea
Merge remote-tracking branch 'origin/frlg/stage4-cerulean' into frlg/…
dayfine Nov 6, 2026
7d3d612
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 6, 2026
df79ac2
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 7, 2026
c7d30f6
Merge remote-tracking branch 'origin/frlg/stage3-mtmoon' into frlg/st…
dayfine Nov 8, 2026
03ec344
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 8, 2026
f97a58a
Merge remote-tracking branch 'origin/frlg/stage3-mtmoon' into HEAD
dayfine Nov 9, 2026
74864c8
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 9, 2026
febff47
Merge frlg/stage3-mtmoon (story action table) into frlg/stage4-cerulean
dayfine Nov 9, 2026
12a908f
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 9, 2026
776f4f1
Merge frlg/stage3-mtmoon: check the save stands at the checkpoint's s…
dayfine Nov 9, 2026
0e2fd30
Merge frlg/stage3-mtmoon: shorten the start pose sim test
dayfine Nov 9, 2026
ae3532c
Merge frlg/stage3-mtmoon: time an interrupt's step from its screen ev…
dayfine Nov 9, 2026
632ba7b
Merge frlg/stage3-mtmoon: check a loaded save's start against a kept …
dayfine Nov 9, 2026
1467cb9
Merge frlg/stage3-mtmoon: check a loaded save's start against a kept …
dayfine Nov 9, 2026
0afbed4
Merge frlg/stage3-mtmoon: check a loaded save's start against a kept …
dayfine Nov 9, 2026
19d0825
Merge e54251c6d (#122 via parent) into frlg/stage4-cerulean
dayfine Nov 9, 2026
0ec989d
Merge FRLG between-step interrupts (9b6d673f6) into #216
dayfine Nov 9, 2026
3f472f6
Merge FRLG between-step interrupts (44753d7f3) into #216
dayfine Nov 9, 2026
4b520be
Merge FRLG interrupt actions move (c22983577) into #216
dayfine Nov 9, 2026
97a269d
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean (hold watchers for…
dayfine Nov 9, 2026
9eb43c0
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 9, 2026
68b7586
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean (wait for a battle…
dayfine Nov 9, 2026
b6814a4
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean (scene ends after …
dayfine Nov 9, 2026
bfc2a30
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean: a step on the Swi…
dayfine Nov 9, 2026
10dee67
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 10, 2026
567f9b3
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 10, 2026
703f5e8
Merge frlg/stage3-mtmoon (#333) into frlg/stage4-json: stage 4's rows…
dayfine Nov 10, 2026
25ce096
FRLG AutoStory: delete stage 4's C++ story rows, parity proven
dayfine Nov 10, 2026
48f46db
Merge pull request #334 from dayfine/frlg/stage4-json
dayfine Nov 10, 2026
60777d0
Merge frlg/stage3-mtmoon (detectors split, maps from Packages, no bat…
dayfine Nov 10, 2026
ab3b837
Merge branch 'frlg/stage3-mtmoon' into frlg/stage4-cerulean
dayfine Nov 11, 2026
378b2d0
Merge branch 'frlg/stage3-mtmoon' into frlg/stage4-cerulean
dayfine Nov 11, 2026
e2de582
FRLG AutoStory tests: DeclaredPose starts through grid_pose_of()
dayfine Nov 11, 2026
97dd6cb
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 12, 2026
e9d1be6
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 13, 2026
51a961e
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 14, 2026
c675425
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 14, 2026
0bcf0f6
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 14, 2026
6d5c6d8
Merge frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 14, 2026
6b065a4
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 14, 2026
e2588f9
Merge origin/frlg/stage3-mtmoon into frlg/stage4-cerulean
dayfine Nov 15, 2026
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 @@ -49,6 +49,11 @@ constexpr std::string_view MAP_NAMES[] = {
"CeruleanCity_PokemonCenter_1F",
"CeruleanCity",
"Route24",
// Cerulean City's Mart and Gym, and Route 25 to Bill's Sea Cottage.
"CeruleanCity_Mart",
"CeruleanCity_Gym",
"Route25",
"Route25_SeaCottage",
"CeruleanCave_1F",
"CeruleanCave_2F",
"CeruleanCave_B1F",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
*
* The FRLG maps the overworld routes know about so far: every map from a
* new game in Pallet Town through Viridian City, Route 2 and Viridian
* Forest to Brock's gym in Pewter City; and Cerulean City, its Pokemon
* Center, Route 24 to its north, and the three floors of Cerulean Cave,
* where Mewtwo waits on B1F.
* Forest to Brock's gym in Pewter City, Route 3, Mt. Moon and Route 4;
* and Cerulean City, its Pokemon Center, Mart and Gym, Route 24 (Nugget
* Bridge) and Route 25 to Bill's Sea Cottage, and the three floors of
* Cerulean Cave, where Mewtwo waits on B1F.
*
* Each map is a pinned PokemonSimulation JSON resource, prepared under
* Packages/Resources/Pokemon/Maps/frlg and built into the program by CMake
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Overworld Maps Tests

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=637 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand All @@ -10,6 +10,7 @@
#include <initializer_list>
#include <set>
#include <string>
#include <string_view>
#include "Common/Cpp/Exceptions.h"
#include "Common/Cpp/TestRunners/UnitTest.h"
#include "PokemonFRLG_OverworldMap.h"
Expand Down Expand Up @@ -325,6 +326,42 @@
return true;
}

// Whether a route plans from Cerulean's Pokemon Center, at its nurse, to
// `goal` on `maps`.
bool plans_from_cerulean_nurse(const std::vector<MapData>& maps, const RouteGoal& goal){
const MapPosition nurse{"CeruleanCity_PokemonCenter_1F", map_point(maps, "CeruleanCity_PokemonCenter_1F", "nurse_front")};
return plan_overworld_route(maps, nurse, goal, default_route_costs(), Direction::NORTH).has_value();
}

// Cerulean City's Mart and Gym and Route 25's Sea Cottage load with the
// points the story walks to, and join the city: from its Pokemon Center
// a route plans to the Mart's clerk, to Misty, and north over Nugget
// Bridge (Route 24) and east along Route 25 into Bill's Sea Cottage.
UnitTestResult test_cerulean_maps(){
const std::vector<MapData> maps = overworld_maps();
for (std::string_view name : {"CeruleanCity_Mart", "CeruleanCity_Gym", "Route25", "Route25_SeaCottage"}){
if (built_in(maps, std::string(name)) == nullptr){
return std::format("Missing map {}.", name);
}
}
const MapPosition clerk{"CeruleanCity_Mart", map_point(maps, "CeruleanCity_Mart", "clerk_front")};
const MapPosition misty{"CeruleanCity_Gym", map_point(maps, "CeruleanCity_Gym", "misty_front")};
if (clerk.point != TilePos{4, 3} || misty.point != TilePos{8, 7}){
return "Unexpected clerk_front or misty_front.";
}
if (!plans_from_cerulean_nurse(maps, RouteGoal{clerk, Direction::WEST})){
return "No route from Cerulean's Pokemon Center to the Mart's clerk.";
}
if (!plans_from_cerulean_nurse(maps, RouteGoal{misty, Direction::NORTH})){
return "No route from Cerulean's Pokemon Center to Misty.";
}
const MapPosition bill_front{"Route25_SeaCottage", {7, 7}};
if (!plans_from_cerulean_nurse(maps, RouteGoal{bill_front, Direction::NORTH})){
return "No route from Cerulean's Pokemon Center over Nugget Bridge and Route 25 into Bill's Sea Cottage.";
}
return true;
}

// A planned step walks where its map doesn't let the player run, and only
// there: out of Pewter's Pokemon Center to the Gym.
UnitTestResult test_walk_only_indoors(){
Expand Down Expand Up @@ -578,6 +615,10 @@
.input = {.name = "trainer stops on the story's maps", .body = test_trainer_stops},
.expectation = {.description = "verifies trainer stops along story routes"},
},
{
.input = {.name = "Cerulean's Mart and Gym, Route 25 and Bill's Sea Cottage", .body = test_cerulean_maps},
.expectation = {.description = "validates Cerulean City, Gym, Mart, Route 25 and Sea Cottage map data"},
},
};

} // namespace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Overworld Sim Tests

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=970 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -786,95 +786,176 @@
return true;
}

// Story row 00.14: from Route 4 east of Mt. Moon along the upper road to
// above the ledge row 9, out of Lass Crissy's line (75, 3); one step
// south hops the ledge onto the lower road two tiles down; from there
// into Cerulean City and its Pokemon Center by one door. No route plans
// past the ledge: the upper road reaches the city only by water.
UnitTestResult test_route4_to_cerulean(){
const SimCase upper{.start = at("Route4", 32, 6), .facing = Direction::SOUTH, .goal = at("Route4", 93, 8)};
const SimRun walk = run_case(upper);
if (!arrived(walk, upper.goal) || !walk.state.trainers_beaten.empty()){
return "Expected the upper road walked to above the ledge, no trainer met:" + describe(walk);

Check warning on line 798 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
OverworldSim sim(maps(), at("Route4", 93, 8), Direction::SOUTH);
sim.tap(Direction::SOUTH);
sim.watch({SimWatcher::MESSAGE}, std::chrono::milliseconds(2000));
if (!(sim.state().position == at("Route4", 93, 10))){
return "Expected the step south to hop the ledge onto (93, 10), not " + to_string(sim.state().position) + ".";

Check warning on line 804 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
const SimCase lower{.start = at("Route4", 93, 10), .facing = Direction::SOUTH, .goal = at("CeruleanCity_PokemonCenter_1F", 7, 4)};
const SimRun now = run_case(lower);
if (!arrived(now, lower.goal) || now.state.warps != 1 || !now.state.trainers_beaten.empty()){
return "Expected Cerulean's Pokemon Center reached by its door, no trainer met:" + describe(now);

Check warning on line 809 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
return true;
}

// Story rows 00.14b and 00.14c in Cerulean Gym (pokefirered map.json):
// from the Center into the Gym, up column 9 to (9, 13), west to (4, 13),
// then to walls round the pool's west and north sides and west to (9, 7)
// below Misty's platform, meeting no one; and back from beside her (9, 6)
// the same way round to (9, 13) and out to the Center.
UnitTestResult test_cerulean_gym_walks(){

Check warning on line 819 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::test_cerulean_gym_walks(): function_lines=43 (advisory above 25, limit 50)
const SimCase in{.start = at("CeruleanCity_PokemonCenter_1F", 7, 4), .facing = Direction::NORTH, .goal = at("CeruleanCity_Gym", 9, 13)};
const SimRun entered = run_case(in);
if (!arrived(entered, in.goal) || entered.state.warps != 2 || !entered.state.trainers_beaten.empty()){
return "Expected the Gym entered and (9, 13) reached, no trainer met:" + describe(entered);

Check warning on line 823 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
SimCase west{.start = in.goal, .facing = Direction::NORTH, .goal = at("CeruleanCity_Gym", 4, 13)};
west.route = std::vector<RouteStep>{leg(Direction::WEST, 5, west.goal, true)};
const SimRun walkway = run_case(west);
if (!arrived(walkway, west.goal) || !walkway.state.trainers_beaten.empty()){
return "Expected the wall (4, 13) reached west from (9, 13), no trainer met:" + describe(walkway);

Check warning on line 829 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
SimCase up{.start = west.goal, .facing = Direction::WEST, .goal = at("CeruleanCity_Gym", 9, 7)};
up.route = std::vector<RouteStep>{
leg(Direction::NORTH, 3, at("CeruleanCity_Gym", 4, 10), true),
leg(Direction::EAST, 8, at("CeruleanCity_Gym", 12, 10), true),
leg(Direction::NORTH, 3, at("CeruleanCity_Gym", 12, 7), true),
leg(Direction::WEST, 3, up.goal, false),
};
const SimRun walk = run_case(up);
if (!arrived(walk, up.goal) || !walk.state.trainers_beaten.empty()){
return "Expected (9, 7) below Misty's platform reached round the pool, no trainer met:" + describe(walk);

Check warning on line 840 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
SimCase out{.start = at("CeruleanCity_Gym", 9, 6), .facing = Direction::WEST, .goal = at("CeruleanCity_Gym", 9, 13)};
out.route = std::vector<RouteStep>{
leg(Direction::SOUTH, 1, at("CeruleanCity_Gym", 9, 7), false),
leg(Direction::EAST, 3, at("CeruleanCity_Gym", 12, 7), true),
leg(Direction::SOUTH, 3, at("CeruleanCity_Gym", 12, 10), true),
leg(Direction::WEST, 8, at("CeruleanCity_Gym", 4, 10), true),
leg(Direction::SOUTH, 3, at("CeruleanCity_Gym", 4, 13), true),
leg(Direction::EAST, 5, out.goal, true),
};
const SimRun back = run_case(out);
if (!arrived(back, out.goal) || !back.state.trainers_beaten.empty()){
return "Expected (9, 13) reached from beside Misty round the pool, no trainer met:" + describe(back);

Check warning on line 853 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
}
const SimCase nurse{.start = out.goal, .facing = Direction::EAST, .goal = at("CeruleanCity_PokemonCenter_1F", 7, 4)};
const SimRun healed = run_case(nurse);
if (!arrived(healed, nurse.goal) || healed.state.warps != 2 || !healed.state.trainers_beaten.empty()){
return "Expected the Center reached from (9, 13), no trainer met:" + describe(healed);
}
return true;
}

// The straight ways in Cerulean Gym that 00.14b and 00.14c keep off: the
// step onto (9, 12) meets Swimmer Luis, and the step onto (8, 7),
// misty_front, Picnicker Diana.
UnitTestResult test_cerulean_gym_lines(){
const struct{
MapPosition from;
Direction direction;
MapPosition onto;
std::string_view trainer;
} LINES[] = {
{at("CeruleanCity_Gym", 9, 13), Direction::NORTH, at("CeruleanCity_Gym", 9, 12), "swimmer_m_water"},
{at("CeruleanCity_Gym", 9, 7), Direction::WEST, at("CeruleanCity_Gym", 8, 7), "picnicker"},
};
for (const auto& line : LINES){
SimCase c{.start = line.from, .facing = line.direction, .goal = line.onto};
c.route = std::vector<RouteStep>{leg(line.direction, 1, c.goal, false)};
const SimRun now = run_case(c);
if (!arrived(now, c.goal) || now.state.trainers_beaten != std::vector<std::string>{std::string(line.trainer)}){
return std::format("Expected the {} fought on the step onto {}:", line.trainer, to_string(line.onto)) + describe(now);
}
}
return true;
}

// Story rows 00.15 and 00.16: out of Cerulean's Pokemon Center by its mat
// to below the rival's trigger row, and on north across the city's edge
// onto Nugget Bridge, below Cale's row, meeting no one.
UnitTestResult test_cerulean_to_bridge(){
const MapPosition nurse = at("CeruleanCity_PokemonCenter_1F", 7, 4);
for (const MapPosition& goal : {at("CeruleanCity", 23, 7), at("Route24", 11, 32)}){
const SimCase c{.start = nurse, .facing = Direction::NORTH, .goal = goal};
const SimRun now = run_case(c);
if (!arrived(now, c.goal) || now.state.warps != 1 || !now.state.trainers_beaten.empty()){
return "Expected " + to_string(goal) + " reached by the Center's mat, no trainer met:" + describe(now);
}
}
return true;
}

// Story row 00.16 up Nugget Bridge: the short legs between the five
// trainers' rows meet no one; and the step from the tile below each row
// onto it is in that trainer's sight, beside them, so they fight there
// without walking: Cale, Ali, Timmy, Reli and Ethan.
UnitTestResult test_nugget_bridge_legs(){
SimCase between{.start = at("Route24", 11, 31), .facing = Direction::NORTH, .goal = at("Route24", 11, 29)};
between.route = std::vector<RouteStep>{leg(Direction::NORTH, 2, between.goal, false)};
const SimRun walk = run_case(between);
if (!arrived(walk, between.goal) || !walk.state.trainers_beaten.empty()){
return "Expected the leg between two rows walked, no trainer met:" + describe(walk);
}
const struct{
int row;
std::string_view trainer;
} LINES[] = {{31, "bug_catcher"}, {28, "lass"}, {25, "youngster"}, {22, "lass"}, {19, "camper"}};
for (const auto& line : LINES){
SimCase c{.start = at("Route24", 11, line.row + 1), .facing = Direction::NORTH, .goal = at("Route24", 11, line.row)};
c.route = std::vector<RouteStep>{leg(Direction::NORTH, 1, c.goal, false)};
const SimRun now = run_case(c);
if (!arrived(now, c.goal) || now.state.trainers_beaten != std::vector<std::string>{std::string(line.trainer)}){
return std::format("Expected the {} on row {} fought beside the player:", line.trainer, line.row) + describe(now);
}
}
return true;
}

} // namespace



const OverworldSimCase OVERWORLD_SIM_CASES[] = {
{
.input = {"the forest's north gate: no fade or black read as a battle", test_forest_north_gate},
.expectation = {},
},
{
.input = {"a battle on a leg onto a warp", test_battle_on_warp_leg},
.expectation = {},
},
{
.input = {"the START menu left open", test_start_menu_open},
.expectation = {},
},
{
.input = {"a battle at the end of a leg", test_battle_at_end_of_leg},
.expectation = {},
},
{
.input = {"a late battle stops an open leg", test_late_battle_mid_leg},
.expectation = {},
},
{
.input = {"a trainer's battle is fought, not fled", test_trainer_not_fled},
.expectation = {},
},
{
.input = {"no hold over a ledge", test_no_hold_over_ledge},
.expectation = {},
},
{
.input = {"a short leg, then a sign", test_short_leg_then_sign},
.expectation = {},
},
{
.input = {"a short leg, nothing seen", test_short_leg_unseen},
.expectation = {},
},
{
.input = {"a trainer on the way out of Pewter Gym", test_trainer_on_way_out},
.expectation = {},
},
{
.input = {"out of Viridian Mart from the clerk's scene", test_mart_exit},
.expectation = {},
},
{
.input = {"Mt. Moon: down the ladders to B2F", test_mt_moon_ladders},
.expectation = {},
},
{
.input = {"Mt. Moon: the Moon Stone is a short detour", test_moon_stone_detour},
.expectation = {},
},
{
.input = {"Mt. Moon: the Grunt who looks around stops a leg to a wall", test_mt_moon_grunt_mid_leg},
.expectation = {},
},
{
.input = {"Mt. Moon: a short open leg before the Grunt's line", test_mt_moon_short_leg},
.expectation = {},
},
{
.input = {"Mt. Moon: a late wild battle in the cave", test_mt_moon_late_battle},
.expectation = {},
},
{
.input = {"Mt. Moon: after the HELIX, out to Route 4", test_mt_moon_way_out},
.expectation = {},
},
{
.input = {"Mt. Moon: a battle on the leg onto 1F's ladder", test_mt_moon_battle_on_ladder_leg},
.expectation = {},
},
{
.input = {"Mt. Moon: a battle seen only after a leg to a wall", test_mt_moon_battle_seen_after_wall_leg},
.expectation = {},
},
{
.input = {"Mt. Moon: black after a leg not marked wild", test_mt_moon_black_after_unmarked_leg},
.expectation = {},
},
{
.input = {"Mt. Moon: a battle seen only before the next leg", test_mt_moon_battle_before_next_leg},
.expectation = {},
},
};
{.input = {"the forest's north gate: no fade or black read as a battle", test_forest_north_gate}, .expectation = {},},
{.input = {"a battle on a leg onto a warp", test_battle_on_warp_leg}, .expectation = {},},
{.input = {"the START menu left open", test_start_menu_open}, .expectation = {},},
{.input = {"a battle at the end of a leg", test_battle_at_end_of_leg}, .expectation = {},},
{.input = {"a late battle stops an open leg", test_late_battle_mid_leg}, .expectation = {},},
{.input = {"a trainer's battle is fought, not fled", test_trainer_not_fled}, .expectation = {},},
{.input = {"no hold over a ledge", test_no_hold_over_ledge}, .expectation = {},},
{.input = {"a short leg, then a sign", test_short_leg_then_sign}, .expectation = {},},
{.input = {"a short leg, nothing seen", test_short_leg_unseen}, .expectation = {},},
{.input = {"a trainer on the way out of Pewter Gym", test_trainer_on_way_out}, .expectation = {},},
{.input = {"out of Viridian Mart from the clerk's scene", test_mart_exit}, .expectation = {},},
{.input = {"Mt. Moon: down the ladders to B2F", test_mt_moon_ladders}, .expectation = {},},
{.input = {"Mt. Moon: the Moon Stone is a short detour", test_moon_stone_detour}, .expectation = {},},
{.input = {"Mt. Moon: the Grunt who looks around stops a leg to a wall", test_mt_moon_grunt_mid_leg}, .expectation = {},},
{.input = {"Mt. Moon: a short open leg before the Grunt's line", test_mt_moon_short_leg}, .expectation = {},},
{.input = {"Mt. Moon: a late wild battle in the cave", test_mt_moon_late_battle}, .expectation = {},},
{.input = {"Mt. Moon: after the HELIX, out to Route 4", test_mt_moon_way_out}, .expectation = {},},
{.input = {"Mt. Moon: a battle on the leg onto 1F's ladder", test_mt_moon_battle_on_ladder_leg}, .expectation = {},},
{.input = {"Mt. Moon: a battle seen only after a leg to a wall", test_mt_moon_battle_seen_after_wall_leg}, .expectation = {},},
{.input = {"Mt. Moon: black after a leg not marked wild", test_mt_moon_black_after_unmarked_leg}, .expectation = {},},
{.input = {"Mt. Moon: a battle seen only before the next leg", test_mt_moon_battle_before_next_leg}, .expectation = {},},
{.input = {"Route 4 east, down its ledge, to Cerulean's Pokemon Center", test_route4_to_cerulean}, .expectation = {},},
{.input = {"Cerulean Gym: to Misty and back round the pool, no trainer met", test_cerulean_gym_walks}, .expectation = {},},
{.input = {"Cerulean Gym: the straight ways meet Luis and Diana", test_cerulean_gym_lines}, .expectation = {},},
{.input = {"Cerulean: the Center to the rival's row and Nugget Bridge", test_cerulean_to_bridge}, .expectation = {},},
{.input = {"Nugget Bridge: each trainer met on the step onto their row", test_nugget_bridge_legs}, .expectation = {},},};

void add_tests_OverworldSim(UnitTestDatabase& database){
for (const auto& item : OVERWORLD_SIM_CASES){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,13 @@ Pokemon::SegmentHooks story_hooks(SingleSwitchProgramEnvironment& env, StoryEnv&
return Pokemon::outcome_failed("wrong_save", error);
}
story.supplies = story.saved_supplies;
// Every reload, so each verify run starts from the bag as the
// save holds it, not from a count once read wrong or not at
// all (console B, 2026-11-03: 0 Potions in all 3 runs).
read_bag_supplies(story, story.start_menu);
// Until read in full, so each verify run starts from the bag
// as the save holds it, not from a count once read wrong or
// not at all (console B, 2026-11-03: 0 Potions in all 3
// runs). Once read, a reload of the same save restores it.
if (!story.bag_read){
read_bag_supplies(story, story.start_menu);
}
}catch (OperationFailedException& e){
return Pokemon::outcome_failed("reload_failed", e.message());
}
Expand Down
Loading
Loading