Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e92d72a
PokemonFRLG: 10.01 to 10.06, back to Lavender and up the Pokemon Towe…
dayfine Nov 12, 2026
e662cfa
Merge remote-tracking branch 'origin/frlg/stage8-rocktunnel' into frl…
dayfine Nov 12, 2026
be16633
PokemonFRLG: the Tower's rows in the story tests; POKEMON TOWER on th…
dayfine Nov 12, 2026
05859a6
PokemonFRLG: 10.04 and 10.05 tap to the 3F stairs and the Marowak's t…
dayfine Nov 12, 2026
fd7f466
PokemonFRLG: plan golden with 10.01 to 10.06
dayfine Nov 12, 2026
6f7ce35
PokemonFRLG: register the Tower's sim tests with the Celadon rows'; s…
dayfine Nov 12, 2026
7bf26d6
PokemonFRLG: Fly and field Surf steps, with sim support
dayfine Nov 12, 2026
9dd239c
PokemonFRLG: field move water tests on Viridian City's pond
dayfine Nov 12, 2026
e765321
PokemonFRLG: pin maps to PokemonSimulation 0c46df1 (item balls, Celad…
dayfine Nov 12, 2026
9fa419e
PokemonFRLG: battle steps use the plan's X items; two X Specials on t…
dayfine Nov 12, 2026
a7e1c08
PokemonFRLG: bag counts in AutoStoryItemsPocket.cpp, the battle items…
dayfine Nov 12, 2026
2ddb5fc
Merge remote-tracking branch 'origin/frlg/field-moves' into agent/sta…
dayfine Nov 12, 2026
917e014
PokemonFRLG: 10.01 as PokeGuy: HM02 Fly from Route 16's house, taught…
dayfine Nov 12, 2026
66b70d1
PokemonFRLG: the TEA and a Gift RNG Eevee in Celadon Mansion (09.03, …
dayfine Nov 12, 2026
42977fd
PokemonFRLG: 10.03 checks the lead is at least pokeguy's Lv36 before …
dayfine Nov 12, 2026
98b99ed
PokemonFRLG: 10.01 buys PokeGuy's X items on the Department Store's 5…
dayfine Nov 12, 2026
19f3c04
PokemonFRLG: the fault sweep rides both lifts; plan golden with 10.01…
dayfine Nov 12, 2026
b46c15c
PokemonFRLG: code health for the store lift and Fly by species
dayfine Nov 12, 2026
3edbe7f
Merge origin/frlg/stage8-rocktunnel into frlg/stage9-tower
dayfine Nov 12, 2026
15b6d81
PokemonFRLG: 10.01's X items buy from the money measured at the Celad…
dayfine Nov 12, 2026
4f30d51
PokemonFRLG: AutoStory's Gift/Starter RNG keep their stats over the r…
dayfine Nov 12, 2026
68b3ff2
PokemonFRLG: AutoStory's row after an RNG handoff skips the start che…
dayfine Nov 12, 2026
8450ea8
PokemonFRLG: arrivals on side stairs and exit mats face away from the…
dayfine Nov 12, 2026
b4be738
PokemonFRLG: 10.01's Fly finds the Pidgey by species
dayfine Nov 12, 2026
65f9ce2
PokemonFRLG: warp_press() ends where the warp leaves the player, faci…
dayfine Nov 12, 2026
db79261
PokemonFRLG: the Mart walks its cursor row by row over the scrolling …
dayfine Nov 12, 2026
4f7ff40
PokemonFRLG: a warp whose fade went unseen is taken by the scene afte…
dayfine Nov 12, 2026
2703f7d
PokemonFRLG: the Cycling Road's gates leave a rider on the Bicycle
dayfine Nov 12, 2026
71eed75
PokemonFRLG: sim test, 10.01 rides through Route 16's north gate to t…
dayfine Nov 12, 2026
27c69bd
PokemonFRLG: 10.01 bikes through Route 16's north gate to the Fly house
dayfine Nov 12, 2026
56d9dac
PokemonFRLG: the row sim rides a bike route when the player is on the…
dayfine Nov 12, 2026
e4b71c1
PokemonFRLG: warp_keeps_bike() with the maps, out of the Bicycle header
dayfine Nov 12, 2026
81731aa
PokemonFRLG: include the maps header for warp_keeps_bike() in the sim
dayfine Nov 12, 2026
2bbaa99
PokemonFRLG: read the Pidgey's moves; the summary starts on the lead;…
dayfine Nov 12, 2026
7d484e4
PokemonFRLG: read the whole Items pocket; Water Pulse first on ties
dayfine Nov 12, 2026
5a4a189
PokemonFRLG: a tap from facing another way is a turn; 10.04 onto the …
dayfine Nov 12, 2026
df44ac9
PokemonFRLG: legs onto side stairs end going the warp's way or at a wall
dayfine Nov 12, 2026
81f4a6c
PokemonFRLG: one sim call for how the screen check reads a step tap
dayfine Nov 12, 2026
e1b64dd
PokemonFRLG: planned legs onto side stairs from the side are tapped
dayfine Nov 12, 2026
614be52
FRLG AutoStory: start check spans one Tower fog period
dayfine Nov 12, 2026
befe549
FRLG AutoStory: start check compares tile detail, not fog's colour
dayfine Nov 12, 2026
1989260
PokemonFRLG: 10.05's Rare Candy approach is tapped; no turn tap when …
dayfine Nov 12, 2026
63f59f6
PokemonFRLG AutoStory: declared facing after a trainer battle is the …
dayfine Nov 12, 2026
23df78a
PokemonFRLG AutoStory: the walk before an A press ends on its tile
dayfine Nov 12, 2026
c3a0ce9
Merge origin/frlg/stage2-rng into frlg/stage9-tower: upstream #1881 f…
dayfine Nov 13, 2026
9cf8e3f
Merge frlg/stage8-rocktunnel into frlg/stage9-tower
dayfine Nov 14, 2026
42f33dd
Merge frlg/stage8-rocktunnel into frlg/stage9-tower
dayfine Nov 14, 2026
aa223f7
Merge frlg/stage8-rocktunnel into frlg/stage9-tower
dayfine Nov 14, 2026
df7c0fd
Merge frlg/stage8-rocktunnel into frlg/stage9-tower
dayfine Nov 14, 2026
cb3533a
Merge origin/frlg/stage8-rocktunnel into frlg/stage9-tower
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 @@ -63,7 +63,7 @@
: SmallDictionaryMatcher(dictionary())
{}

static JsonObject dictionary(){

Check warning on line 66 in SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

PokemonAutomation::NintendoSwitch::PokemonFRLG::ItemNameMatcher::dictionary(): function_lines=27 (advisory above 25, limit 50)
JsonObject english;
for (const auto& [slug, name] : {
std::pair<std::string_view, std::string_view>{"potion", "Potion"},
Expand All @@ -75,6 +75,10 @@
{"super-repel", "Super Repel"},
{"max-repel", "Max Repel"},
{"escape-rope", "Escape Rope"},
{"x-special", "X Special"},
{"x-speed", "X Speed"},
{"x-accuracy", "X Accuracy"},
{"guard-spec", "Guard Spec."},
{"bicycle", "Bicycle"},
{"cancel", "Cancel"},
}){
Expand All @@ -92,33 +96,43 @@
return extract_box_reference(screen, GameSettings::instance().GAME_BOX);
}

// Where row `row` of the bag shows its item count.
ImageFloatBox bag_item_count_box(int row){
return ImageFloatBox(208.0 / 240, (ROW_TOP + ROW_STEP * row) / 160, 15.0 / 240, ROW_HEIGHT / 160);
}

} // namespace


ImageFloatBox item_list_name_box(int row){
return ImageFloatBox(96.0 / 240, (ROW_TOP + ROW_STEP * row) / 160, 72.0 / 240, ROW_HEIGHT / 160);
}
ImageFloatBox bag_item_count_box(int row){
return ImageFloatBox(208.0 / 240, (ROW_TOP + ROW_STEP * row) / 160, 15.0 / 240, ROW_HEIGHT / 160);
}

std::string read_item_list_name(Logger& logger, Language language, const ImageViewRGB32& screen, int row){
return ItemNameMatcher::instance().read(logger, language, extract_box_reference(game_box(screen), item_list_name_box(row)));
}

BagRow read_bag_row(Logger& logger, Language language, const ImageViewRGB32& screen, int shown){
const std::string item = read_item_list_name(logger, language, screen, shown);
if (item == "cancel"){
return BagRow{item, 0};
}
const ImageViewRGB32 count = extract_box_reference(game_box(screen), bag_item_count_box(shown));
// Not Tesseract on each waterfilled digit: the font joins some strokes
// only at a corner, so the 5 and the 3 fell apart into pieces and read
// as nothing (console B, 2026-11-02). The stat boxes' templates are
// the same digits on the same cream.
return BagRow{item, read_digits_waterfill_template(logger, count, DigitTemplateType::StatBox)};
}

std::vector<BagRow> read_bag_pocket(Logger& logger, Language language, const ImageViewRGB32& screen){
std::vector<BagRow> rows;
for (int row = 0; row < ITEM_LIST_ROWS; row++){
const std::string item = read_item_list_name(logger, language, screen, row);
if (item == "cancel"){
BagRow read = read_bag_row(logger, language, screen, row);
if (read.item == "cancel"){
break;
}
const ImageViewRGB32 count = extract_box_reference(game_box(screen), bag_item_count_box(row));
// Not Tesseract on each waterfilled digit: the font joins some strokes
// only at a corner, so the 5 and the 3 fell apart into pieces and read
// as nothing (console B, 2026-11-02). The stat boxes' templates are
// the same digits on the same cream.
rows.push_back(BagRow{item, read_digits_waterfill_template(logger, count, DigitTemplateType::StatBox)});
rows.push_back(std::move(read));
}
return pocket_rows(std::move(rows));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ namespace PokemonFRLG{
// Rows a list shows at once.
constexpr int ITEM_LIST_ROWS = 6;

// Where row `row` (from 0) of a list shows its item's name, and in the bag
// its count, as fractions of the game screen.
// Where row `row` (from 0) of a list shows its item's name, as fractions
// of the game screen.
ImageFloatBox item_list_name_box(int row);
// Where row `row` of the bag shows its item count.
ImageFloatBox bag_item_count_box(int row);

// The item named in row `row`: a slug such as "potion", "antidote",
// "parlyz-heal", "awakening", "poke-ball", "repel",
Expand All @@ -51,6 +49,10 @@ struct BagRow{
int count = 0;
};

// The item and count shown in row `shown` (from 0) of the bag's open
// pocket; an empty item if its name can't be read.
BagRow read_bag_row(Logger& logger, Language language, const ImageViewRGB32& screen, int shown);

// The rows of the bag's open pocket from the top, as pocket_rows() keeps
// them. The pocket must be scrolled to its top.
std::vector<BagRow> read_bag_pocket(Logger& logger, Language language, const ImageViewRGB32& screen);
Expand Down
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=29 (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 @@ -80,6 +80,7 @@
{"vermilion-city", "Vermilion City"},
{"celadon-city", "Celadon City"},
{"rocket-hideout", "Rocket Hideout"},
{"pokemon-tower", "Pokemon Tower"},
}){
JsonArray names;
names.push_back(std::string(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ constexpr double CURSOR_EDGE_LEFT = 120;
constexpr double CURSOR_EDGE_TOP = 24;
constexpr double CURSOR_EDGE_HEIGHT = 16;

// The level-up moves of Squirtle's, Magikarp's and Oddish's lines (pret
// The level-up moves of Squirtle's, Magikarp's, Oddish's and Pidgey's lines (pret
// pokefirered src/data/pokemon/level_up_learnsets.h), then the TMs'
// and HMs' moves not among them (src/data/items.h; Hyper Beam, Protect
// and Rain Dance are above), as the game writes them
Expand Down Expand Up @@ -83,6 +83,14 @@ constexpr std::pair<std::string_view, std::string_view> MOVE_NAMES[] = {
{"aromatherapy", "Aromatherapy"},
{"mega-drain", "Mega Drain"},
{"magical-leaf", "Magical Leaf"},
{"sand-attack", "Sand-Attack"},
{"gust", "Gust"},
{"quick-attack", "Quick Attack"},
{"whirlwind", "Whirlwind"},
{"wing-attack", "Wing Attack"},
{"feather-dance", "FeatherDance"},
{"agility", "Agility"},
{"mirror-move", "Mirror Move"},
{"hyper-beam", "Hyper Beam"},
{"focus-punch", "Focus Punch"},
{"dragon-claw", "Dragon Claw"},
Expand Down Expand Up @@ -354,6 +362,11 @@ void add_tests_SummaryMovesReader(UnitTestDatabase& database){
// FireRed on console B, 2026-11-03: the Oddish caught for Cut, Lv12, with
// ABSORB, SWEET SCENT and two empty slots.
database.add<Test_SummaryScreen>("PokemonFRLG/SummaryMovesReader/Oddish_KnownMoves_eng.png");
// FireRed on console B, 2026-11-12 (10.01 teach_fly): the Route 7
// Pidgey, Lv22, with SAND-ATTACK, GUST, QUICK ATTACK and WHIRLWIND,
// read as attract, ?, attract and steel-wing before its line's moves
// were in MOVE_NAMES.
database.add<Test_SummaryScreen>("PokemonFRLG/SummaryMovesReader/Pidgey_KnownMoves_eng.png");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ constexpr std::string_view LIFT_ROOM_JSON = R"({
"warps": [{"x": 2, "y": 5, "enter": "walk_south"}]
})";

// LAYOUT_CELADON_CITY_DEPARTMENT_STORE_ELEVATOR: the hideout lift's
// map.bin, the panel's bg events at (0, 2) and (4, 1), warp 0 at (2, 5)
// (the MB_SOUTH_ARROW_WARP tile, where the floors' doors land) and warp 1
// at (2, 6), in the wall row, never reached.
constexpr std::string_view DEPT_STORE_LIFT_ROOM_JSON = R"({
"name": "CeladonCity_DepartmentStore_Elevator",
"source": {"decomp_file": "data/layouts/CeladonCity_DepartmentStore_Elevator/map.bin", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-11-11"},
"tiles": ["#####", "####S", "S####", ".....", ".....", ".....", "#####"],
"points": {"warp_0": [2, 5], "warp_1": [2, 6]},
"warps": [{"x": 2, "y": 5, "enter": "walk_south"}]
})";

} // namespace


Expand Down Expand Up @@ -206,6 +218,21 @@ const std::vector<MapPosition>& rocket_hideout_lift_exits(){
return EXITS;
}

MapData department_store_lift_room(){
return parse_map(std::string(DEPT_STORE_LIFT_ROOM_JSON), std::string(DEPT_STORE_LIFT_MAP));
}

const std::vector<MapPosition>& department_store_lift_exits(){
static const std::vector<MapPosition> EXITS{
{"CeladonCity_DepartmentStore_5F", {6, 2}},
{"CeladonCity_DepartmentStore_4F", {6, 2}},
{"CeladonCity_DepartmentStore_3F", {6, 2}},
{"CeladonCity_DepartmentStore_2F", {6, 2}},
{"CeladonCity_DepartmentStore_1F", {6, 2}},
};
return EXITS;
}



} // namespace PokemonFRLG
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Fly Map
*
* From: https://github.com/PokemonAutomation/
*
*/

#include "PokemonFRLG_FlyMap.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


const std::vector<FlyTown>& kanto_fly_towns(){
static const std::vector<FlyTown> TOWNS{
{"PalletTown", {4, 11}, {"PalletTown", {6, 8}}},
{"ViridianCity", {4, 8}, {"ViridianCity", {26, 27}}},
{"PewterCity", {4, 4}, {"PewterCity", {17, 26}}},
{"Route4", {8, 3}, {"Route4", {12, 6}}},
{"CeruleanCity", {14, 3}, {"CeruleanCity", {22, 20}}},
{"VermilionCity", {14, 9}, {"VermilionCity", {15, 7}}},
{"Route10", {18, 3}, {"Route10", {13, 21}}},
{"LavenderTown", {18, 6}, {"LavenderTown", {6, 6}}},
{"CeladonCity", {11, 6}, {"CeladonCity", {48, 12}}},
{"SaffronCity", {14, 6}, {"SaffronCity", {24, 39}}},
{"FuchsiaCity", {12, 12}, {"FuchsiaCity", {25, 32}}},
{"CinnabarIsland", {4, 14}, {"CinnabarIsland", {14, 12}}},
{"IndigoPlateau", {2, 3}, {"IndigoPlateau_Exterior", {11, 7}}},
};
return TOWNS;
}

std::optional<size_t> fly_town_index(std::string_view name){
const std::vector<FlyTown>& towns = kanto_fly_towns();
for (size_t c = 0; c < towns.size(); c++){
if (towns[c].name == name){
return c;
}
}
return std::nullopt;
}



} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Fly Map
*
* From: https://github.com/PokemonAutomation/
*
* The towns Fly takes the player to in Kanto: each one's cell on the fly
* map and the tile the player lands on. Cells are pokefirered's
* sRegionMapSections_Kanto (src/data/region_map/region_map_layout_kanto.h,
* 22 x 15, the cursor's x and y); landing tiles its heal locations
* (src/data/heal_locations.json), which Fly warps to (SetFlyWarpDestination()
* in src/region_map.c).
*
*/

#ifndef PokemonAutomation_PokemonFRLG_FlyMap_H
#define PokemonAutomation_PokemonFRLG_FlyMap_H

#include <cstddef>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "PokemonFRLG_OverworldRouteSteps.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonFRLG{


// A place on the fly map Fly can take the player to.
struct FlyTown{
// The map's name, as a step names the town ("CeladonCity", "Route4").
std::string name;
// The town's cell on the fly map: the presses right and down from its
// top-left corner, where a hold up-left leaves the cursor
// (HandleRegionMapInput() stops it at 0).
TilePos cell;
// The tile Fly lands the player on: below the Pokemon Center's door,
// or Pallet Town's player's house.
MapPosition landing;
};

// Kanto's Fly destinations, Pallet Town first.
const std::vector<FlyTown>& kanto_fly_towns();
// The index of the town named `name` in kanto_fly_towns(), if it is one.
std::optional<size_t> fly_town_index(std::string_view name);

// The fly map's width in cells (MAP_WIDTH in region_map.c).
constexpr int FLY_MAP_COLUMNS = 22;
// The fly map's height in cells (MAP_HEIGHT in region_map.c).
constexpr int FLY_MAP_ROWS = 15;



} // namespace PokemonFRLG
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Hideout Lift Room

Check warning on line 1 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.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 @@ -38,6 +38,20 @@
// and (20, 24) (console B, 2026-11-11, B4F).
const std::vector<MapPosition>& rocket_hideout_lift_exits();

// The Celadon Department Store's lift: the same layout as the hideout's
// (LAYOUT_CELADON_CITY_DEPARTMENT_STORE_ELEVATOR's map.bin is byte for
// byte LAYOUT_ROCKET_HIDEOUT_ELEVATOR's), so the same LIFT_ARRIVAL and
// LIFT_PANEL_FRONT. Its floors' lift doors lead to its warp 0, (2, 5).
inline constexpr std::string_view DEPT_STORE_LIFT_MAP = "CeladonCity_DepartmentStore_Elevator";
// The store lift's room, under DEPT_STORE_LIFT_MAP. Its door is a dynamic
// warp, as the hideout's (SimScript::lift_floors with
// department_store_lift_exits()).
MapData department_store_lift_room();
// Where it lets out for each floor on its panel, top first: every floor's
// lift door is (6, 1) (setdynamicwarp ..., 255, 6, 1 in its scripts), and
// the player is walked a tile south off it, onto (6, 2).
const std::vector<MapPosition>& department_store_lift_exits();


} // namespace PokemonFRLG
} // namespace NintendoSwitch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,43 @@
return calls.facing();
}

