Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8d55470
FRLG AutoStory: segment 13, the Pokemon Mansion (WIP)
dayfine Nov 12, 2026
362078e
FRLG AutoStory: segment 13, the Pokemon Mansion, 13.01 to 13.04
dayfine Nov 12, 2026
c5caecf
Merge remote-tracking branch 'origin/frlg/stage16-silph' into tmp-73432
dayfine Nov 13, 2026
f51a993
Merge frlg/stage16-silph into frlg/stage13-mansion (12.01 floor)
dayfine Nov 13, 2026
ce68815
Merge frlg/stage16-silph into frlg/stage13-mansion (Mart item names)
dayfine Nov 13, 2026
04097ff
Merge frlg/stage16-silph into frlg/stage13-mansion (12.01 fills 5 Sup…
dayfine Nov 13, 2026
c708c3d
Merge branch 'm-stage16-silph' into m-stage13-mansion
dayfine Nov 13, 2026
dec9e82
Merge branch 'm-stage16-silph' into m-stage13-mansion
dayfine Nov 13, 2026
0d36903
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 13, 2026
42a1363
Merge branch 'frlg/stage16-silph' into frlg/stage13-mansion
dayfine Nov 13, 2026
e1847d6
Merge remote-tracking branch 'origin/frlg/stage16-silph' into frlg/st…
dayfine Nov 13, 2026
be56bed
Merge remote-tracking branch 'origin/frlg/stage16-silph' into HEAD
dayfine Nov 13, 2026
3ff09db
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 13, 2026
d32095c
Merge frlg/stage16-silph (12.02 split) into stage13-mansion
dayfine Nov 13, 2026
a0956d0
Merge frlg/stage16-silph (14.04 split) into frlg/stage13-mansion
dayfine Nov 13, 2026
08527dd
FRLG AutoStory: the chain test expects 63 checkpoints (the split's me…
dayfine Nov 13, 2026
05581bd
Merge remote-tracking branch 'origin/frlg/stage16-silph' into HEAD
dayfine Nov 13, 2026
66db482
Merge remote-tracking branch 'origin/frlg/stage16-silph' into agent/m…
dayfine Nov 13, 2026
8726878
FRLG story order: Mansion (13.01-13.04) right after 12.03, TM14 Blizz…
dayfine Nov 13, 2026
385c757
Merge origin/frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 13, 2026
b84d377
Merge frlg/stage16-silph into frlg/stage13-mansion: upstream #1881 fr…
dayfine Nov 13, 2026
c8f72c8
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 14, 2026
a35f8fe
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 14, 2026
a9f973a
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 14, 2026
b303d7a
Merge frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 14, 2026
503bc10
Merge origin/frlg/stage16-silph into frlg/stage13-mansion
dayfine Nov 14, 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 @@ -61,7 +61,7 @@
: SmallDictionaryMatcher(dictionary())
{}

static JsonObject dictionary(){

Check warning on line 64 in SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::PlaceNameMatcher::dictionary(): function_lines=36 (advisory above 25, limit 50)
JsonObject english;
for (const auto& [slug, name] : {
std::pair<std::string_view, std::string_view>{"pallet-town", "Pallet Town"},
Expand All @@ -86,6 +86,8 @@
{"saffron-city", "Saffron City"},
{"cinnabar-island", "Cinnabar Island"},
{"silph-co", "Silph Co"},
{"cinnabar-island", "Cinnabar Island"},
{"pokemon-mansion", "Pokemon Mansion"},
}){
JsonArray names;
names.push_back(std::string(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ constexpr std::string_view MAP_NAMES[] = {
"SilphCo_9F",
"SilphCo_10F",
"SilphCo_11F",
// The Pokemon Mansion's four floors, for the SECRET KEY.
"PokemonMansion_1F",
"PokemonMansion_2F",
"PokemonMansion_3F",
"PokemonMansion_B1F",
"CeruleanCave_1F",
"CeruleanCave_2F",
"CeruleanCave_B1F",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "Programs/AutoStory/PokemonFRLG_AutoStoryHealing.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows13_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryTable.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h"
Expand Down Expand Up @@ -114,6 +115,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){
add_tests_AutoStoryCeladonGym(database);
add_tests_AutoStorySaffron(database);
add_tests_AutoStorySilph(database);
add_tests_AutoStoryMansion(database);
}

void add_tests(UnitTestDatabase& database){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Events

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=998 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -349,7 +349,7 @@
return StoryPose{pose.map, tiles[0], facing_of(pose)};
}

std::string save_card_place(const std::string& map){

Check warning on line 352 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::save_card_place( const std :: string & map): function_lines=34 (advisory above 25, limit 50)
// A map of the place, or a building in it ("Route4_PokemonCenter_1F"
// is on Route 4, "Route24" isn't on Route 2).
static const std::pair<std::string, std::string_view> PLACES[] = {
Expand All @@ -373,6 +373,8 @@
{"SaffronCity", "saffron-city"},
{"CinnabarIsland", "cinnabar-island"},
{"SilphCo", "silph-co"},
{"CinnabarIsland", "cinnabar-island"},
{"PokemonMansion", "pokemon-mansion"},
};
for (const auto& [prefix, place] : PLACES){
if (map == prefix || map.rfind(prefix + "_", 0) == 0){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
/* AutoStory Mansion Tests
*
* From: https://github.com/PokemonAutomation/
*
* Rows 13.01 to 13.04 (StoryData/frlg-13.0N.plan.json) on the overworld
* sim: Cinnabar's Center to the Pokemon Mansion's statue switches, the
* SECRET KEY and the Escape Rope out. The sim has the map's switch state
* (flag clear), so a step through a barrier the switches open is declared.
*
*/

#include <format>
#include <functional>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "Common/Cpp/Exceptions.h"
#include "Common/Cpp/TestRunners/UnitTest.h"
#include "Pokemon/AutoStory/Pokemon_BuiltinStoryActions.h"
#include "Pokemon/AutoStory/Pokemon_StoryStepExecutor.h"
#include "Pokemon/Navigation/Pokemon_MapData.h"
#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h"
#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h"
#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkTimes.h"
#include "PokemonFRLG_AutoStoryEvents.h"
#include "PokemonFRLG_AutoStoryRooms.h"
#include "PokemonFRLG_AutoStoryRowSim.h"
#include "PokemonFRLG_AutoStoryRows_Tests.h"
#include "PokemonFRLG_AutoStoryRows13_Tests.h"
#include "PokemonFRLG_AutoStoryTable.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


namespace{

struct AutoStoryMansionInput{
std::string name;
std::function<UnitTestResult()> body;
};

struct AutoStoryMansionExpectation{
std::string_view description;
};

struct AutoStoryMansionCase{
AutoStoryMansionInput input;
AutoStoryMansionExpectation expectation;
};

class Test_AutoStoryMansion : public UnitTest{

Check failure on line 54 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMansion_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

test-case: construct each UnitTest from one case struct with name, input and expectation fields (input and expectation structs, the name outside the input); register a named table of designated cases in a range-for
public:
explicit Test_AutoStoryMansion(AutoStoryMansionCase test_case)
: UnitTest(std::format("PokemonFRLG::AutoStory - Simulation: {}", test_case.input.name))
, m_case(std::move(test_case))
{}
virtual UnitTestResult run(Logger&, CancellableScope&) const override{
try{
return m_case.input.body();
}catch (Exception& e){
return std::format("{}: {}", e.name(), e.message());
}
}

private:
AutoStoryMansionCase m_case;
};

const StoryCheckpoint& checkpoint(std::string_view id){
for (const StoryCheckpoint& row : story_checkpoints()){
if (row.id == id){
return row;
}
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No checkpoint {}.", id));
}

// Burglar Lewis, B1F's wanderer: he walks (19..21, 24..26) with sight 1 and
// looks every way, so the sim, which takes his whole range as seen, meets
// him where 13.03 passes (22, 24). Whether he is there is up to the dice;
// the battle code fights him if he sees the player. Nobody else is met.
const std::string LEWIS = "poke_maniac";

struct MansionRow{
std::string_view id;
MapPosition end;
std::vector<std::string> floors;
};

// A step over a tile the switches open: the pack's maps are the clear
// state, where it is a wall, so the sim cannot walk it and the step's
// declared pose stands. `wall` is whether the tile it lands on is such a
// barrier on the map; the step after it, onto floor, is declared too.
struct SwitchStep{
std::string_view row;
std::string_view step;
bool wall;
};

const SwitchStep SWITCH_STEPS[] = {
{"13.02", "into_opening_1", true},
{"13.02", "into_opening_2", true},
{"13.02", "through_opening", false},
{"13.03", "into_room_2", true},
{"13.03", "into_room_3", true},
{"13.04", "into_opening", true},
{"13.04", "through_opening", false},
};

const SwitchStep* switch_step(std::string_view row, std::string_view step){
for (const SwitchStep& item : SWITCH_STEPS){
if (item.row == row && item.step == step){
return &item;
}
}
return nullptr;
}

bool map_wall(const MapPosition& at){
for (const MapData& map : story_maps()){
if (map.name == at.map){
return map.tiles.at(at.point) == TileKind::WALL;
}
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No map {}.", at.map));
}

// A row on the sim from its start: every step lands (a switch step on its
// declared pose, on a barrier that is a wall on the map), the row ends on
// its postcondition's tile after the floors it should cross, and nobody but Lewis is met and no rule is broken on the way (checked
// after each step).
UnitTestResult test_row(const MansionRow& expected){

Check warning on line 135 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMansion_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::test_row( const MansionRow & expected): function_lines=48 (advisory above 25, limit 50)
const StoryCheckpoint& row = checkpoint(expected.id);
StoryPose at = *story_pose(Pokemon::pose_of(*row.start));
std::optional<OverworldSim> sim;
sim.emplace(story_maps(), MapPosition{at.map, at.tile}, *at.facing);
std::vector<std::string> floors;
for (const StoryStep& step : row.steps){
if (const SwitchStep* barrier = switch_step(row.id, step.name)){
at = *story_pose(Pokemon::pose_of(*step.pose_after));
if (map_wall(MapPosition{at.map, at.tile}) != barrier->wall){
return std::format("{}/{}: expected {} on {}.", row.id, step.name, barrier->wall ? "a barrier" : "floor", to_string(MapPosition{at.map, at.tile}));
}
sim.emplace(story_maps(), MapPosition{at.map, at.tile}, *at.facing);
}else if (step.name == "escape_rope"){
// The rope's script has no map: the player stands where it says.
at = *story_pose(Pokemon::pose_of(*step.pose_after));
sim.emplace(story_maps(), MapPosition{at.map, at.tile}, *at.facing);
}else if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){
return std::format("{}: ended on {}; {}", row.id, to_string(sim->state().position), failure);
}
if (step.name == "down_the_hole"){
// The hole's fade: a declared step does not wait it out, a walk does.
sim->watch({}, OverworldWalkSteps::AFTER_WARP);
}
if (!sim->state().violations.empty()){
return std::format("{}/{}: broke a rule on the way, on {}: {}.", row.id, step.name, to_string(sim->state().position), sim->state().violations.front());
}
for (const std::string& trainer : sim->state().trainers_beaten){
if (trainer != LEWIS){
return std::format("{}/{}: met a trainer: {}.", row.id, step.name, trainer);
}
}
if (floors.empty() || floors.back() != at.map){
floors.push_back(at.map);
}
}
if (!(MapPosition{at.map, at.tile} == expected.end)){
return std::format("{}: ended on {}, not {}.", row.id, to_string(MapPosition{at.map, at.tile}), to_string(expected.end));
}
if (floors != expected.floors){
std::string crossed;
for (const std::string& floor : floors){
crossed += std::format(" {}", floor);
}
return std::format("{}: the steps crossed the wrong floors:{}.", row.id, crossed);
}
return true;
}

const MansionRow ROW_13_01{"13.01", {"PokemonMansion_3F", {12, 6}},
{"PokemonMansion_3F"}};
const MansionRow ROW_13_02{"13.02", {"PokemonMansion_B1F", {34, 29}},
{"PokemonMansion_3F", "PokemonMansion_1F", "PokemonMansion_B1F"}};
const MansionRow ROW_13_03{"13.03", {"PokemonMansion_B1F", {27, 6}},
{"PokemonMansion_B1F"}};
const MansionRow ROW_13_04{"13.04", {"CinnabarIsland", {8, 4}},
{"PokemonMansion_B1F", "CinnabarIsland"}};

const AutoStoryMansionCase AUTO_STORY_MANSION_CASES[] = {
{
.input = {.name = "13.01 Cinnabar to the Mansion's 3F statue", .body = []{ return test_row(ROW_13_01); }},
.expectation = {.description = "through 1F and 2F to 3F's (12, 6), nobody met"},
},
{
.input = {.name = "13.02 3F's opening, the hole, 1F's stairs", .body = []{ return test_row(ROW_13_02); }},
.expectation = {.description = "through the declared opening and the hole to B1F's (34, 29)"},
},
{
.input = {.name = "13.03 B1F's two statues, the Elixir and TM14", .body = []{ return test_row(ROW_13_03); }},
.expectation = {.description = "through the declared opening to (27, 6), nobody but Lewis met"},
},
{
.input = {.name = "13.04 the SECRET KEY and the Escape Rope", .body = []{ return test_row(ROW_13_04); }},
.expectation = {.description = "through the declared opening to the key, out by the rope to (8, 4)"},
},
};

} // namespace


void add_tests_AutoStoryMansion(UnitTestDatabase& database){
for (const auto& item : AUTO_STORY_MANSION_CASES){
database.add<Test_AutoStoryMansion>(item);
}
}



} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* FRLG AutoStory Plan Golden, Segment 13
*
* From: https://github.com/PokemonAutomation/
*
* The golden's lines of segment 13 (the Pokemon Mansion), which STORY_ORDER
* places after segment 16's. The test reads FRLG_PLAN_GOLDEN_16, then these.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden13_H
#define PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden13_H

#include <string_view>

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{

// The stored plan lines of segment 13, after FRLG_PLAN_GOLDEN_16's.
inline constexpr std::string_view FRLG_PLAN_GOLDEN_13[] = {
"13.01 mansion_3f from CinnabarIsland_PokemonCenter_1F (7, 4) facing north to PokemonMansion_3F (8, 3) facing east",
"13.01 walk south 5 (warp) -> CinnabarIsland (14, 12) [walk only]",
"13.01 walk east 7 -> CinnabarIsland (21, 12)",
"13.01 walk north 7 (to wall) -> CinnabarIsland (21, 5)",
"13.01 walk west 13 -> CinnabarIsland (8, 5)",
"13.01 walk north 2 (warp) -> PokemonMansion_1F (8, 33)",
"13.01 walk north 20 (to wall) -> PokemonMansion_1F (8, 13) [wild]",
"13.01 walk east 3 (warp) -> PokemonMansion_2F (6, 14) [wild]",
"13.01 walk south 4 (to wall) -> PokemonMansion_2F (6, 18) [wild]",
"13.01 walk east 11 (to wall) -> PokemonMansion_2F (17, 18) [wild]",
"13.01 walk north 12 -> PokemonMansion_2F (17, 6) [wild]",
"13.01 walk west 8 -> PokemonMansion_2F (9, 6) [wild]",
"13.01 walk north 3 (to wall) -> PokemonMansion_2F (9, 3) [wild]",
"13.01 walk east 1 (warp) -> PokemonMansion_3F (8, 3)",
"13.02 down_to_b1f from PokemonMansion_1F (26, 27) facing north to PokemonMansion_B1F (34, 29) facing west",
"13.02 walk west 2 (warp) -> PokemonMansion_B1F (34, 29)",
};

} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* AutoStory Row Tests, Segment 13
*
* From: https://github.com/PokemonAutomation/
*
* Registration of the tests that run segment 13's rows (the Pokemon
* Mansion) on the overworld sim.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows13_Tests_H
#define PokemonAutomation_PokemonFRLG_AutoStoryRows13_Tests_H

#include "Common/Cpp/TestRunners/UnitTestDatabase.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


// Rows 13.01 to 13.04, the Pokemon Mansion, on the overworld sim (PokemonFRLG_AutoStoryMansion_Tests.cpp).
void add_tests_AutoStoryMansion(UnitTestDatabase& database);


} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Run Plan Tests

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=662 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -145,7 +145,7 @@
const RunPlanScenario m_scenario;
};

const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 14.04b 15.01 16.01";
const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 13.01 13.02 13.03 13.04 14.03 14.04 14.04b 15.01 16.01";

const RunPlanScenario RUN_PLAN_CASES[] = {
{
Expand Down Expand Up @@ -236,11 +236,11 @@
},
{
.input = {.name = "Gift RNG off: 04.03 is passed over", .first = "04.01"},
.expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 14.04b 15.01 16.01"},
.expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 13.01 13.02 13.03 13.04 14.03 14.04 14.04b 15.01 16.01"},
},
{
.input = {.name = "Gift RNG off: 04.03 runs when started at", .first = "04.03"},
.expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 14.04b 15.01 16.01"},
.expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 13.01 13.02 13.03 13.04 14.03 14.04 14.04b 15.01 16.01"},
},
{
.input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman",
Expand Down Expand Up @@ -279,7 +279,7 @@
},
{
.input = {.name = "Starter RNG alone: 04.03 runs when started at", .first = "04.03", .handoffs = {.starter_rng = true}},
.expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 14.03 14.04 14.04b 15.01 16.01"},
.expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02 09.03 10.01 10.02 10.03 10.04 10.05 10.06 11.01 11.02 11.03 12.01 12.02 12.02b 12.03 13.01 13.02 13.03 13.04 14.03 14.04 14.04b 15.01 16.01"},
},
{
.input = { .name = "Starter RNG first, with both on",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Simulation Tests

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=893 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -40,6 +40,7 @@
#include "PokemonFRLG_AutoStoryRows_Tests.h"
#include "PokemonFRLG_AutoStoryStepTable.h"
#include "PokemonFRLG_AutoStoryTable.h"
#include "PokemonFRLG_AutoStoryUnauthoredStarts_Tests.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
Expand Down Expand Up @@ -213,7 +214,7 @@
};


UnitTestResult test_whole_story(){

Check warning on line 217 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::test_whole_story(): function_lines=43 (advisory above 25, limit 50)
Simulation sim;
const Pokemon::SegmentReport report = sim.run({});
if (!report.completed){
Expand All @@ -226,9 +227,13 @@
if (sim.begun() != ids || sim.saves.size() != ids.size()){
return "Expected each checkpoint once, in order, each saving at its end:" + joined(sim.game.trace);
}
// Each checkpoint starts where the save before it stands.
// Each checkpoint starts where the save before it stands, but one
// authored before the rows that lead up to it.
for (size_t c = 1; c < sim.rows.size(); c++){
const StoryCheckpoint& data = sim.rows[c];
if (starts_after_unauthored_rows(data.id)){
continue;
}
const std::optional<StoryPose> start = story_pose(*start_pose(data));
const std::optional<StoryPose> saved = story_pose(sim.saves[c - 1].second);
const bool same = start && saved && start->map == saved->map && start->tile == saved->tile
Expand Down
Loading
Loading