diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index e4e8ec10be..851011bbdf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -83,6 +83,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"pokemon-tower", "Pokemon Tower"}, {"route-16", "Route 16"}, {"fuchsia-city", "Fuchsia City"}, + {"saffron-city", "Saffron City"}, {"cinnabar-island", "Cinnabar Island"}, }){ JsonArray names; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp index 3e5bdbc156..792a16fa08 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp @@ -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", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index 236afd6eb8..3df4cc152d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -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" @@ -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){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 690559bd69..b30b0c7c2b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -370,6 +370,7 @@ std::string save_card_place(const std::string& map){ {"PokemonTower", "pokemon-tower"}, {"Route16", "route-16"}, {"FuchsiaCity", "fuchsia-city"}, + {"SaffronCity", "saffron-city"}, {"CinnabarIsland", "cinnabar-island"}, }; for (const auto& [prefix, place] : PLACES){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h new file mode 100644 index 0000000000..e2ea495217 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h @@ -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 + +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 diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h new file mode 100644 index 0000000000..6973e0bfd7 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h @@ -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 diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h index 7ba79bbc23..6c82e3a04a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h @@ -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 diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index 9775ae4c39..bcbe948153 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -145,7 +145,7 @@ class Test_RunPlan : public UnitTest{ 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[] = { { @@ -236,11 +236,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .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", @@ -279,7 +279,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .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", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp new file mode 100644 index 0000000000..f390852c98 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp @@ -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 +#include +#include +#include +#include +#include +#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 body; +}; + +struct AutoStorySaffronExpectation{ + std::string_view description; +}; + +struct AutoStorySaffronCase{ + AutoStorySaffronInput input; + AutoStorySaffronExpectation expectation; +}; + +class Test_AutoStorySaffron : public UnitTest{ +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(){ + 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(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp index 44ecee7cb2..0d1c4f4ce4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp @@ -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 diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index bef60a8766..a21f8e4b6d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -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" @@ -284,8 +286,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po // before leaves the player, and adds the plans to `golden`. UnitTestResult chain_story_routes(std::vector& golden){ const std::vector& 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++){ @@ -328,6 +330,7 @@ UnitTestResult test_golden_plans(){ 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]){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json new file mode 100644 index 0000000000..00aca0fa5c --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-15.01.plan.json @@ -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"} + } + } +} diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 6ed11ea16c..a84695d347 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -2108,6 +2108,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladonGym_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySaffron_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp @@ -2194,6 +2195,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden10.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden11.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden12.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPlanGolden15.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryResources_Tests.cpp @@ -2210,6 +2212,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows12_Tests.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows15_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngReturns.h