Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ constexpr std::string_view MAP_NAMES[] = {
// Route 7's east gate, where the guard takes the TEA, and Saffron City.
"Route7_EastEntrance",
"SaffronCity",
// Sabrina's gym: nine rooms joined by teleport pads (warps).
"SaffronCity_Gym",
// Cinnabar Island's Center and Blaine's gym, through its quiz doors, and
// Route 21 north of it to Pallet Town (12.03).
"CinnabarIsland",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows13_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows16_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows17_Tests.h"
#include "Programs/AutoStory/PokemonFRLG_AutoStoryRows18_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 @@ -120,6 +121,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){
add_tests_AutoStorySilph(database);
add_tests_AutoStoryMansion(database);
add_tests_AutoStoryViridian(database);
add_tests_AutoStorySaffronGym(database);
}

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

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

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=814 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -134,6 +134,12 @@
"fly_celadon: a Fly that doesn't leave Cinnabar Island goes unseen, and the row, which walks on from Celadon's heal spot, ends below Erika: the same fix as 11.01's, the fly landing on its town's tile (FlyTown::landing) checked before the step ends"},
{"PokemonFRLG::AutoStory - Fault sweep: 17.02, warp no-op",
"fly_viridian: a Fly that doesn't leave Saffron City goes unseen, and the row, which walks on from Saffron's streets, ends on Viridian's Gym tile: the same fix as 11.01's, the fly landing on its town's tile (FlyTown::landing) checked before the step ends"},
{"PokemonFRLG::AutoStory - Fault sweep: 18.01, late warp fade",
"pad_to_top_right: a pad hop stays on SaffronCity_Gym, so a fade seen late (or a slow fade-in) leaves no scene change to confirm the warp and the step finds no fade: a scene check for a warp within one map (the player's tile moved from the pad), as the walker's scene_confirms_missed_fade does for a leg"},
{"PokemonFRLG::AutoStory - Fault sweep: 18.02, late warp fade",
"pad_from_top_right: a pad hop stays on SaffronCity_Gym, so a fade seen late (or a slow fade-in) leaves no scene change to confirm the warp and the step finds no fade: a scene check for a warp within one map (the player's tile moved from the pad), as the walker's scene_confirms_missed_fade does for a leg"},
{"PokemonFRLG::AutoStory - Fault sweep: 18.02, slow fade-in after every warp",
"pad_from_top_right: a pad hop stays on SaffronCity_Gym, so a fade seen late (or a slow fade-in) leaves no scene change to confirm the warp and the step finds no fade: a scene check for a warp within one map (the player's tile moved from the pad), as the walker's scene_confirms_missed_fade does for a leg"},
{"PokemonFRLG::AutoStory - Fault sweep: 08.03, off the Bicycle at a bike leg",
"riding with no fault, route7_underground_exit's warp to UndergroundPath_EastEntrance is not confirmed on the sim (the screen after the fade reads as before the hold): the sim's warp off the Bicycle, before this class can sweep 08.03"},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* FRLG AutoStory Plan Golden, Segment 18
*
* From: https://github.com/PokemonAutomation/
*
* The golden's lines for 18.01 and 18.02, Saffron Gym (after
* PokemonFRLG_AutoStoryPlanGolden16.h's, before PokemonFRLG_AutoStoryPlanGolden17.h's
* 17.01), in the story's order.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden18_H
#define PokemonAutomation_PokemonFRLG_AutoStoryPlanGolden18_H

