Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c5c18c4
PokemonFRLG: 14.03 and 14.04, Celadon Gym to Erika and back to the nurse
dayfine Nov 12, 2026
7fb8aa5
PokemonFRLG: Celadon Gym sim tests, one helper per row
dayfine Nov 12, 2026
0fbf7ef
PokemonFRLG: 14.04 checks the lead is at least pokeguy's Lv44 before …
dayfine Nov 12, 2026
49ed920
Merge origin/frlg/stage8-rocktunnel into frlg/stage14b-erika
dayfine Nov 12, 2026
065c8e4
Merge origin/frlg/stage8-rocktunnel into frlg/stage14b-erika
dayfine Nov 12, 2026
599f84a
Merge origin/frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 12, 2026
dcedc74
PokemonFRLG: 12.03, Fuchsia's Center and Fly to Celadon, before 14.03
dayfine Nov 12, 2026
e27c7fc
PokemonFRLG: pass the player's gender to read_facing and get_on_bike …
dayfine Nov 12, 2026
85f38e1
PokemonFRLG: thread the player's gender into walk_bike_taps
dayfine Nov 12, 2026
12dead4
PokemonFRLG: thread the player's gender into walk_bike_taps (signature)
dayfine Nov 12, 2026
dd6f97c
PokemonFRLG: 12.03 golden plan lines and fault sweep note; 14.03's Lo…
dayfine Nov 12, 2026
78fb23a
PokemonFRLG: 14.04's leg onto the gym's mat is tapped now (golden)
dayfine Nov 12, 2026
ac18da5
PokemonFRLG: the checkpoint table follows the story's order (STORY_OR…
dayfine Nov 12, 2026
767d4c4
Merge remote-tracking branch 'origin/frlg/stage12-fuchsia-gym' into t…
dayfine Nov 13, 2026
bcab396
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika (12.01 floor)
dayfine Nov 13, 2026
e8b37ea
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika (Mart item na…
dayfine Nov 13, 2026
fb32a7f
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika (12.01 fills …
dayfine Nov 13, 2026
03b90b3
Merge branch 'scratch/koga-policy' into scratch/erika
dayfine Nov 13, 2026
22a830e
FRLG 14.04: Erika is fought by PokeGuy's policy
dayfine Nov 13, 2026
b0880a3
Merge branch 'scratch/koga-policy' into scratch/erika
dayfine Nov 13, 2026
b062d9c
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 13, 2026
6b2a802
Merge branch 'frlg/stage12-fuchsia-gym' into frlg/stage14b-erika
dayfine Nov 13, 2026
0eacda2
Merge remote-tracking branch 'origin/frlg/stage12-fuchsia-gym' into f…
dayfine Nov 13, 2026
6c84974
Merge branch 'frlg/stage12-fuchsia-gym' into frlg/stage14b-erika
dayfine Nov 13, 2026
bbd4c93
Merge branch 'frlg/stage12-fuchsia-gym' into frlg/stage14b-erika
dayfine Nov 13, 2026
9e2f5a1
FRLG 14.04: Erika's foe_threats are PokemonSimulation's planning_risk…
dayfine Nov 13, 2026
9ea7776
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 13, 2026
ffd9381
Merge frlg/stage12-fuchsia-gym (12.02 split) into stage14b-erika
dayfine Nov 13, 2026
0062b18
FRLG 14.04: Erika alone; the walk out and the heal are 14.04b
dayfine Nov 13, 2026
829f72c
Merge remote-tracking branch 'origin/frlg/stage12-fuchsia-gym' into HEAD
dayfine Nov 13, 2026
29b3c52
FRLG 12.03: Fuchsia to Cinnabar by Fly and Surf; 14.03 starts at Cinn…
dayfine Nov 13, 2026
46eab6b
FRLG 12.03: include Rooms header in the Celadon Gym tests
dayfine Nov 13, 2026
e88d61b
FRLG 12.03: Cinnabar Island is a save card place
dayfine Nov 13, 2026
d67c835
FRLG golden: Erika's rows get their own array, so Blaine's rows can s…
dayfine Nov 13, 2026
626bfe5
FRLG AutoStory: use_item takes count; Rare Candy on the lead with lev…
dayfine Nov 13, 2026
a56b3b1
FRLG AutoStory: Rare Candy count test builds its step with an integer…
dayfine Nov 13, 2026
e7c3b15
FRLG AutoStory: split the Rare Candy level-up flow into two helpers
dayfine Nov 13, 2026
dbe0cc4
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika: upstream #18…
dayfine Nov 13, 2026
4e8fd7f
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 14, 2026
becbe4f
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 14, 2026
d720989
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 14, 2026
7a28fa4
Merge frlg/stage12-fuchsia-gym into frlg/stage14b-erika
dayfine Nov 14, 2026
37076ed
Merge origin/frlg/stage12-fuchsia-gym into frlg/stage14b-erika
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=32 (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"},
{"cinnabar-island", "Cinnabar Island"},
}){
JsonArray names;
names.push_back(std::string(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ constexpr std::string_view MAP_NAMES[] = {
"UndergroundPath_WestEntrance",
"Route7",
"CeladonCity",
// Celadon Gym, past the tree Cut fells.
"CeladonCity_Gym",
// The Game Corner's poster and the Rocket Hideout down to B4F.
"CeladonCity_GameCorner",
"RocketHideout_B1F",
Expand Down Expand Up @@ -141,6 +143,10 @@ constexpr std::string_view MAP_NAMES[] = {
// Koga's gym, and the Warden's house (GOLD TEETH for HM04).
"FuchsiaCity_Gym",
"FuchsiaCity_WardensHouse",
// Cinnabar Island, and Route 21 north of it to Pallet Town (12.03).
"CinnabarIsland",
"Route21_North",
"Route21_South",
"CeruleanCave_1F",
"CeruleanCave_2F",
"CeruleanCave_B1F",
Expand All @@ -167,11 +173,28 @@ void add_unmapped_centers(std::vector<MapData>& maps){
}
}

// Pallet Town's fat man wanders over (7..19, 15..19), which holds the whole
// shore (7..10, 16) the way onto Route 21's water goes by. A planned route
// never crosses a wanderer's box, so none would reach the water. He stands on
// his own tile (13, 17) in the planner's model: east of the shore, off the
// way; a person in the way on the console is waited out (12.03).
void waive_pallet_fat_man_box(MapData& map){
if (map.name != "PalletTown"){
return;
}
for (MapObject& object : map.objects){
if (object.name == "fat_man"){
object.wander.reset();
}
}
}

const std::vector<MapData>& all_maps(){
static const std::vector<MapData> MAPS = []{
std::vector<MapData> maps;
for (std::string_view name : MAP_NAMES){
maps.push_back(load_map(std::string(name)));
waive_pallet_fat_man_box(maps.back());
}
add_unmapped_centers(maps);
return maps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static void add_tests_AutoStoryRows(UnitTestDatabase& database){
add_tests_AutoStorySafari(database);
add_tests_AutoStoryFuchsiaGym(database);
add_tests_AutoStoryHealing(database);
add_tests_AutoStoryCeladonGym(database);
}

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

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<header>: header_symbols=8 (advisory above 6, limit 8)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -30,19 +30,23 @@
};

// The pocket of an item the story uses from the bag: repel, super-repel,
// max-repel, escape-rope (Items) or bicycle (Key Items); nothing for
// max-repel, escape-rope, rare-candy (Items) or bicycle (Key Items); nothing for
// another.
std::optional<BagPocket> usable_item_pocket(std::string_view item);

// Whether `item` is a Repel of any kind.
bool is_repel(std::string_view item);

// Whether `item` is used on a Pokemon, the lead (the party list opens on
// it, as for a Potion in battle): the Rare Candy.
bool is_party_item(std::string_view item);

// The row of `item` in `rows` (read_bag_pocket()'s, from the top), if it
// has one left: a count of -1 (unread) counts as some.
std::optional<size_t> bag_row_of(const std::vector<BagRow>& rows, std::string_view item);

// The bag, as use_item_from_bag() drives it: the console's, or a test's.
class ItemUseActions{

Check warning on line 49 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::ItemUseActions: public_methods=6 (advisory above 5, limit 7)
public:
virtual ~ItemUseActions() = default;
// From the overworld, opens the bag on `pocket`, scrolled to its top.
Expand All @@ -51,6 +55,10 @@
virtual std::vector<BagRow> read_pocket() = 0;
// Moves to row `row`, USE, and through what the item says.
virtual void use_row(size_t row) = 0;
// Moves to row `row`, USE, the lead, and through the level-up text
// (the stats window; a new move declined) back to the bag. False if
// the party list or the level-up never showed.
virtual bool use_row_on_lead(size_t row) = 0;
// Moves to row `row` and REGISTERs it for SELECT.
virtual void register_row(size_t row) = 0;
// Back to the overworld (nothing to do if the item closed the bag).
Expand All @@ -66,6 +74,8 @@
NO_BAG,
// Not an item the story uses from the bag.
UNKNOWN_ITEM,
// The item was chosen but its use on the lead never showed its text.
NOT_USED,
};

// "used", "none_left": the end's name in logs and failures.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
// overworld.
ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item);

// `item` used up to `count` times, one bag visit each: as many as the bag
// has. `end` is USED if any was used and the bag ran out; else why none was.
struct ItemUses{
ItemUseEnd end;
size_t used;
};
// Uses `item` up to `count` times from the bag.
ItemUses use_items_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item, size_t count);

// The same, REGISTERing it for SELECT (the Bicycle) instead of USE.
ItemUseEnd register_item_in_bag(Logger& logger, ItemUseActions& actions, std::string_view item);

Expand All @@ -37,17 +46,22 @@
ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item);

// The console's bag, opened from `menu`'s BAG.
class ConsoleItemUseActions : public ItemUseActions{

Check warning on line 49 in SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::ConsoleItemUseActions: public_methods=6 (advisory above 5, limit 7)
public:
ConsoleItemUseActions(ConsoleHandle& console, ProControllerContext& context, Language language, StartMenu menu);

virtual bool open_pocket(BagPocket pocket) override;
virtual std::vector<BagRow> read_pocket() override;
virtual void use_row(size_t row) override;
virtual bool use_row_on_lead(size_t row) override;
virtual void register_row(size_t row) override;
virtual void close_bag() override;

private:
// The two halves of use_row_on_lead().
bool wait_for_level_up_stats();
bool back_to_bag_declining_moves();

ConsoleHandle& m_console;
ProControllerContext& m_context;
Language m_language;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* AutoStory Battle Policy Tests

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

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

<file>: file_lines=592 (advisory above 500, limit 1000)
*
* From: https://github.com/PokemonAutomation/
*
Expand Down Expand Up @@ -464,6 +464,10 @@
return check_policy_step("10.03", "rival_tower", {.spa = 2, .outspeed = true, .guard_accuracy = true, .torrent_power = true});
}

UnitTestResult test_plan_erika(){
return check_policy_step("14.04", "erika", {.spa = 1, .accuracy = 2, .outspeed = true, .guard_accuracy = true});
}


struct AutoStoryBattlePolicyInput{
std::string name;
Expand Down Expand Up @@ -562,6 +566,10 @@
.input = {.name = "plan: 12.02 koga names the policy, goals and foes", .body = test_plan_koga},
.expectation = {.description = "the policy, goals and 4 foe rows"},
},
{
.input = {.name = "plan: 14.04 erika names the policy, goals and foes", .body = test_plan_erika},
.expectation = {.description = "the policy, goals and 3 foe rows"},
},
{
.input = {.name = "plan: 10.03 rival_tower names the policy, goals and foes", .body = test_plan_tower_rival},
.expectation = {.description = "the policy, goals and 5 foe rows"},
Expand Down
Loading
Loading