// On foot, a tap by a player read facing another way before it only
// turns them (MovementMechanics: 70 of 70 turned), whatever the screen
// showed: the screen check read the turn south before 10.04's "south 3"
// as a step, and the leg ended a tile short of the Pokemon Tower 3F
// stairs (console B, 2026-11-12 03:08).
bool only_turns(const std::optional<Direction>& before, const RouteStep& step){
return before && *before != step.direction;
}

} // namespace

StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){

Check failure on line 38 in SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::NintendoSwitch::PokemonFRLG::count_bike_taps( const RouteStep & step , const BikeTapCalls & calls): function_lines=51, limit=50, allowed 50
int moved = 0;
for (int tap = 1; tap <= step.tiles; tap++){
std::optional<Direction> before = facing_before(calls);
BikeTap result = calls.tap(tap);
for (int retry = 1; retry < calls.tries && !result.moved && !result.interrupt && !result.cleared_late; retry++){
if (!before || *before == step.direction){
for (int retry = 1; retry < calls.tries && !result.interrupt && !result.cleared_late; retry++){
if (result.moved && !only_turns(before, step)){
break;
}
if (!result.moved && !only_turns(before, step)){
calls.log(std::format(
"Taps: tap {} of {} showed no step, facing {} before it: not tapping again, it may have stepped unseen.",
tap, step.tiles, before ? Pokemon::direction_name(*before) : "an unknown way"
));
break;
}
calls.log(std::format("Taps: tap {} of {} didn't move: tapping again, it only turned the player.", tap, step.tiles));
calls.log(std::format(
"Taps: tap {} of {} from facing {} only turned the player{}: tapping again.",
tap, step.tiles, Pokemon::direction_name(*before), result.moved ? ", though the screen changed" : ""
));
before = facing_before(calls);
result = calls.tap(tap);
}
if (result.moved && only_turns(before, step)){
result.moved = false;
}
if (result.interrupt || result.cleared_late){
calls.log(std::format("Bike: tap {} of {}: interrupted after {} tile(s).", tap, step.tiles, moved));
if (result.interrupt){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ std::optional<Direction> exit_mat(const MapData& map, const TilePos& point){
bool walks_out_on_arrival(const MapData& map, const TilePos& point){
return is_door(map, point) || warp_entry(map, point) == WarpEntry::CAVE_ENTRANCE;
}
std::optional<Direction> arrival_facing(const MapData& map, const TilePos& point){
if (walks_out_on_arrival(map, point)){
return Direction::SOUTH;
}
if (const std::optional<Direction> taken = exit_mat(map, point)){
return opposite(*taken);
}
return std::nullopt;
}

void hide_objects(MapData& map, const std::set<std::string>& flags){
std::vector<MapObject> shown;
Expand Down
Loading
Loading