#include <string_view>

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{

// The stored plan lines of 18.01 and 18.02, Saffron Gym.
inline constexpr std::string_view FRLG_PLAN_GOLDEN_18[] = {
"18.01 by_pad_to_bottom_right from SaffronCity_Gym (14, 23) facing north to SaffronCity_Gym (17, 20) facing east",
"18.01 walk east 3 -> SaffronCity_Gym (17, 23) [walk only]",
"18.01 walk north 3 -> SaffronCity_Gym (17, 20) [walk only]",
"18.01 face east -> SaffronCity_Gym (17, 20) [walk only]",
"18.01 along_row_22 from SaffronCity_Gym (28, 23) facing east to SaffronCity_Gym (20, 22) facing west",
"18.01 walk north 1 -> SaffronCity_Gym (28, 22) [walk only]",
"18.01 walk west 8 (to wall) -> SaffronCity_Gym (20, 22) [walk only]",
"18.01 below_pad_to_top_right from SaffronCity_Gym (20, 22) facing west to SaffronCity_Gym (20, 21) facing north",
"18.01 walk north 1 -> SaffronCity_Gym (20, 21) [walk only]",
"18.01 by_pad_to_top_left from SaffronCity_Gym (28, 4) facing north to SaffronCity_Gym (20, 6) facing south",
"18.01 walk south 2 -> SaffronCity_Gym (28, 6) [walk only]",
"18.01 walk west 8 (to wall) -> SaffronCity_Gym (20, 6) [walk only]",
"18.01 face south -> SaffronCity_Gym (20, 6) [walk only]",
"18.01 by_pad_to_sabrina from SaffronCity_Gym (0, 4) facing south to SaffronCity_Gym (0, 6) facing south",
"18.01 walk south 2 -> SaffronCity_Gym (0, 6) [walk only]",
"18.01 below_sabrina from SaffronCity_Gym (18, 15) facing south to SaffronCity_Gym (14, 12) facing north",
"18.01 walk west 4 -> SaffronCity_Gym (14, 15) [walk only]",
"18.01 walk north 3 -> SaffronCity_Gym (14, 12) [walk only]",
"18.02 by_pad_out_of_sabrina from SaffronCity_Gym (14, 12) facing north to SaffronCity_Gym (17, 15) facing east",
"18.02 walk south 3 (to wall) -> SaffronCity_Gym (14, 15) [walk only]",
"18.02 walk east 3 -> SaffronCity_Gym (17, 15) [walk only]",
"18.02 by_pad_from_top_left from SaffronCity_Gym (0, 7) facing east to SaffronCity_Gym (0, 5) facing north",
"18.02 walk north 2 -> SaffronCity_Gym (0, 5) [walk only]",
"18.02 along_row_6 from SaffronCity_Gym (20, 7) facing north to SaffronCity_Gym (28, 6) facing east",
"18.02 walk north 1 -> SaffronCity_Gym (20, 6) [walk only]",
"18.02 walk east 8 (to wall) -> SaffronCity_Gym (28, 6) [walk only]",
"18.02 below_pad_from_top_right from SaffronCity_Gym (28, 6) facing east to SaffronCity_Gym (28, 5) facing north",
"18.02 walk north 1 -> SaffronCity_Gym (28, 5) [walk only]",
"18.02 by_pad_from_bottom_right from SaffronCity_Gym (20, 20) facing north to SaffronCity_Gym (28, 22) facing south",
"18.02 walk south 2 -> SaffronCity_Gym (20, 22) [walk only]",
"18.02 walk east 8 (to wall) -> SaffronCity_Gym (28, 22) [walk only]",
"18.02 face south -> SaffronCity_Gym (28, 22) [walk only]",
"18.02 below_center_door from SaffronCity_Gym (18, 20) facing south to SaffronCity (24, 39) facing north",
"18.02 walk south 3 (to wall) -> SaffronCity_Gym (18, 23) [walk only]",
"18.02 walk west 4 -> SaffronCity_Gym (14, 23) [walk only] [tapped]",
"18.02 walk south 1 (warp) -> SaffronCity (46, 13) [walk only]",
"18.02 walk west 17 (to wall) -> SaffronCity (29, 13)",
"18.02 walk north 3 (to wall) -> SaffronCity (29, 10)",
"18.02 walk west 14 (to wall) -> SaffronCity (15, 10)",
"18.02 walk south 29 -> SaffronCity (15, 39)",
"18.02 walk east 9 -> SaffronCity (24, 39)",
"18.02 face north -> SaffronCity (24, 39)",
};

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

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

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=751 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -494,11 +494,18 @@
// A hop() or step_onto() (a plain step the table says the end of); else
// a step one tap at a time, or for a step into a trainer's line by
// step_until_seen(), each watched for the trainer.
std::string OverworldStepSim::step_ahead(const StoryStep& step){

Check warning on line 497 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::OverworldStepSim::step_ahead( const StoryStep & step): function_lines=36 (advisory above 25, limit 50)
const Direction direction = Pokemon::story_arg<Direction>(step.args, "direction");
if (step.action.empty() && step.pose_after){
// A step onto a warp waits out its fade, as take_warp_step() does, so
// the next press is not swallowed by the fade.
if (const std::optional<RouteStep> warp = warp_press(story_maps(), MapPosition{m_at.map, m_at.tile}, direction)){
const std::string failure = step_onto_warp(*warp);
m_at = *story_pose(Pokemon::pose_of(*step.pose_after));
return failure;
}
return step_onto(step);
}
const Direction direction = Pokemon::story_arg<Direction>(step.args, "direction");
if (step.action.empty()){
if (const std::optional<RouteStep> warp = warp_press(story_maps(), MapPosition{m_at.map, m_at.tile}, direction)){
return step_onto_warp(*warp);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* AutoStory Row Tests, Segment 18
*
* From: https://github.com/PokemonAutomation/
*
* Registration of the tests that run segment 18's rows (Saffron Gym, whose
* id is a label: the story plays it after Silph Co.) on the overworld sim,
* beside PokemonFRLG_AutoStoryRows16_Tests.h's.
*
*/

#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRows18_Tests_H
#define PokemonAutomation_PokemonFRLG_AutoStoryRows18_Tests_H

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

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


// Rows 18.01 and 18.02, Saffron Gym's pads, on the overworld sim
// (PokemonFRLG_AutoStorySaffronGym_Tests.cpp).
void add_tests_AutoStorySaffronGym(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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 17.02 17.03 17.04 17.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 18.01 18.02 17.02 17.03 17.04 17.04b";

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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 17.02 17.03 17.04 17.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 18.01 18.02 17.02 17.03 17.04 17.04b"},
},
{
.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 17.02 17.03 17.04 17.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 18.01 18.02 17.02 17.03 17.04 17.04b"},
},
{
.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 17.02 17.03 17.04 17.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 13.01 13.02 13.03 13.04 14.01 14.02 14.02b 14.03 14.04 14.04b 15.01 16.01 18.01 18.02 17.02 17.03 17.04 17.04b"},
},
{
.input = { .name = "Starter RNG first, with both on",
Expand Down
Loading
Loading