Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d308ab2
PokemonFRLG: S15, Route 7's gate with the TEA to Saffron's Center (15…
dayfine Nov 12, 2026
48bf4a6
PokemonFRLG: S15 route golden
dayfine Nov 12, 2026
5bc2d01
Merge origin/frlg/stage8-rocktunnel into frlg/stage15-saffron
dayfine Nov 12, 2026
16270d9
Merge origin/frlg/stage8-rocktunnel into frlg/stage15-saffron
dayfine Nov 12, 2026
51a68b3
Merge origin/frlg/stage12-fuchsia-gym into frlg/stage15-saffron
dayfine Nov 12, 2026
f2677eb
FRLG walk: bike taps read the facing and remount for the player (merg…
dayfine Nov 12, 2026
d35d45a
FRLG 15.01: Saffron tests and the unauthored-starts list get their ow…
dayfine Nov 12, 2026
da84776
Merge origin/frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 12, 2026
d50ac2c
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into frlg/s…
dayfine Nov 12, 2026
041dfed
PokemonFRLG: STORY_ORDER lists 15.01 after 14.04
dayfine Nov 12, 2026
0ede2de
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into tmp-73432
dayfine Nov 13, 2026
200a3bf
Merge frlg/stage14b-erika into frlg/stage15-saffron (12.01 floor)
dayfine Nov 13, 2026
aaa4016
Merge frlg/stage14b-erika into frlg/stage15-saffron (Mart item names)
dayfine Nov 13, 2026
231fa26
Merge frlg/stage14b-erika into frlg/stage15-saffron (12.01 fills 5 Su…
dayfine Nov 13, 2026
4ec9b57
Merge branch 'scratch/erika' into m-stage15-saffron
dayfine Nov 13, 2026
f0b5740
Merge branch 'scratch/erika' into m-stage15-saffron
dayfine Nov 13, 2026
d86e773
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 13, 2026
6866ad9
Merge branch 'frlg/stage14b-erika' into frlg/stage15-saffron
dayfine Nov 13, 2026
97a46c0
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into frlg/s…
dayfine Nov 13, 2026
5095988
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into HEAD
dayfine Nov 13, 2026
207b9a2
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 13, 2026
bf99553
Merge frlg/stage14b-erika (12.02 split) into stage15-saffron
dayfine Nov 13, 2026
fbc215e
Merge frlg/stage14b-erika (14.04 split) into frlg/stage15-saffron
dayfine Nov 13, 2026
cb88b2a
FRLG AutoStory: the chain test expects 58 checkpoints (the split's me…
dayfine Nov 13, 2026
5a0d32e
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into HEAD
dayfine Nov 13, 2026
3a02233
Merge remote-tracking branch 'origin/frlg/stage14b-erika' into agent/…
dayfine Nov 13, 2026
96c4ae2
Merge origin/frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 13, 2026
67b2216
Merge frlg/stage14b-erika into frlg/stage15-saffron: upstream #1881 f…
dayfine Nov 13, 2026
0a984d0
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 14, 2026
16bff8b
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 14, 2026
9f59afd
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 14, 2026
c734266
Merge frlg/stage14b-erika into frlg/stage15-saffron
dayfine Nov 14, 2026
03484c6
Merge origin/frlg/stage14b-erika into frlg/stage15-saffron
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=33 (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 @@ -83,6 +83,7 @@
{"pokemon-tower", "Pokemon Tower"},
{"route-16", "Route 16"},
{"fuchsia-city", "Fuchsia City"},
{"saffron-city", "Saffron City"},
{"cinnabar-island", "Cinnabar Island"},
}){
JsonArray names;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ constexpr std::string_view MAP_NAMES[] = {
// Koga's gym, and the Warden's house (GOLD TEETH for HM04).
"FuchsiaCity_Gym",
"FuchsiaCity_WardensHouse",
// Route 7's east gate, where the guard takes the TEA, and Saffron City.
"Route7_EastEntrance",
"SaffronCity",
// Cinnabar Island, and Route 21 north of it to Pallet Town (12.03).
"CinnabarIsland",
"Route21_North",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryHealing.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryTable.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h"
#include "Programs/AutoStory/Data/Json_Tests.h"
Expand Down Expand Up @@ -110,6 +111,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){
add_tests_AutoStoryFuchsiaGym(database);
add_tests_AutoStoryHealing(database);
add_tests_AutoStoryCeladonGym(database);
add_tests_AutoStorySaffron(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=995 (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=31 (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 @@ -370,6 +370,7 @@
{"PokemonTower", "pokemon-tower"},
{"Route16", "route-16"},
{"FuchsiaCity", "fuchsia-city"},
{"SaffronCity", "saffron-city"},
{"CinnabarIsland", "cinnabar-island"},
};
for (const auto& [prefix, place] : PLACES){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* FRLG AutoStory Plan Golden, Segment 15
*
* From: https://github.com/PokemonAutomation/
*
* The golden's lines from segment 15 on, after
* PokemonFRLG_AutoStoryPlanGolden12.h's. The test reads FRLG_PLAN_GOLDEN,
* FRLG_PLAN_GOLDEN_10, FRLG_PLAN_GOLDEN_11, FRLG_PLAN_GOLDEN_12, then these.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden15_H
#define PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden15_H

#include <string_view>

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{

// The stored plan lines from segment 15 on, after FRLG_PLAN_GOLDEN_12's.
inline constexpr std::string_view FRLG_PLAN_GOLDEN_15[] = {
"15.01 west_of_tea_guard from CeladonCity_PokemonCenter_1F (7, 4) facing north to Route7_EastEntrance (5, 4) facing east",
"15.01 walk south 5 (warp) -> CeladonCity (48, 12) [walk only]",
"15.01 walk east 19 -> Route7 (7, 2) [connection 12]",
"15.01 walk south 8 -> Route7 (7, 10)",
"15.01 walk east 9 (warp) -> Route7_EastEntrance (1, 5)",
"15.01 walk east 4 -> Route7_EastEntrance (5, 5)",
"15.01 walk north 1 (to wall) -> Route7_EastEntrance (5, 4)",
"15.01 face east -> Route7_EastEntrance (5, 4)",
"15.01 below_center_door from Route7_EastEntrance (6, 4) facing north to SaffronCity (24, 39) facing north",
"15.01 walk south 1 -> Route7_EastEntrance (6, 5)",
"15.01 walk east 6 (warp) -> SaffronCity (8, 27)",
"15.01 walk east 9 -> SaffronCity (17, 27)",
"15.01 walk south 12 -> SaffronCity (17, 39)",
"15.01 walk east 7 -> SaffronCity (24, 39)",
"15.01 face north -> SaffronCity (24, 39)",
};

} // 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 15
*
* From: https://github.com/PokemonAutomation/
*
* Registration of the tests that run segment 15's rows on the overworld
* sim, beside PokemonFRLG_AutoStoryRows_Tests.h's earlier stretches.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows15_Tests_H
#define PokemonAutomation_PokemonFRLG_AutoStoryRows15_Tests_H

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

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


// Row 15.01, Route 7's gate to Saffron, on the overworld sim (PokemonFRLG_AutoStorySaffron_Tests.cpp).
void add_tests_AutoStorySaffron(UnitTestDatabase& database);


} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void add_tests_AutoStorySafari(UnitTestDatabase& database);
// Rows 14.03, 14.04 and 14.04b, Celadon Gym, on the overworld sim (PokemonFRLG_AutoStoryCeladonGym_Tests.cpp).
void add_tests_AutoStoryCeladonGym(UnitTestDatabase& database);


} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Expand Down
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";
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";

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"},
.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"},
},
{
.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"},
.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"},
},
{
.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"},
.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"},
},
{
.input = { .name = "Starter RNG first, with both on",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/* AutoStory Saffron Tests
*
* From: https://github.com/PokemonAutomation/
*
* Row 15.01 (StoryData/frlg-15.01.plan.json) on the overworld sim: from
* Celadon's nurse along Route 7 into its east gate, onto the guard's
* trigger, and through Saffron City to its nurse.
*
*/

#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 "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h"
#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h"
#include "PokemonFRLG_AutoStoryEvents.h"
#include "PokemonFRLG_AutoStoryRooms.h"
#include "PokemonFRLG_AutoStoryRowSim.h"
#include "PokemonFRLG_AutoStoryRows_Tests.h"
#include "PokemonFRLG_AutoStoryRows15_Tests.h"
#include "PokemonFRLG_AutoStoryTable.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


namespace{

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

struct AutoStorySaffronExpectation{
std::string_view description;
};

struct AutoStorySaffronCase{
AutoStorySaffronInput input;
AutoStorySaffronExpectation expectation;
};

class Test_AutoStorySaffron : public UnitTest{

Check failure on line 51 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_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_AutoStorySaffron(AutoStorySaffronCase 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:
AutoStorySaffronCase 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));
}

// 15.01 on the sim from Celadon's nurse: Route 7, the gate's top trigger
// (6, 4), where the TEA scene leaves the player, and Saffron City to below
// its Center's door; the way into the Center, which has no map, is the
// console's. No trainer is met.
UnitTestResult test_route7_to_saffron(){

Check warning on line 82 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::test_route7_to_saffron(): function_lines=27 (advisory above 25, limit 50)
const StoryCheckpoint& row = checkpoint("15.01");
StoryPose at = *story_pose(Pokemon::pose_of(*row.start));
OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing);
const MapPosition trigger{"Route7_EastEntrance", {6, 4}};
bool on_trigger = false;
for (const StoryStep& step : row.steps){
if (step.action == CENTER_ENTER_VARIANT){
break;
}
if (const std::string failure = row_step_on_sim(sim, at, step, row.id); !failure.empty()){
return std::format("15.01: ended on {}; {}", to_string(sim.state().position), failure);
}
on_trigger = on_trigger || sim.state().position == trigger;
}
if (!on_trigger){
return std::format("15.01: never stood on the guard's trigger {}.", to_string(trigger));
}
const MapPosition below_center{"SaffronCity", {24, 39}};
if (!(sim.state().position == below_center)){
return std::format("15.01: ended on {}, not below Saffron's Center door {}.", to_string(sim.state().position), to_string(below_center));
}
if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){
return "15.01: met a trainer or broke a rule on the way.";
}
return true;
}

const AutoStorySaffronCase AUTO_STORY_SAFFRON_CASES[] = {
{
.input = {.name = "15.01 Route 7's gate with the TEA to Saffron's Center", .body = test_route7_to_saffron},
.expectation = {.description = "onto the guard's trigger, below Saffron's Center door, nobody met"},
},
};

} // namespace


void add_tests_AutoStorySaffron(UnitTestDatabase& database){
for (const auto& item : AUTO_STORY_SAFFRON_CASES){
database.add<Test_AutoStorySaffron>(item);
}
}



} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ constexpr std::string_view STORY_ORDER[] = {
"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",
"09.04", "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",
"12.01", "12.02", "12.02b", "12.03", "14.03", "14.04", "14.04b", "15.01",
};

// `checkpoints` in STORY_ORDER's order. Throws ParseException for a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Tests

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

View workflow job for this annotation

GitHub Actions / code-health

Code health (bypass)

<file>: file_lines=1420 over limit 1000, bypassed by the tag at line 11: "stage 4 adds the Cerulean trigger and Nugget Bridge walk tests, which share this file's walk helpers; split with them later"
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -38,6 +38,8 @@
#include "PokemonFRLG_AutoStoryPlanGolden10.h"
#include "PokemonFRLG_AutoStoryPlanGolden11.h"
#include "PokemonFRLG_AutoStoryPlanGolden12.h"
#include "PokemonFRLG_AutoStoryPlanGolden15.h"
#include "PokemonFRLG_AutoStoryRows_Tests.h"
#include "PokemonFRLG_AutoStoryMoveData.h"
#include "PokemonFRLG_AutoStoryStepTable.h"
#include "PokemonFRLG_AutoStoryTable.h"
Expand Down Expand Up @@ -284,8 +286,8 @@
// before leaves the player, and adds the plans to `golden`.
UnitTestResult chain_story_routes(std::vector<std::string>& golden){
const std::vector<StoryCheckpoint>& checkpoints = story_checkpoints();
if (checkpoints.size() != 57 || checkpoints[0].start){
return "Expected 57 checkpoints, the first from a new game.";
if (checkpoints.size() != 58 || checkpoints[0].start){
return "Expected 58 checkpoints, the first from a new game.";
}
StoryPose pose;
for (size_t c = 0; c < checkpoints.size(); c++){
Expand Down Expand Up @@ -317,7 +319,7 @@
// change: run this suite, and replace the lines of FRLG_PLAN_GOLDEN,
// FRLG_PLAN_GOLDEN_10 (segment 10), FRLG_PLAN_GOLDEN_11 (segment 11) and FRLG_PLAN_GOLDEN_12 (segment 12 on)
// with the lines the failure lists after "GOLDEN|".
UnitTestResult test_golden_plans(){

Check warning on line 322 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::test_golden_plans(): function_lines=29 (advisory above 25, limit 50)
std::vector<std::string> actual;
UnitTestResult result = chain_story_routes(actual);
if (result.result != UnitTestResult::PASSED){
Expand All @@ -328,6 +330,7 @@
golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_11), std::end(FRLG_PLAN_GOLDEN_11));
golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_12), std::end(FRLG_PLAN_GOLDEN_12));
golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_12_CELADON), std::end(FRLG_PLAN_GOLDEN_12_CELADON));
golden.insert(golden.end(), std::begin(FRLG_PLAN_GOLDEN_15), std::end(FRLG_PLAN_GOLDEN_15));
const size_t stored = golden.size();
size_t first_diff = 0;
while (first_diff < actual.size() && first_diff < stored && actual[first_diff] == golden[first_diff]){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"format": "pokesim-authored-checkpoint/1",
"game": "frlg",
"checkpoint": {
"id": "15.01",
"title": "Celadon to Saffron: the TEA to Route 7's gate guard, heal at Saffron's Center",
"start": {"map": "CeladonCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"},
"events": [
{
"id": "west_of_tea_guard",
"kind": "route",
"action": "run",
"args": {
"target": {"map": "Route7_EastEntrance", "tiles": [[5, 4]], "facing": "east"}
},
"why": "out of Celadon's Center (its ground floor coded), east through the city and along Route 7 into its east gate (pokeguy bikes, 1:27:07 to 1:27:30), to (5, 4), a tile west of the guard's top trigger (6, 4)"
},
{
"id": "tea_trigger",
"kind": "step",
"args": {
"direction": "east"
},
"declared_after": {"map": "Route7_EastEntrance", "tiles": [[6, 4]], "facing": "east"},
"why": "onto the guard's top trigger (6, 4) (Route7_EastEntrance_EventScript_GuardTriggerTop): the player turns to the guard (6, 2) and stays on the tile (Route7_EastEntrance_Movement_WalkToGuardTop is a walk in place)"
},
{
"id": "guard_takes_tea",
"kind": "scene",
"declared_after": {"map": "Route7_EastEntrance", "tiles": [[6, 4]], "facing": "north"},
"why": "the guard takes the TEA (FLAG_GOT_TEA, Route7_EastEntrance_EventScript_GiveTea), shares it and lets the player through: VAR_MAP_SCENE_ROUTE5_ROUTE6_ROUTE7_ROUTE8_GATES 1 shuts every gate's triggers (pokeguy 1:27:30 to 1:27:43)"
},
{
"id": "below_center_door",
"kind": "route",
"action": "run",
"args": {
"target": {"map": "SaffronCity", "tiles": [[24, 39]], "facing": "north"}
},
"why": "east out of the gate into Saffron City (8, 27), and through the city, round the Rocket Grunts who stand and walk there until Silph Co. (FLAG_HIDE_SAFFRON_ROCKETS), to below the Center's door (24, 38)"
},
{
"id": "saffron_nurse",
"kind": "game_action",
"action": "center_enter",
"declared_after": {"map": "SaffronCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"},
"why": "the Center script in: through the door and up to the nurse; no map of the Center. It also makes Saffron a Fly point"
},
{
"id": "heal_saffron",
"kind": "heal",
"why": "full HP and PP before the Fighting Dojo's five Black Belts"
}
]
},
"execution": {
"menu": "full",
"notes": {
"checkpoint": [
"Starts at Celadon's nurse, facing her, where 14.04 ends.",
"The TEA comes from Celadon Mansion 1F's tea woman, which segment 10 or 11.01 is to cover (outline: pokeguy has it from 1:11). Without it the guard says he's thirsty and walks the player back west (Route7_EastEntrance_Movement_BlockPlayerEntry), and the route after this fails.",
"PokeGuy goes straight to Silph Co. (1:27:44); the Fighting Dojo's Hitmonchan is a user-approved deviation for a Gift RNG. This row ends at Saffron's nurse, where the Dojo checkpoints start.",
"Not authored yet, blocked: the Dojo itself (15.02: the Black Belts and KOICHI to the Poke Balls, saved facing HITMONCHAN's; 15.03: after Gift RNG, leave_gift_summary, deposit, save). SaffronCity_Dojo isn't in the pinned map pack (PokemonSimulation bdca47c), and Gift RNG knows only the Magikarp salesman."
]
}
},
"metadata": {
"phase": "testing",
"postconditions": {
"position": {"map": "SaffronCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}
}
}
}
Loading
Loading