From eae473ac8e0353e6f207bbfb7653b60a83e52d9a Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 14 Nov 2026 13:20:37 -0800 Subject: [PATCH 1/2] FRLG maps: Cinnabar Gym's quiz doors are gates Cinnabar Gym's blockdata has its six quiz doors shut, and the gym's OnLoad opens each one whose FLAG_CINNABAR_GYM_QUIZ_ is set; the right answer at quiz machine runs the same open script and sets the flag. The maps had the doors as plain walls, so AutoStory's planned legs on console B held to a "wall" that was an open door and ran through it (14.01, 14.02b), and the plans step through each door a tile at a time instead. The generator now makes each door a gate (`G`, opens_by quiz_answer, the door's flag): its tiles are the walls the open script makes passable, one barrier row each (door 4: two tiles of a column). The overlay opens each gate once its flag is set. quiz_answer is a new opens_by: a door the story opens, never a press on it. The user approved marking the doors as gates. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- data/games/frlg/maps/README.md | 2 + .../frlg/maps/base/CinnabarIsland_Gym.json | 54 ++++++++++- .../maps/overlays/CinnabarIsland_Gym.json | 84 +++++++++++++++++ .../frlg/maps/runtime/CinnabarIsland_Gym.json | 93 ++++++++++++++----- data/maps/runtime-manifest.json | 14 ++- docs/maps/runtime-maps.md | 2 +- schemas/runtime-map-v2.schema.json | 2 +- src/pokesim/maps/frlg_decomp_map_builder.py | 45 +++++++++ src/pokesim/maps/runtime_map_schema.py | 5 +- .../maps/test_frlg_decomp_map_builder.py | 30 ++++++ 10 files changed, 295 insertions(+), 36 deletions(-) create mode 100644 data/games/frlg/maps/overlays/CinnabarIsland_Gym.json diff --git a/data/games/frlg/maps/README.md b/data/games/frlg/maps/README.md index dd4878a..e89498c 100644 --- a/data/games/frlg/maps/README.md +++ b/data/games/frlg/maps/README.md @@ -34,6 +34,7 @@ Overlays today: | `VermilionCity_Gym` | `tile` (4..6, 6..7) to `.`: the electric beams are off | `story_state` | `FLAG_FOUND_BOTH_VERMILION_GYM_SWITCHES`, after checkpoint 00.23 | | `PokemonMansion_1F`, `_2F`, `_3F`, `_B1F` | `gate` open or closed: one operation per barrier (13 in all). The base and runtime tiles show each barrier as `G` (the base is the blockdata, the switch-off state); the effective map has it as the new game leaves it until the switch flag is set | `story_state` | `FLAG_POKEMON_MANSION_SWITCH_STATE`, set when a statue switch is pressed (a second press clears it) | | `VictoryRoad_1F`, `_2F`, `_3F` | `gate` open: one operation per barrier half (2 per barrier, 8 in all). The base and runtime tiles show the barrier as `G` (the base is the blockdata, the open state); the effective map has it closed (the OnLoad script's new-game state) until a boulder has been pushed onto the switch's button. | `story_state` | `VAR_MAP_SCENE_VICTORY_ROAD_*` (a VAR, set to 100 by the switch) | +| `CinnabarIsland_Gym` | `gate` open: one operation per quiz door (6). The blockdata has each door shut, so the base and runtime tiles show its barrier row as `G` and the map's `gates` table names it (`opens_by: quiz_answer`); the effective map has it closed until its flag is set. | `story_state` | `FLAG_CINNABAR_GYM_QUIZ_`, set by the right answer at quiz machine | | `SilphCo_2F` to `SilphCo_11F` | `gate` open: one operation per Card Key door (20 in all). The base and runtime tiles show the door as `G` and the map's `gates` table names it; the effective map has it closed (the OnLoad script's new-game state) until the flag is set. Evidence lists the opening script | `story_state` | `FLAG_SILPH_F_DOOR[_]`, set when the door is opened with the Card Key | ## Gates and story state @@ -49,6 +50,7 @@ infers the gate states itself from the story state it records: | Gate kind | Table entry | Story state a consumer records | Open when | |---|---|---|---| | Silph Co. Card Key door | `{"opens_by": "card_key_face_a", "flag": "FLAG_SILPH_5F_DOOR_1", "new_game": "closed"}` | the set of `FLAG_SILPH_F_DOOR[_]` flags: each is set the moment that door is opened with the Card Key | its flag is set | +| Cinnabar Gym quiz door | `{"opens_by": "quiz_answer", "flag": "FLAG_CINNABAR_GYM_QUIZ_1", "new_game": "closed"}` | the set of `FLAG_CINNABAR_GYM_QUIZ_` flags: each is set by the right answer at quiz machine (or beating its trainer); the gym's OnLoad keeps the door open while it is set | its flag is set | The Mansion's gates belong to one **switch**, `mansion` (the `switches` table: the flag, `toggle`, the four `floors` that share it, and each statue's tile and diff --git a/data/games/frlg/maps/base/CinnabarIsland_Gym.json b/data/games/frlg/maps/base/CinnabarIsland_Gym.json index d1b31f6..06d4f67 100644 --- a/data/games/frlg/maps/base/CinnabarIsland_Gym.json +++ b/data/games/frlg/maps/base/CinnabarIsland_Gym.json @@ -18,21 +18,21 @@ "#.........###........#.......#", "#.........###........#.......#", "#####..##########..#######..##", - "##############################", + "#####GG##########GG#######GG##", "###.......#####......###.....#", "#.........###........#.......#", "#.........###........#.......#", "#.........###........#.......#", "#.........###........#####...#", "#.........#######..#######...#", - "#####..###############.......#", - "###############......#.......#", + "#####..##########GG###.......#", + "#####GG########......#.......#", "###.......###........#.......#", "#.........###........#.......#", "#.........###........#.S...S.#", "#.........###........#.......#", - "#..........#.........#.......#", - "#..........#.........#.......#", + "#..........G.........#.......#", + "#..........G.........#.......#", "##############################" ], "points": {"warp_1": [25, 23]}, @@ -43,6 +43,50 @@ ], "flag_sets": {}, "connections": [], + "gates": { + "door_1": { + "tiles": [[26, 9], [27, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_1" + }, + "door_2": { + "tiles": [[17, 9], [18, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_2" + }, + "door_3": { + "tiles": [[17, 16], [18, 16]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_3" + }, + "door_4": { + "tiles": [[11, 22], [11, 23]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_4" + }, + "door_5": { + "tiles": [[5, 17], [6, 17]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_5" + }, + "door_6": { + "tiles": [[5, 9], [6, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_6" + } + }, "npcs": [ { "name": "poke_maniac", diff --git a/data/games/frlg/maps/overlays/CinnabarIsland_Gym.json b/data/games/frlg/maps/overlays/CinnabarIsland_Gym.json new file mode 100644 index 0000000..2576078 --- /dev/null +++ b/data/games/frlg/maps/overlays/CinnabarIsland_Gym.json @@ -0,0 +1,84 @@ +{ + "format": "pokesim-map-overlay/1", + "map": "CinnabarIsland_Gym", + "operations": [ + { + "op": "gate", + "gate": "door_1", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_1"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 1 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor1 while FLAG_CINNABAR_GYM_QUIZ_1 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 1 (Quiz1Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz1CompleteTrainer)", + "opens_by": "answer quiz machine 1 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + }, + { + "op": "gate", + "gate": "door_2", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_2"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 2 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor2 while FLAG_CINNABAR_GYM_QUIZ_2 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 2 (Quiz2Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz2CompleteTrainer)", + "opens_by": "answer quiz machine 2 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + }, + { + "op": "gate", + "gate": "door_3", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_3"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 3 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor3 while FLAG_CINNABAR_GYM_QUIZ_3 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 3 (Quiz3Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz3CompleteTrainer)", + "opens_by": "answer quiz machine 3 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + }, + { + "op": "gate", + "gate": "door_4", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_4"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 4 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor4 while FLAG_CINNABAR_GYM_QUIZ_4 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 4 (Quiz4Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz4CompleteTrainer)", + "opens_by": "answer quiz machine 4 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + }, + { + "op": "gate", + "gate": "door_5", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_5"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 5 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor5 while FLAG_CINNABAR_GYM_QUIZ_5 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 5 (Quiz5Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz5CompleteTrainer)", + "opens_by": "answer quiz machine 5 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + }, + { + "op": "gate", + "gate": "door_6", + "state": "open", + "why": "story_state", + "when": {"flag": "FLAG_CINNABAR_GYM_QUIZ_6"}, + "evidence": { + "source": "pret/pokefirered@ce6406d8 data/maps/CinnabarIsland_Gym/scripts.inc: the blockdata has door 6 shut; CinnabarIsland_Gym_OnLoad calls CinnabarIsland_Gym_EventScript_OpenDoor6 while FLAG_CINNABAR_GYM_QUIZ_6 is set (and every open script once FLAG_DEFEATED_BLAINE is set); the right answer at quiz machine 6 (Quiz6Correct) runs the same script and sets the flag, and beating the trainer beside the machine does too (Quiz6CompleteTrainer)", + "opens_by": "answer quiz machine 6 right (or beat its trainer); the door stays open, also after a save, by its flag", + "observed": "console B, 2026-11-14 (14.01, 14.02b): the walker held through the open door where the map has it shut; the user approved marking the doors as gates (2026-11-14)" + }, + "status": "candidate" + } + ] +} diff --git a/data/games/frlg/maps/runtime/CinnabarIsland_Gym.json b/data/games/frlg/maps/runtime/CinnabarIsland_Gym.json index d1b31f6..fdc8bde 100644 --- a/data/games/frlg/maps/runtime/CinnabarIsland_Gym.json +++ b/data/games/frlg/maps/runtime/CinnabarIsland_Gym.json @@ -5,7 +5,8 @@ "decomp_file": "data/maps/CinnabarIsland_Gym/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-10-31", - "elevation_omitted": "all reachable land is ground level (3); non-ground tiles are unreachable boundary or counter tiles" + "elevation_omitted": "all reachable land is ground level (3); non-ground tiles are unreachable boundary or counter tiles", + "overlay": {"file": "data/games/frlg/maps/overlays/CinnabarIsland_Gym.json", "story_state": "complete"} }, "allow_running": false, "tiles": [ @@ -18,76 +19,120 @@ "#.........###........#.......#", "#.........###........#.......#", "#####..##########..#######..##", - "##############################", + "#####GG##########GG#######GG##", "###.......#####......###.....#", "#.........###........#.......#", "#.........###........#.......#", "#.........###........#.......#", "#.........###........#####...#", "#.........#######..#######...#", - "#####..###############.......#", - "###############......#.......#", + "#####..##########GG###.......#", + "#####GG########......#.......#", "###.......###........#.......#", "#.........###........#.......#", "#.........###........#.S...S.#", "#.........###........#.......#", - "#..........#.........#.......#", - "#..........#.........#.......#", + "#..........G.........#.......#", + "#..........G.........#.......#", "##############################" ], "points": {"warp_1": [25, 23]}, "warps": [ - {"coord": [24, 23], "enter": "walk_into", "to_map": "CinnabarIsland", "to_point": "warp_1"}, - {"coord": [25, 23], "enter": "walk_south", "to_map": "CinnabarIsland", "to_point": "warp_1"}, - {"coord": [26, 23], "enter": "walk_into", "to_map": "CinnabarIsland", "to_point": "warp_1"} + {"enter": "walk_into", "to_map": "CinnabarIsland", "to_point": "warp_1", "coord": [24, 23]}, + {"enter": "walk_south", "to_map": "CinnabarIsland", "to_point": "warp_1", "coord": [25, 23]}, + {"enter": "walk_into", "to_map": "CinnabarIsland", "to_point": "warp_1", "coord": [26, 23]} ], "flag_sets": {}, "connections": [], + "gates": { + "door_1": { + "tiles": [[26, 9], [27, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_1" + }, + "door_2": { + "tiles": [[17, 9], [18, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_2" + }, + "door_3": { + "tiles": [[17, 16], [18, 16]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_3" + }, + "door_4": { + "tiles": [[11, 22], [11, 23]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_4" + }, + "door_5": { + "tiles": [[5, 17], [6, 17]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_5" + }, + "door_6": { + "tiles": [[5, 9], [6, 9]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "quiz_answer", + "flag": "FLAG_CINNABAR_GYM_QUIZ_6" + } + }, "npcs": [ { "name": "poke_maniac", - "coord": [25, 11], "source_event": 0, "source_script": "CinnabarIsland_Gym_EventScript_Quinn", - "source_local_id": "LOCALID_QUINN" + "source_local_id": "LOCALID_QUINN", + "coord": [25, 11] }, - {"name": "scientist", "coord": [25, 4], "source_event": 1, "source_script": "CinnabarIsland_Gym_EventScript_Erik"}, + {"name": "scientist", "source_event": 1, "source_script": "CinnabarIsland_Gym_EventScript_Erik", "coord": [25, 4]}, { "name": "scientist", - "coord": [17, 5], "source_event": 2, "source_script": "CinnabarIsland_Gym_EventScript_Avery", - "source_local_id": "LOCALID_AVERY" + "source_local_id": "LOCALID_AVERY", + "coord": [17, 5] }, { "name": "poke_maniac", - "coord": [16, 11], "source_event": 3, "source_script": "CinnabarIsland_Gym_EventScript_Ramon", - "source_local_id": "LOCALID_RAMON" + "source_local_id": "LOCALID_RAMON", + "coord": [16, 11] }, { "name": "scientist", - "coord": [16, 18], "source_event": 4, "source_script": "CinnabarIsland_Gym_EventScript_Derek", - "source_local_id": "LOCALID_DEREK" + "source_local_id": "LOCALID_DEREK", + "coord": [16, 18] }, { "name": "poke_maniac", - "coord": [4, 19], "source_event": 5, "source_script": "CinnabarIsland_Gym_EventScript_Dusty", - "source_local_id": "LOCALID_DUSTY" + "source_local_id": "LOCALID_DUSTY", + "coord": [4, 19] }, { "name": "scientist", - "coord": [4, 11], "source_event": 6, "source_script": "CinnabarIsland_Gym_EventScript_Zac", - "source_local_id": "LOCALID_ZAC" + "source_local_id": "LOCALID_ZAC", + "coord": [4, 11] }, - {"name": "blaine", "coord": [5, 4], "source_event": 7, "source_script": "CinnabarIsland_Gym_EventScript_Blaine"}, - {"name": "gym_guy", "coord": [24, 20], "source_event": 8, "source_script": "CinnabarIsland_Gym_EventScript_GymGuy"} + {"name": "blaine", "source_event": 7, "source_script": "CinnabarIsland_Gym_EventScript_Blaine", "coord": [5, 4]}, + {"name": "gym_guy", "source_event": 8, "source_script": "CinnabarIsland_Gym_EventScript_GymGuy", "coord": [24, 20]} ] } diff --git a/data/maps/runtime-manifest.json b/data/maps/runtime-manifest.json index bac7cd4..4fedcf3 100644 --- a/data/maps/runtime-manifest.json +++ b/data/maps/runtime-manifest.json @@ -851,12 +851,16 @@ { "name": "CinnabarIsland_Gym", "file": "data/games/frlg/maps/runtime/CinnabarIsland_Gym.json", - "sha256": "42c2a70ae464043641ad3a7a79e0ab73c6b0d7dc09190137dd886f0e2630d4b7", + "sha256": "e0a1ed2a853309c167aade668e663f8fc5ac37bd45ea546148fdedeb5b28738a", "source": { "decomp_file": "data/maps/CinnabarIsland_Gym/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-10-31", - "elevation_omitted": "all reachable land is ground level (3); non-ground tiles are unreachable boundary or counter tiles" + "elevation_omitted": "all reachable land is ground level (3); non-ground tiles are unreachable boundary or counter tiles", + "overlay": { + "file": "data/games/frlg/maps/overlays/CinnabarIsland_Gym.json", + "story_state": "complete" + } }, "target_game": "frlg", "source_game": "firered", @@ -880,7 +884,11 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/CinnabarIsland_Gym.json", - "sha256": "42c2a70ae464043641ad3a7a79e0ab73c6b0d7dc09190137dd886f0e2630d4b7" + "sha256": "a99a5ac62c8d06e941ea39fa9bb90867998034861d792a8e6032642156f1244a" + }, + "overlay": { + "file": "data/games/frlg/maps/overlays/CinnabarIsland_Gym.json", + "sha256": "f3bd565f3a5419a066911f39411e49301d4d82e89c50a53ffa4d17f0f761669f" } }, { diff --git a/docs/maps/runtime-maps.md b/docs/maps/runtime-maps.md index 9004281..f263900 100644 --- a/docs/maps/runtime-maps.md +++ b/docs/maps/runtime-maps.md @@ -64,7 +64,7 @@ and navigation fields and preserves unknown extensions. | `npcs`, `items`, `signs`, `interactables` | Typed arrays of `name,coord` (identified pickups may derive `name` from `source_event` and default `quantity` to 1), optional facing, inclusive `wander` box (`min`, `max`), trainer sight/looks and hide flag. Section supplies kind; non-item interactions use `interactables` when enriched. | | `triggers`, `flag_sets` | Named story trigger boxes/conditions; named sets of game flags. Preserve game semantics. | | `coord_events` | BDSP extension: named `coord,width,length,var,value,source` scene triggers. | -| `gates`, `switches` | FRLG story barriers. `gates`: id -> `tiles`, `open_glyph` (`.` or `~`), `new_game` (`open`/`closed`) and what moves it: a Card Key door has `opens_by: card_key_face_a` and `flag`; a switch gate has `switch` (id in `switches`) and `open_when` (`on`/`off`). `switches`: id -> shared `flag`, `toggle`, `floors` (maps that share the state), `statues` (`coord`, `face_from`, `facing`). A Strength-button switch (Victory Road) has `toggle: false`, a `VAR_` as `flag`, `set_value`, `pressed_by: strength_boulder` and `buttons` (`coord`, tile `B`); `open_glyph` may also be `2/4/6/8`. See the FRLG map README. | +| `gates`, `switches` | FRLG story barriers. `gates`: id -> `tiles`, `open_glyph` (`.` or `~`), `new_game` (`open`/`closed`) and what moves it: a Card Key door has `opens_by: card_key_face_a` and `flag`, a Cinnabar Gym quiz door `opens_by: quiz_answer` and `flag` (opened only by the story, never by a press); a switch gate has `switch` (id in `switches`) and `open_when` (`on`/`off`). `switches`: id -> shared `flag`, `toggle`, `floors` (maps that share the state), `statues` (`coord`, `face_from`, `facing`). A Strength-button switch (Victory Road) has `toggle: false`, a `VAR_` as `flag`, `set_value`, `pressed_by: strength_boulder` and `buttons` (`coord`, tile `B`); `open_glyph` may also be `2/4/6/8`. See the FRLG map README. | | `patches` | Ordered `coord,glyph,measured_by` overrides, applied by the loader over raw tiles. | Tiles: `#` blocked, `.` open, `~` encounter terrain (including cave floor), diff --git a/schemas/runtime-map-v2.schema.json b/schemas/runtime-map-v2.schema.json index c659552..38c2e8a 100644 --- a/schemas/runtime-map-v2.schema.json +++ b/schemas/runtime-map-v2.schema.json @@ -149,7 +149,7 @@ "tiles": {"type": "array", "items": {"$ref": "#/$defs/coord"}, "minItems": 1}, "open_glyph": {"enum": [".", "~", "2", "4", "6", "8"]}, "new_game": {"enum": ["open", "closed"]}, - "opens_by": {"enum": ["card_key_face_a"]}, + "opens_by": {"enum": ["card_key_face_a", "quiz_answer"]}, "flag": {"type": "string", "pattern": "^FLAG_[A-Z0-9_]+$"}, "switch": {"type": "string", "minLength": 1}, "open_when": {"enum": ["on", "off"]} diff --git a/src/pokesim/maps/frlg_decomp_map_builder.py b/src/pokesim/maps/frlg_decomp_map_builder.py index 394dc03..e068b4a 100644 --- a/src/pokesim/maps/frlg_decomp_map_builder.py +++ b/src/pokesim/maps/frlg_decomp_map_builder.py @@ -420,6 +420,49 @@ def victory_road_gates(scripts, source, name, tiles): return gates, switches +# Cinnabar Gym's quiz doors. The blockdata has every door shut; the map's +# OnLoad opens each one whose quiz flag is set (`call_if_set +# FLAG_CINNABAR_GYM_QUIZ_, CinnabarIsland_Gym_OnLoadOpenDoor`, which +# calls CinnabarIsland_Gym_EventScript_OpenDoor), and a right answer at +# quiz machine runs the same script and sets the flag. A new game has +# every flag unset, so every door is shut in the base. A door is a gate +# (glyph `G`): its tiles are those the open script makes passable +# (collision 0) that are walls in the blockdata; it opens to floor (`.`). +QUIZ_DOOR_MAP = 'CinnabarIsland_Gym' +CALL_IF_SET = re.compile(r'\s*call_if_set\s+(FLAG_\w+),\s*(\w+)\s*$') +CALL = re.compile(r'\s*call\s+(\w+)\s*$') + + +def quiz_door_gates(scripts, name, tiles): + """The `gates` table of Cinnabar Gym from its scripts.inc text and the + blockdata rows `tiles` (every door shut): `door_` for quiz , opened + by the right answer (`opens_by: quiz_answer`) and kept open by its flag. + Raises if a door's open script opens no wall or opens it to other than + floor.""" + blocks = script_blocks(scripts) + gates = {} + for line in blocks[f'{name}_OnLoad']: + match = CALL_IF_SET.match(line) + if not match or not match.group(1).startswith('FLAG_CINNABAR_GYM_QUIZ_'): + continue + flag, on_load = match.groups() + opens = [m.group(1) for m in map(CALL.match, blocks[on_load]) if m] + if len(opens) != 1: + raise ValueError(f'{name}: {on_load} calls {opens}, not one open script') + group = [] + for x, y, label, collision in metatile_calls(blocks[opens[0]]): + if collision == 0 and tiles[y][x] == '#': + if 'Floor' not in label: + raise ValueError(f'{name} ({x}, {y}): {opens[0]} opens a wall to {label}, not floor') + group.append([x, y]) + if not group: + raise ValueError(f'{name}: {opens[0]} opens no wall') + gates['door_' + flag[len('FLAG_CINNABAR_GYM_QUIZ_'):]] = { + 'tiles': sorted(group), 'open_glyph': '.', 'new_game': 'closed', + 'opens_by': 'quiz_answer', 'flag': flag} + return gates + + class Decomp: def __init__(self, commit, cache): self.commit = commit @@ -985,6 +1028,8 @@ def map_json(decomp, name, sources, layouts, names, loaded, unhandled, land_maps switches = mansion_switches(source) if name in VICTORY_ROAD_FLOORS: gates, switches = victory_road_gates(decomp.read(f'data/maps/{name}/scripts.inc').decode(), source, name, open_tiles) + if name == QUIZ_DOOR_MAP: + gates = quiz_door_gates(decomp.read(f'data/maps/{name}/scripts.inc').decode(), name, open_tiles) tiles = set_tiles(open_tiles, [tuple(c) for gate in gates.values() for c in gate['tiles']], GATE_GLYPH) warp_events = source.get('warp_events', []) points = {n: [x, y] for n, (x, y) in POINTS.get(name, {}).items()} diff --git a/src/pokesim/maps/runtime_map_schema.py b/src/pokesim/maps/runtime_map_schema.py index a20fc4a..95b048b 100644 --- a/src/pokesim/maps/runtime_map_schema.py +++ b/src/pokesim/maps/runtime_map_schema.py @@ -102,8 +102,9 @@ def tile(x, y): claimed[(x, y)] = gate_id require(rows[y][x] in ('G', '#', gate['open_glyph']), f'gate {gate_id}: tile {(x, y)} is {rows[y][x]!r}') if 'flag' in gate: - require(gate.get('opens_by') == 'card_key_face_a' and gate['new_game'] == 'closed' - and 'switch' not in gate and 'open_when' not in gate, f'gate {gate_id}: a flag gate opens by Card Key and starts closed') + require(gate.get('opens_by') in ('card_key_face_a', 'quiz_answer') and gate['new_game'] == 'closed' + and 'switch' not in gate and 'open_when' not in gate, + f'gate {gate_id}: a flag gate opens by Card Key or a quiz answer and starts closed') else: require(gate.get('switch') in switches, f'gate {gate_id}: unknown switch {gate.get("switch")!r}') require(gate.get('open_when') in ('on', 'off') and 'opens_by' not in gate, f'gate {gate_id}: open_when') diff --git a/src/pokesim/maps/test_frlg_decomp_map_builder.py b/src/pokesim/maps/test_frlg_decomp_map_builder.py index 9fb53c2..2916069 100644 --- a/src/pokesim/maps/test_frlg_decomp_map_builder.py +++ b/src/pokesim/maps/test_frlg_decomp_map_builder.py @@ -330,6 +330,36 @@ def test_the_switch_must_open_what_onload_closes(self): frlg_maps.victory_road_gates(scripts, self.SOURCE, 'VictoryRoad_2F', ['..8', 'B.~']) +class QuizDoorTest(unittest.TestCase): + # A door whose top wall edge (x=1..2, y=0) is floor in the blockdata and + # whose barrier (y=1) is wall; the open script redraws both and the floor below. + SCRIPTS = ( + 'CinnabarIsland_Gym_OnLoad::\n' + '\tgoto_if_set FLAG_DEFEATED_BLAINE, CinnabarIsland_Gym_OnLoadOpenAllDoors\n' + '\tcall_if_set FLAG_CINNABAR_GYM_QUIZ_1, CinnabarIsland_Gym_OnLoadOpenDoor1\n' + '\tend\n' + '\nCinnabarIsland_Gym_OnLoadOpenDoor1::\n' + '\tcall CinnabarIsland_Gym_EventScript_OpenDoor1\n' + '\treturn\n' + '\nCinnabarIsland_Gym_EventScript_OpenDoor1::\n' + '\tsetmetatile 1, 0, METATILE_CinnabarGym_Floor_WallLeftCorner, 0\n' + '\tsetmetatile 1, 1, METATILE_CinnabarGym_Floor_WallLeftEdge, 0\n' + '\tsetmetatile 2, 1, METATILE_CinnabarGym_Floor_WallRightEdge, 0\n' + '\tsetmetatile 3, 1, METATILE_CinnabarGym_Wall_RetractedBarrier, 1\n' + '\tsetmetatile 1, 2, METATILE_CinnabarGym_Floor, 0\n' + '\treturn\n') + + def test_a_door_is_a_gate_of_the_walls_its_answer_opens(self): + gates = frlg_maps.quiz_door_gates(self.SCRIPTS, 'CinnabarIsland_Gym', ['....', '####', '....']) + self.assertEqual(gates, {'door_1': { + 'tiles': [[1, 1], [2, 1]], 'open_glyph': '.', 'new_game': 'closed', + 'opens_by': 'quiz_answer', 'flag': 'FLAG_CINNABAR_GYM_QUIZ_1'}}) + + def test_a_door_that_opens_no_wall_is_an_error(self): + with self.assertRaisesRegex(ValueError, 'opens no wall'): + frlg_maps.quiz_door_gates(self.SCRIPTS, 'CinnabarIsland_Gym', ['....', '....', '....']) + + class EncounterTest(unittest.TestCase): # MtMoon_1F's cave floor: behavior MB_CAVE (0x08), encounter type LAND. CAVE_FLOOR = 0x08 | (frlg_maps.TILE_ENCOUNTER_LAND << frlg_maps.ENCOUNTER_TYPE_SHIFT) From cc6a7780444a5ac9f8e144ffa7a960da18ef9b4e Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 14 Nov 2026 14:04:00 -0800 Subject: [PATCH 2/2] FRLG maps: cut trees are gates A cut tree is an object on open ground. AutoStory plans saw it only as something standing on a floor tile, so after a Cut the planner still routed around a tree that was gone, and the plans stepped over the cut tile by hand (Celadon Gym's inner tree, 14.04b). The generator now makes every cut_tree object's tile a gate (`G`, `cut_tree__`, `opens_by: cut`, the tree's hide flag), opening to the ground under it. The hide flag is FLAG_TEMP_*, cleared on every warp, so a consumer closes the gate again when the player leaves the map. The object stays in `npcs`. The publication test undoes these gates before digesting. Also reformats runtime-map-v2.schema.json (contracts check). --- data/games/frlg/maps/README.md | 1 + data/games/frlg/maps/base/CeladonCity.json | 20 +++++- .../games/frlg/maps/base/CeladonCity_Gym.json | 29 ++++++++- data/games/frlg/maps/base/CeruleanCity.json | 11 +++- data/games/frlg/maps/base/FuchsiaCity.json | 38 +++++++++-- data/games/frlg/maps/base/PewterCity.json | 11 +++- data/games/frlg/maps/base/Route10.json | 38 +++++++++-- data/games/frlg/maps/base/Route12.json | 20 +++++- data/games/frlg/maps/base/Route13.json | 11 +++- data/games/frlg/maps/base/Route14.json | 29 ++++++++- data/games/frlg/maps/base/Route16.json | 11 +++- data/games/frlg/maps/base/Route2.json | 38 +++++++++-- data/games/frlg/maps/base/Route25.json | 11 +++- data/games/frlg/maps/base/Route8.json | 20 +++++- data/games/frlg/maps/base/Route9.json | 11 +++- data/games/frlg/maps/base/VermilionCity.json | 11 +++- data/games/frlg/maps/base/ViridianCity.json | 20 +++++- data/games/frlg/maps/runtime/CeladonCity.json | 20 +++++- .../frlg/maps/runtime/CeladonCity_Gym.json | 29 ++++++++- .../games/frlg/maps/runtime/CeruleanCity.json | 11 +++- data/games/frlg/maps/runtime/FuchsiaCity.json | 38 +++++++++-- data/games/frlg/maps/runtime/PewterCity.json | 11 +++- data/games/frlg/maps/runtime/Route10.json | 38 +++++++++-- data/games/frlg/maps/runtime/Route12.json | 20 +++++- data/games/frlg/maps/runtime/Route13.json | 11 +++- data/games/frlg/maps/runtime/Route14.json | 29 ++++++++- data/games/frlg/maps/runtime/Route16.json | 11 +++- data/games/frlg/maps/runtime/Route2.json | 38 +++++++++-- data/games/frlg/maps/runtime/Route25.json | 11 +++- data/games/frlg/maps/runtime/Route8.json | 20 +++++- data/games/frlg/maps/runtime/Route9.json | 11 +++- .../frlg/maps/runtime/VermilionCity.json | 11 +++- .../games/frlg/maps/runtime/ViridianCity.json | 20 +++++- data/maps/runtime-manifest.json | 64 +++++++++---------- docs/maps/runtime-maps.md | 2 +- schemas/runtime-map-v2.schema.json | 8 +-- src/pokesim/maps/frlg_decomp_map_builder.py | 29 +++++++++ src/pokesim/maps/runtime_map_schema.py | 4 +- .../maps/test_frlg_decomp_map_builder.py | 17 +++++ .../maps/test_runtime_map_publication.py | 15 +++++ 40 files changed, 691 insertions(+), 107 deletions(-) diff --git a/data/games/frlg/maps/README.md b/data/games/frlg/maps/README.md index e89498c..9ca7744 100644 --- a/data/games/frlg/maps/README.md +++ b/data/games/frlg/maps/README.md @@ -51,6 +51,7 @@ infers the gate states itself from the story state it records: |---|---|---|---| | Silph Co. Card Key door | `{"opens_by": "card_key_face_a", "flag": "FLAG_SILPH_5F_DOOR_1", "new_game": "closed"}` | the set of `FLAG_SILPH_F_DOOR[_]` flags: each is set the moment that door is opened with the Card Key | its flag is set | | Cinnabar Gym quiz door | `{"opens_by": "quiz_answer", "flag": "FLAG_CINNABAR_GYM_QUIZ_1", "new_game": "closed"}` | the set of `FLAG_CINNABAR_GYM_QUIZ_` flags: each is set by the right answer at quiz machine (or beating its trainer); the gym's OnLoad keeps the door open while it is set | its flag is set | +| Cut tree | `{"opens_by": "cut", "flag": "FLAG_TEMP_13", "new_game": "closed"}`, id `cut_tree__`, one tile; the tree object stays in `npcs` | the tree cut: Cut sets its hide flag, a temporary flag that every warp clears, so the tree grows back once the player leaves the map (a save keeps it cut) | it was cut since the last warp | The Mansion's gates belong to one **switch**, `mansion` (the `switches` table: the flag, `toggle`, the four `floors` that share it, and each statue's tile and diff --git a/data/games/frlg/maps/base/CeladonCity.json b/data/games/frlg/maps/base/CeladonCity.json index 2ecf040..38cb993 100644 --- a/data/games/frlg/maps/base/CeladonCity.json +++ b/data/games/frlg/maps/base/CeladonCity.json @@ -41,7 +41,7 @@ "####........###........#......###########...################", "####........###........#......#########D#...##########..####", "####...................#wwwwww####D####.#...##########..####", - ".......................#wwwwww#.........................####", + ".......................#wwwwww#.....................G...####", ".......................#wwwwww###S####S##...#S########..####", "....................................................##..####", "########............................................##..####", @@ -54,7 +54,7 @@ "####................####................................####", "####vvvvvv..vvvvvvvv####................................####", "####................####################.##########.....####", - "####....................################.##########.....####", + "####....................################G##########.....####", "####......................................##..........######", "####......................................##################", "############################################################", @@ -135,6 +135,22 @@ {"side": "west", "to_map": "Route16", "offset": 10}, {"side": "east", "to_map": "Route7", "offset": 10} ], + "gates": { + "cut_tree_52_22": { + "tiles": [[52, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_40_35": { + "tiles": [[40, 35]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [55, 20], diff --git a/data/games/frlg/maps/base/CeladonCity_Gym.json b/data/games/frlg/maps/base/CeladonCity_Gym.json index ca39cb5..8ef6d56 100644 --- a/data/games/frlg/maps/base/CeladonCity_Gym.json +++ b/data/games/frlg/maps/base/CeladonCity_Gym.json @@ -14,10 +14,10 @@ "#...........#", "#..#######..#", "##.##....#.##", - "#........#..#", - "#..#........#", + "#..G.....#..#", + "#..#.....G..#", "#..#.....#..#", - "#..###.###..#", + "#..###G###..#", "#..##...##..#", "#..........##", "##..........#", @@ -38,6 +38,29 @@ ], "flag_sets": {}, "connections": [], + "gates": { + "cut_tree_6_8": { + "tiles": [[6, 8]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_3_5": { + "tiles": [[3, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_9_6": { + "tiles": [[9, 6]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + } + }, "npcs": [ { "name": "lass", diff --git a/data/games/frlg/maps/base/CeruleanCity.json b/data/games/frlg/maps/base/CeruleanCity.json index e13aa82..f70555b 100644 --- a/data/games/frlg/maps/base/CeruleanCity.json +++ b/data/games/frlg/maps/base/CeruleanCity.json @@ -39,7 +39,7 @@ "#######...............................#..#######", "#######...............................#..#######", "#######...............................#..#######", - "###################S######.############..#######", + "###################S######G############..#######", "#######..................................#######", "#######..................................#######", "###############....#........#....###############", @@ -129,6 +129,15 @@ {"side": "west", "to_map": "Route4", "offset": 10}, {"side": "east", "to_map": "Route9", "offset": 10} ], + "gates": { + "cut_tree_26_32": { + "tiles": [[26, 32]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [18, 7], diff --git a/data/games/frlg/maps/base/FuchsiaCity.json b/data/games/frlg/maps/base/FuchsiaCity.json index 0f6b240..d96336b 100644 --- a/data/games/frlg/maps/base/FuchsiaCity.json +++ b/data/games/frlg/maps/base/FuchsiaCity.json @@ -17,19 +17,19 @@ "##...##############..#S...###..#############..##", "##...#wwwww##.....#............#....##.....#..##", "##...#wwwww##.....#............#....##.....#..##", - "##...##############....#######.#############..##", + "##...##############....#######G#############..##", "##....................#.......................##", "##....................#.......................##", - "##.......############.#...######.#########....##", + "##.......############G#...######.#########....##", "##.......####.............######.#.......#....##", "##.......SSD#............#######.#.......#....##", - "##.......................###D###.#########....##", + "##.......................###D###G#########....##", "########.................#....................##", ".......###########.......#S...#S..............##", ".......##wwwwwww#........#......################", ".......##wwwwwww#........#......................", "##.....##########........#......................", - "##.....#################.#......................", + "##.....#################G#......................", "##.............................############.....", "##.............................#...wwwwwww#...##", "##.............................#...wwwwwww#..###", @@ -121,6 +121,36 @@ {"side": "west", "to_map": "Route18", "offset": 10}, {"side": "east", "to_map": "Route15", "offset": 10} ], + "gates": { + "cut_tree_30_10": { + "tiles": [[30, 10]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_21_13": { + "tiles": [[21, 13]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_32_16": { + "tiles": [[32, 16]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_24_22": { + "tiles": [[24, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + } + }, "hidden_items": [ { "coord": [33, 26], diff --git a/data/games/frlg/maps/base/PewterCity.json b/data/games/frlg/maps/base/PewterCity.json index 2992faa..f1782b7 100644 --- a/data/games/frlg/maps/base/PewterCity.json +++ b/data/games/frlg/maps/base/PewterCity.json @@ -13,7 +13,7 @@ "####........#################.........##########", "####........#################.........##########", "####........#############D######......##########", - "####........###########...............##########", + "####........###########.......G.......##########", "#######.....#####.#####..#######........########", "####vvv..vvvvvvv...Svvvvvvvvvvvvvvvvv...########", "####....................................########", @@ -73,6 +73,15 @@ {"side": "south", "to_map": "Route2", "offset": 12}, {"side": "east", "to_map": "Route3", "offset": 10} ], + "gates": { + "cut_tree_30_5": { + "tiles": [[30, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [6, 3], diff --git a/data/games/frlg/maps/base/Route10.json b/data/games/frlg/maps/base/Route10.json index 198801e..14b1d80 100644 --- a/data/games/frlg/maps/base/Route10.json +++ b/data/games/frlg/maps/base/Route10.json @@ -27,13 +27,13 @@ "################..#www##", "################..#www##", "########.#######..#www##", - "##.........SSD##..#www##", + "##........GSSD##..#www##", "##..###S##........#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", "##................#www##", "##................#www##", @@ -183,6 +183,36 @@ {"side": "south", "to_map": "LavenderTown", "offset": 0}, {"side": "west", "to_map": "Route9", "offset": 0} ], + "gates": { + "cut_tree_10_20": { + "tiles": [[10, 20]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_10_22": { + "tiles": [[10, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_10_24": { + "tiles": [[10, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_10_26": { + "tiles": [[10, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + } + }, "hidden_items": [ { "coord": [10, 19], diff --git a/data/games/frlg/maps/base/Route12.json b/data/games/frlg/maps/base/Route12.json index 7294bf5..314f01d 100644 --- a/data/games/frlg/maps/base/Route12.json +++ b/data/games/frlg/maps/base/Route12.json @@ -119,7 +119,7 @@ "########wwwwww..www##www", "############ww..wwww##ww", "########...#ww..wwww##ww", - "########........wwww##ww", + "########...G....wwww##ww", "########..#.....wwww##ww", "##########..ww......ww##", "########....ww......ww##", @@ -130,7 +130,7 @@ "########wwwwwwwwww..ww##", "########wwwwwwwwww..ww##", "##############......ww##", - "########............ww##", + "########....G.......ww##", "########~~~~##ww..wwww##", "########~~~~##ww..wwww##", "########~~~~##ww..www##w", @@ -275,6 +275,22 @@ {"side": "south", "to_map": "Route13", "offset": -48}, {"side": "west", "to_map": "Route11", "offset": 60} ], + "gates": { + "cut_tree_11_100": { + "tiles": [[11, 100]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_12_111": { + "tiles": [[12, 111]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [18, 57], diff --git a/data/games/frlg/maps/base/Route13.json b/data/games/frlg/maps/base/Route13.json index 79f676e..4ed4c6d 100644 --- a/data/games/frlg/maps/base/Route13.json +++ b/data/games/frlg/maps/base/Route13.json @@ -12,7 +12,7 @@ "##############################################################..wwww##ww", "##############################################################..wwww##ww", "##############################################################..www##www", - "..................................#..............~~~~~~~~~~.##..www##www", + "..................................#.........G....~~~~~~~~~~.##..www##www", "################......#########...#..S######.....~~~~~~~~~~.##..www##www", "......................#.....................####.~~~~~~~~~~.##..www##www", "#############...#######..#################..####.~~~~~~~~~~.##..wwww##ww", @@ -57,6 +57,15 @@ {"side": "north", "to_map": "Route12", "offset": 48}, {"side": "west", "to_map": "Route14", "offset": 0} ], + "gates": { + "cut_tree_44_5": { + "tiles": [[44, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [23, 14], "item": "pp_up", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE13_PP_UP", "source_bg_event": 3} ], diff --git a/data/games/frlg/maps/base/Route14.json b/data/games/frlg/maps/base/Route14.json index 3b10d29..6a1f1e3 100644 --- a/data/games/frlg/maps/base/Route14.json +++ b/data/games/frlg/maps/base/Route14.json @@ -33,7 +33,7 @@ "#######~~~~~##...#wwwwww", "#######~~~~~##...#wwwwww", "#######.....##...#wwwwww", - "#######.vvvv##...#wwwwww", + "#######Gvvvv##...#wwwwww", "#######.....##...#wwwwww", "#######.....##...#wwwwww", "#######.....##...#wwwwww", @@ -42,7 +42,7 @@ "#######.....##.......#ww", "#######.....##.......#ww", "#######.....##.......#ww", - "#######..............#ww", + "#######.....G........#ww", "#######.....##.......#ww", "#######.....##.......#ww", "#######.....##.......#ww", @@ -54,7 +54,7 @@ "#######.....##.......#ww", "##..........##.......#ww", "##...................#ww", - ".....................#ww", + ".G...................#ww", ".>...................#ww", "v#...................#ww", ".....................#ww", @@ -137,6 +137,29 @@ {"side": "west", "to_map": "Route15", "offset": 40}, {"side": "east", "to_map": "Route13", "offset": 0} ], + "gates": { + "cut_tree_7_26": { + "tiles": [[7, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_12_35": { + "tiles": [[12, 35]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_1_47": { + "tiles": [[1, 47]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + } + }, "hidden_items": [ {"coord": [9, 20], "item": "zinc", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE14_ZINC", "source_bg_event": 1}, { diff --git a/data/games/frlg/maps/base/Route16.json b/data/games/frlg/maps/base/Route16.json index ba778b5..15e4ab0 100644 --- a/data/games/frlg/maps/base/Route16.json +++ b/data/games/frlg/maps/base/Route16.json @@ -18,7 +18,7 @@ "w#...................######...............######", "w#...................######...............######", "w#############################............######", - "w#...................######..####S#######.######", + "w#...................######..####S#######G######", "w#...................######...###...............", "w#...................#....#.....................", "w#...................######...###...............", @@ -63,6 +63,15 @@ {"side": "south", "to_map": "Route17", "offset": 0}, {"side": "east", "to_map": "CeladonCity", "offset": -10} ], + "gates": { + "cut_tree_41_11": { + "tiles": [[41, 11]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [31, 13], diff --git a/data/games/frlg/maps/base/Route2.json b/data/games/frlg/maps/base/Route2.json index 7b34b3c..5421a3c 100644 --- a/data/games/frlg/maps/base/Route2.json +++ b/data/games/frlg/maps/base/Route2.json @@ -33,7 +33,7 @@ "##..........#########.##", "##..........#####.###.##", "##..........#.S.......##", - "####....###.#.........##", + "####....###G#.........##", "###########...........##", "##########............##", "##############........##", @@ -46,7 +46,7 @@ "##############........##", "################......##", "################......##", - "##################.#####", + "##################G#####", "################......##", "################......##", "################......##", @@ -82,14 +82,14 @@ "##....~~~~~~~.##......##", "##....~~~~~~~.##......##", "##............##......##", - "##....................##", + "##..............G.....##", "##....##########......##", "##....##########......##", "##....##########......##", "##....##########......##", "##............##......##", "##............##......##", - "##....................##", + "##.............G......##", "##vvvvvvv..vvv..vv.vvv##", "##............##......##", "####..........##......##", @@ -126,6 +126,36 @@ {"side": "north", "to_map": "PewterCity", "offset": -12}, {"side": "south", "to_map": "ViridianCity", "offset": -12} ], + "gates": { + "cut_tree_16_62": { + "tiles": [[16, 62]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_15_69": { + "tiles": [[15, 69]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_11_13": { + "tiles": [[11, 13]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + }, + "cut_tree_18_26": { + "tiles": [[18, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_16" + } + }, "npcs": [ { "name": "cut_tree", diff --git a/data/games/frlg/maps/base/Route25.json b/data/games/frlg/maps/base/Route25.json index 65d7b04..201e09a 100644 --- a/data/games/frlg/maps/base/Route25.json +++ b/data/games/frlg/maps/base/Route25.json @@ -22,7 +22,7 @@ "########################################################################", "########################################################################", "############...#...#.....#.....#..........##############################", - ".~~~~~~~~......#...#.....#.....#..........####################wwww######", + ".~~~~~~~~......#...#.....#....G#..........####################wwww######", ".~~~~~~~~................###.#............######S##D##########wwww######", "................#.#.#....#...#.....#.........................#wwww######", "vvvvvvvvvv##..##....#.##.#.........#.........................#wwwww#####", @@ -66,6 +66,15 @@ "warps": [{"coord": [51, 4], "enter": "walk_into", "to_map": "Route25_SeaCottage", "to_point": "warp_1"}], "flag_sets": {}, "connections": [{"side": "west", "to_map": "Route24", "offset": 0}], + "gates": { + "cut_tree_30_3": { + "tiles": [[30, 3]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [14, 2], "item": "elixir", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE25_ELIXIR", "source_bg_event": 1}, {"coord": [58, 6], "item": "ether", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE25_ETHER", "source_bg_event": 2}, diff --git a/data/games/frlg/maps/base/Route8.json b/data/games/frlg/maps/base/Route8.json index 4ce2f81..2e5ad26 100644 --- a/data/games/frlg/maps/base/Route8.json +++ b/data/games/frlg/maps/base/Route8.json @@ -20,10 +20,10 @@ ".######............#vvvvv#.......##.~~.~~.~~..##........######..........", ".######............#.....#.......#...~~~~~.~~..#........######..........", ".######............#.............#..~~.~.~~.~..#........######..........", - "########...........#.............#..~~~~~~~~~~..........######......####", + "########...........#.............#..~~~~~~~~~~.G........######......####", "....########.......#######.......#.~.~.~.~.~~~.#........######......####", "############.....................#.~~~~~~~~.~..#....................####", - "############........................~.~.~~.~.~.#....................####", + "############.....................G..~.~.~~.~.~.#....................####", "############.....................#.~.~~~.~~~~~.#....................####", "############.....................#....~.~~..~..#....................####", "############.....................#.....~.......#....................####", @@ -39,6 +39,22 @@ {"side": "west", "to_map": "SaffronCity_Connection", "offset": -10}, {"side": "east", "to_map": "LavenderTown", "offset": 0} ], + "gates": { + "cut_tree_33_15": { + "tiles": [[33, 15]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_47_12": { + "tiles": [[47, 12]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [42, 10], diff --git a/data/games/frlg/maps/base/Route9.json b/data/games/frlg/maps/base/Route9.json index 0f8d796..54e99d2 100644 --- a/data/games/frlg/maps/base/Route9.json +++ b/data/games/frlg/maps/base/Route9.json @@ -28,7 +28,7 @@ "#######~~~~~~~~~~~#####.......######......######..........#####..#######", "......#...........#####.......######......................#####..#######", "#######vvvvvvvv#..#####......S###########.................#####..#######", - "...............########.............#####....#####...##########.........", + "..G............########.............#####....#####...##########.........", "..#............########.............#####....#####...#####..............", "###########....########vvvvvvvvvvv..#####....#####...#####..............", "....#######vvvv########.............#####vvvv#####vv.#####...#####...###", @@ -48,6 +48,15 @@ {"side": "west", "to_map": "CeruleanCity", "offset": -10}, {"side": "east", "to_map": "Route10", "offset": 0} ], + "gates": { + "cut_tree_2_8": { + "tiles": [[2, 8]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [15, 7], "item": "ether", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE9_ETHER", "source_bg_event": 1}, { diff --git a/data/games/frlg/maps/base/VermilionCity.json b/data/games/frlg/maps/base/VermilionCity.json index f7b0789..ed68195 100644 --- a/data/games/frlg/maps/base/VermilionCity.json +++ b/data/games/frlg/maps/base/VermilionCity.json @@ -31,7 +31,7 @@ "ww##wwww.......................www.....wwwwwwwww", "ww##wwww...#######.........####www.....wwwwwwwww", "www##www...#######..wwww...####www64.64wwwwwwwww", - "www##www##S########.wwww...#D##www.....ww#######", + "www##www##S########Gwwww...#D##www.....ww#######", "www##www.....#D#....wwww.......wwww...www#######", "www##www............wwwwwwwwwwwwwww...www#######", "ww##wwww............wwwwwwwwwwwwwww...www#######", @@ -119,6 +119,15 @@ {"side": "north", "to_map": "Route6", "offset": 12}, {"side": "east", "to_map": "Route11", "offset": 10} ], + "gates": { + "cut_tree_19_24": { + "tiles": [[19, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [14, 11], diff --git a/data/games/frlg/maps/base/ViridianCity.json b/data/games/frlg/maps/base/ViridianCity.json index 01c9081..16f9e3b 100644 --- a/data/games/frlg/maps/base/ViridianCity.json +++ b/data/games/frlg/maps/base/ViridianCity.json @@ -24,7 +24,7 @@ "###################.....########################", "###################.....########################", "###################.....####..............######", - "########..................................######", + "########..........G.......................######", "########.##########.......................######", "########.###########.............######...######", "########.##########..............######...######", @@ -43,7 +43,7 @@ "#######...................................######", "#######...................................######", "###########.............#####.............######", - "###########.##..........#####.............######", + "###########G##..........#####.............######", "#######.....##..........#####.............######", "#######....wwwwww.......SSD##.............######", "#######....wwwwww.........................######", @@ -116,6 +116,22 @@ {"side": "south", "to_map": "Route1", "offset": 12}, {"side": "west", "to_map": "Route22", "offset": 10} ], + "gates": { + "cut_tree_11_24": { + "tiles": [[11, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_11" + }, + "cut_tree_18_5": { + "tiles": [[18, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "npcs": [ { "name": "fat_man", diff --git a/data/games/frlg/maps/runtime/CeladonCity.json b/data/games/frlg/maps/runtime/CeladonCity.json index 2ecf040..38cb993 100644 --- a/data/games/frlg/maps/runtime/CeladonCity.json +++ b/data/games/frlg/maps/runtime/CeladonCity.json @@ -41,7 +41,7 @@ "####........###........#......###########...################", "####........###........#......#########D#...##########..####", "####...................#wwwwww####D####.#...##########..####", - ".......................#wwwwww#.........................####", + ".......................#wwwwww#.....................G...####", ".......................#wwwwww###S####S##...#S########..####", "....................................................##..####", "########............................................##..####", @@ -54,7 +54,7 @@ "####................####................................####", "####vvvvvv..vvvvvvvv####................................####", "####................####################.##########.....####", - "####....................################.##########.....####", + "####....................################G##########.....####", "####......................................##..........######", "####......................................##################", "############################################################", @@ -135,6 +135,22 @@ {"side": "west", "to_map": "Route16", "offset": 10}, {"side": "east", "to_map": "Route7", "offset": 10} ], + "gates": { + "cut_tree_52_22": { + "tiles": [[52, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_40_35": { + "tiles": [[40, 35]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [55, 20], diff --git a/data/games/frlg/maps/runtime/CeladonCity_Gym.json b/data/games/frlg/maps/runtime/CeladonCity_Gym.json index ca39cb5..8ef6d56 100644 --- a/data/games/frlg/maps/runtime/CeladonCity_Gym.json +++ b/data/games/frlg/maps/runtime/CeladonCity_Gym.json @@ -14,10 +14,10 @@ "#...........#", "#..#######..#", "##.##....#.##", - "#........#..#", - "#..#........#", + "#..G.....#..#", + "#..#.....G..#", "#..#.....#..#", - "#..###.###..#", + "#..###G###..#", "#..##...##..#", "#..........##", "##..........#", @@ -38,6 +38,29 @@ ], "flag_sets": {}, "connections": [], + "gates": { + "cut_tree_6_8": { + "tiles": [[6, 8]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_3_5": { + "tiles": [[3, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_9_6": { + "tiles": [[9, 6]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + } + }, "npcs": [ { "name": "lass", diff --git a/data/games/frlg/maps/runtime/CeruleanCity.json b/data/games/frlg/maps/runtime/CeruleanCity.json index e13aa82..f70555b 100644 --- a/data/games/frlg/maps/runtime/CeruleanCity.json +++ b/data/games/frlg/maps/runtime/CeruleanCity.json @@ -39,7 +39,7 @@ "#######...............................#..#######", "#######...............................#..#######", "#######...............................#..#######", - "###################S######.############..#######", + "###################S######G############..#######", "#######..................................#######", "#######..................................#######", "###############....#........#....###############", @@ -129,6 +129,15 @@ {"side": "west", "to_map": "Route4", "offset": 10}, {"side": "east", "to_map": "Route9", "offset": 10} ], + "gates": { + "cut_tree_26_32": { + "tiles": [[26, 32]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [18, 7], diff --git a/data/games/frlg/maps/runtime/FuchsiaCity.json b/data/games/frlg/maps/runtime/FuchsiaCity.json index 0f6b240..d96336b 100644 --- a/data/games/frlg/maps/runtime/FuchsiaCity.json +++ b/data/games/frlg/maps/runtime/FuchsiaCity.json @@ -17,19 +17,19 @@ "##...##############..#S...###..#############..##", "##...#wwwww##.....#............#....##.....#..##", "##...#wwwww##.....#............#....##.....#..##", - "##...##############....#######.#############..##", + "##...##############....#######G#############..##", "##....................#.......................##", "##....................#.......................##", - "##.......############.#...######.#########....##", + "##.......############G#...######.#########....##", "##.......####.............######.#.......#....##", "##.......SSD#............#######.#.......#....##", - "##.......................###D###.#########....##", + "##.......................###D###G#########....##", "########.................#....................##", ".......###########.......#S...#S..............##", ".......##wwwwwww#........#......################", ".......##wwwwwww#........#......................", "##.....##########........#......................", - "##.....#################.#......................", + "##.....#################G#......................", "##.............................############.....", "##.............................#...wwwwwww#...##", "##.............................#...wwwwwww#..###", @@ -121,6 +121,36 @@ {"side": "west", "to_map": "Route18", "offset": 10}, {"side": "east", "to_map": "Route15", "offset": 10} ], + "gates": { + "cut_tree_30_10": { + "tiles": [[30, 10]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_21_13": { + "tiles": [[21, 13]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_32_16": { + "tiles": [[32, 16]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_24_22": { + "tiles": [[24, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + } + }, "hidden_items": [ { "coord": [33, 26], diff --git a/data/games/frlg/maps/runtime/PewterCity.json b/data/games/frlg/maps/runtime/PewterCity.json index 2992faa..f1782b7 100644 --- a/data/games/frlg/maps/runtime/PewterCity.json +++ b/data/games/frlg/maps/runtime/PewterCity.json @@ -13,7 +13,7 @@ "####........#################.........##########", "####........#################.........##########", "####........#############D######......##########", - "####........###########...............##########", + "####........###########.......G.......##########", "#######.....#####.#####..#######........########", "####vvv..vvvvvvv...Svvvvvvvvvvvvvvvvv...########", "####....................................########", @@ -73,6 +73,15 @@ {"side": "south", "to_map": "Route2", "offset": 12}, {"side": "east", "to_map": "Route3", "offset": 10} ], + "gates": { + "cut_tree_30_5": { + "tiles": [[30, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [6, 3], diff --git a/data/games/frlg/maps/runtime/Route10.json b/data/games/frlg/maps/runtime/Route10.json index 198801e..14b1d80 100644 --- a/data/games/frlg/maps/runtime/Route10.json +++ b/data/games/frlg/maps/runtime/Route10.json @@ -27,13 +27,13 @@ "################..#www##", "################..#www##", "########.#######..#www##", - "##.........SSD##..#www##", + "##........GSSD##..#www##", "##..###S##........#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", - "##................#www##", + "##........G.......#www##", "##........#.......#www##", "##................#www##", "##................#www##", @@ -183,6 +183,36 @@ {"side": "south", "to_map": "LavenderTown", "offset": 0}, {"side": "west", "to_map": "Route9", "offset": 0} ], + "gates": { + "cut_tree_10_20": { + "tiles": [[10, 20]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_10_22": { + "tiles": [[10, 22]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_10_24": { + "tiles": [[10, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_10_26": { + "tiles": [[10, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + } + }, "hidden_items": [ { "coord": [10, 19], diff --git a/data/games/frlg/maps/runtime/Route12.json b/data/games/frlg/maps/runtime/Route12.json index 7294bf5..314f01d 100644 --- a/data/games/frlg/maps/runtime/Route12.json +++ b/data/games/frlg/maps/runtime/Route12.json @@ -119,7 +119,7 @@ "########wwwwww..www##www", "############ww..wwww##ww", "########...#ww..wwww##ww", - "########........wwww##ww", + "########...G....wwww##ww", "########..#.....wwww##ww", "##########..ww......ww##", "########....ww......ww##", @@ -130,7 +130,7 @@ "########wwwwwwwwww..ww##", "########wwwwwwwwww..ww##", "##############......ww##", - "########............ww##", + "########....G.......ww##", "########~~~~##ww..wwww##", "########~~~~##ww..wwww##", "########~~~~##ww..www##w", @@ -275,6 +275,22 @@ {"side": "south", "to_map": "Route13", "offset": -48}, {"side": "west", "to_map": "Route11", "offset": 60} ], + "gates": { + "cut_tree_11_100": { + "tiles": [[11, 100]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_12_111": { + "tiles": [[12, 111]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [18, 57], diff --git a/data/games/frlg/maps/runtime/Route13.json b/data/games/frlg/maps/runtime/Route13.json index 79f676e..4ed4c6d 100644 --- a/data/games/frlg/maps/runtime/Route13.json +++ b/data/games/frlg/maps/runtime/Route13.json @@ -12,7 +12,7 @@ "##############################################################..wwww##ww", "##############################################################..wwww##ww", "##############################################################..www##www", - "..................................#..............~~~~~~~~~~.##..www##www", + "..................................#.........G....~~~~~~~~~~.##..www##www", "################......#########...#..S######.....~~~~~~~~~~.##..www##www", "......................#.....................####.~~~~~~~~~~.##..www##www", "#############...#######..#################..####.~~~~~~~~~~.##..wwww##ww", @@ -57,6 +57,15 @@ {"side": "north", "to_map": "Route12", "offset": 48}, {"side": "west", "to_map": "Route14", "offset": 0} ], + "gates": { + "cut_tree_44_5": { + "tiles": [[44, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [23, 14], "item": "pp_up", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE13_PP_UP", "source_bg_event": 3} ], diff --git a/data/games/frlg/maps/runtime/Route14.json b/data/games/frlg/maps/runtime/Route14.json index 3b10d29..6a1f1e3 100644 --- a/data/games/frlg/maps/runtime/Route14.json +++ b/data/games/frlg/maps/runtime/Route14.json @@ -33,7 +33,7 @@ "#######~~~~~##...#wwwwww", "#######~~~~~##...#wwwwww", "#######.....##...#wwwwww", - "#######.vvvv##...#wwwwww", + "#######Gvvvv##...#wwwwww", "#######.....##...#wwwwww", "#######.....##...#wwwwww", "#######.....##...#wwwwww", @@ -42,7 +42,7 @@ "#######.....##.......#ww", "#######.....##.......#ww", "#######.....##.......#ww", - "#######..............#ww", + "#######.....G........#ww", "#######.....##.......#ww", "#######.....##.......#ww", "#######.....##.......#ww", @@ -54,7 +54,7 @@ "#######.....##.......#ww", "##..........##.......#ww", "##...................#ww", - ".....................#ww", + ".G...................#ww", ".>...................#ww", "v#...................#ww", ".....................#ww", @@ -137,6 +137,29 @@ {"side": "west", "to_map": "Route15", "offset": 40}, {"side": "east", "to_map": "Route13", "offset": 0} ], + "gates": { + "cut_tree_7_26": { + "tiles": [[7, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_12_35": { + "tiles": [[12, 35]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_1_47": { + "tiles": [[1, 47]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + } + }, "hidden_items": [ {"coord": [9, 20], "item": "zinc", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE14_ZINC", "source_bg_event": 1}, { diff --git a/data/games/frlg/maps/runtime/Route16.json b/data/games/frlg/maps/runtime/Route16.json index ba778b5..15e4ab0 100644 --- a/data/games/frlg/maps/runtime/Route16.json +++ b/data/games/frlg/maps/runtime/Route16.json @@ -18,7 +18,7 @@ "w#...................######...............######", "w#...................######...............######", "w#############################............######", - "w#...................######..####S#######.######", + "w#...................######..####S#######G######", "w#...................######...###...............", "w#...................#....#.....................", "w#...................######...###...............", @@ -63,6 +63,15 @@ {"side": "south", "to_map": "Route17", "offset": 0}, {"side": "east", "to_map": "CeladonCity", "offset": -10} ], + "gates": { + "cut_tree_41_11": { + "tiles": [[41, 11]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [31, 13], diff --git a/data/games/frlg/maps/runtime/Route2.json b/data/games/frlg/maps/runtime/Route2.json index 7b34b3c..5421a3c 100644 --- a/data/games/frlg/maps/runtime/Route2.json +++ b/data/games/frlg/maps/runtime/Route2.json @@ -33,7 +33,7 @@ "##..........#########.##", "##..........#####.###.##", "##..........#.S.......##", - "####....###.#.........##", + "####....###G#.........##", "###########...........##", "##########............##", "##############........##", @@ -46,7 +46,7 @@ "##############........##", "################......##", "################......##", - "##################.#####", + "##################G#####", "################......##", "################......##", "################......##", @@ -82,14 +82,14 @@ "##....~~~~~~~.##......##", "##....~~~~~~~.##......##", "##............##......##", - "##....................##", + "##..............G.....##", "##....##########......##", "##....##########......##", "##....##########......##", "##....##########......##", "##............##......##", "##............##......##", - "##....................##", + "##.............G......##", "##vvvvvvv..vvv..vv.vvv##", "##............##......##", "####..........##......##", @@ -126,6 +126,36 @@ {"side": "north", "to_map": "PewterCity", "offset": -12}, {"side": "south", "to_map": "ViridianCity", "offset": -12} ], + "gates": { + "cut_tree_16_62": { + "tiles": [[16, 62]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_14" + }, + "cut_tree_15_69": { + "tiles": [[15, 69]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + }, + "cut_tree_11_13": { + "tiles": [[11, 13]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_15" + }, + "cut_tree_18_26": { + "tiles": [[18, 26]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_16" + } + }, "npcs": [ { "name": "cut_tree", diff --git a/data/games/frlg/maps/runtime/Route25.json b/data/games/frlg/maps/runtime/Route25.json index 65d7b04..201e09a 100644 --- a/data/games/frlg/maps/runtime/Route25.json +++ b/data/games/frlg/maps/runtime/Route25.json @@ -22,7 +22,7 @@ "########################################################################", "########################################################################", "############...#...#.....#.....#..........##############################", - ".~~~~~~~~......#...#.....#.....#..........####################wwww######", + ".~~~~~~~~......#...#.....#....G#..........####################wwww######", ".~~~~~~~~................###.#............######S##D##########wwww######", "................#.#.#....#...#.....#.........................#wwww######", "vvvvvvvvvv##..##....#.##.#.........#.........................#wwwww#####", @@ -66,6 +66,15 @@ "warps": [{"coord": [51, 4], "enter": "walk_into", "to_map": "Route25_SeaCottage", "to_point": "warp_1"}], "flag_sets": {}, "connections": [{"side": "west", "to_map": "Route24", "offset": 0}], + "gates": { + "cut_tree_30_3": { + "tiles": [[30, 3]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [14, 2], "item": "elixir", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE25_ELIXIR", "source_bg_event": 1}, {"coord": [58, 6], "item": "ether", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE25_ETHER", "source_bg_event": 2}, diff --git a/data/games/frlg/maps/runtime/Route8.json b/data/games/frlg/maps/runtime/Route8.json index 4ce2f81..2e5ad26 100644 --- a/data/games/frlg/maps/runtime/Route8.json +++ b/data/games/frlg/maps/runtime/Route8.json @@ -20,10 +20,10 @@ ".######............#vvvvv#.......##.~~.~~.~~..##........######..........", ".######............#.....#.......#...~~~~~.~~..#........######..........", ".######............#.............#..~~.~.~~.~..#........######..........", - "########...........#.............#..~~~~~~~~~~..........######......####", + "########...........#.............#..~~~~~~~~~~.G........######......####", "....########.......#######.......#.~.~.~.~.~~~.#........######......####", "############.....................#.~~~~~~~~.~..#....................####", - "############........................~.~.~~.~.~.#....................####", + "############.....................G..~.~.~~.~.~.#....................####", "############.....................#.~.~~~.~~~~~.#....................####", "############.....................#....~.~~..~..#....................####", "############.....................#.....~.......#....................####", @@ -39,6 +39,22 @@ {"side": "west", "to_map": "SaffronCity_Connection", "offset": -10}, {"side": "east", "to_map": "LavenderTown", "offset": 0} ], + "gates": { + "cut_tree_33_15": { + "tiles": [[33, 15]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + }, + "cut_tree_47_12": { + "tiles": [[47, 12]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_13" + } + }, "hidden_items": [ { "coord": [42, 10], diff --git a/data/games/frlg/maps/runtime/Route9.json b/data/games/frlg/maps/runtime/Route9.json index 0f8d796..54e99d2 100644 --- a/data/games/frlg/maps/runtime/Route9.json +++ b/data/games/frlg/maps/runtime/Route9.json @@ -28,7 +28,7 @@ "#######~~~~~~~~~~~#####.......######......######..........#####..#######", "......#...........#####.......######......................#####..#######", "#######vvvvvvvv#..#####......S###########.................#####..#######", - "...............########.............#####....#####...##########.........", + "..G............########.............#####....#####...##########.........", "..#............########.............#####....#####...#####..............", "###########....########vvvvvvvvvvv..#####....#####...#####..............", "....#######vvvv########.............#####vvvv#####vv.#####...#####...###", @@ -48,6 +48,15 @@ {"side": "west", "to_map": "CeruleanCity", "offset": -10}, {"side": "east", "to_map": "Route10", "offset": 0} ], + "gates": { + "cut_tree_2_8": { + "tiles": [[2, 8]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ {"coord": [15, 7], "item": "ether", "quantity": 1, "flag": "FLAG_HIDDEN_ITEM_ROUTE9_ETHER", "source_bg_event": 1}, { diff --git a/data/games/frlg/maps/runtime/VermilionCity.json b/data/games/frlg/maps/runtime/VermilionCity.json index f7b0789..ed68195 100644 --- a/data/games/frlg/maps/runtime/VermilionCity.json +++ b/data/games/frlg/maps/runtime/VermilionCity.json @@ -31,7 +31,7 @@ "ww##wwww.......................www.....wwwwwwwww", "ww##wwww...#######.........####www.....wwwwwwwww", "www##www...#######..wwww...####www64.64wwwwwwwww", - "www##www##S########.wwww...#D##www.....ww#######", + "www##www##S########Gwwww...#D##www.....ww#######", "www##www.....#D#....wwww.......wwww...www#######", "www##www............wwwwwwwwwwwwwww...www#######", "ww##wwww............wwwwwwwwwwwwwww...www#######", @@ -119,6 +119,15 @@ {"side": "north", "to_map": "Route6", "offset": 12}, {"side": "east", "to_map": "Route11", "offset": 10} ], + "gates": { + "cut_tree_19_24": { + "tiles": [[19, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "hidden_items": [ { "coord": [14, 11], diff --git a/data/games/frlg/maps/runtime/ViridianCity.json b/data/games/frlg/maps/runtime/ViridianCity.json index 01c9081..16f9e3b 100644 --- a/data/games/frlg/maps/runtime/ViridianCity.json +++ b/data/games/frlg/maps/runtime/ViridianCity.json @@ -24,7 +24,7 @@ "###################.....########################", "###################.....########################", "###################.....####..............######", - "########..................................######", + "########..........G.......................######", "########.##########.......................######", "########.###########.............######...######", "########.##########..............######...######", @@ -43,7 +43,7 @@ "#######...................................######", "#######...................................######", "###########.............#####.............######", - "###########.##..........#####.............######", + "###########G##..........#####.............######", "#######.....##..........#####.............######", "#######....wwwwww.......SSD##.............######", "#######....wwwwww.........................######", @@ -116,6 +116,22 @@ {"side": "south", "to_map": "Route1", "offset": 12}, {"side": "west", "to_map": "Route22", "offset": 10} ], + "gates": { + "cut_tree_11_24": { + "tiles": [[11, 24]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_11" + }, + "cut_tree_18_5": { + "tiles": [[18, 5]], + "open_glyph": ".", + "new_game": "closed", + "opens_by": "cut", + "flag": "FLAG_TEMP_12" + } + }, "npcs": [ { "name": "fat_man", diff --git a/data/maps/runtime-manifest.json b/data/maps/runtime-manifest.json index 4fedcf3..bb2ed42 100644 --- a/data/maps/runtime-manifest.json +++ b/data/maps/runtime-manifest.json @@ -9,7 +9,7 @@ { "name": "CeladonCity", "file": "data/games/frlg/maps/runtime/CeladonCity.json", - "sha256": "a32481268755b54eba82ccddd403ab93ef37538072562aad706f1771bddec435", + "sha256": "c9e5b936834df47bae9ccefb9944b41721d30eda45c278387e1157e964b4870c", "source": { "decomp_file": "data/maps/CeladonCity/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -49,7 +49,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/CeladonCity.json", - "sha256": "a32481268755b54eba82ccddd403ab93ef37538072562aad706f1771bddec435" + "sha256": "c9e5b936834df47bae9ccefb9944b41721d30eda45c278387e1157e964b4870c" } }, { @@ -347,7 +347,7 @@ { "name": "CeladonCity_Gym", "file": "data/games/frlg/maps/runtime/CeladonCity_Gym.json", - "sha256": "b94dfdd80f91dd5e365cc2958c5d74a52910a9cc1bf4953ae8b3051ced299cff", + "sha256": "82c5a7dbc270273c4d05152ce42be6d99055037efa8e2a4cdc21ff3ff7fb0182", "source": { "decomp_file": "data/maps/CeladonCity_Gym/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -376,7 +376,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/CeladonCity_Gym.json", - "sha256": "b94dfdd80f91dd5e365cc2958c5d74a52910a9cc1bf4953ae8b3051ced299cff" + "sha256": "82c5a7dbc270273c4d05152ce42be6d99055037efa8e2a4cdc21ff3ff7fb0182" } }, { @@ -539,7 +539,7 @@ { "name": "CeruleanCity", "file": "data/games/frlg/maps/runtime/CeruleanCity.json", - "sha256": "426d07f97caf3709fc3540f39aacd15dad45a41cb1c7f361f08a51863bc87aa0", + "sha256": "819a4d9aa38f9ce00433347eefcd82748e2b897984b836ce9705130272ec6322", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/CeruleanCity.json", "source": { "decomp_file": "data/maps/CeruleanCity/map.json", @@ -573,7 +573,7 @@ }, "base": { "file": "data/games/frlg/maps/base/CeruleanCity.json", - "sha256": "426d07f97caf3709fc3540f39aacd15dad45a41cb1c7f361f08a51863bc87aa0" + "sha256": "819a4d9aa38f9ce00433347eefcd82748e2b897984b836ce9705130272ec6322" } }, { @@ -929,7 +929,7 @@ { "name": "FuchsiaCity", "file": "data/games/frlg/maps/runtime/FuchsiaCity.json", - "sha256": "7e12993a8b23f0d3e1ed50f3faab10997915db0e36cfd77e29cafa13cf6a18a5", + "sha256": "3158f40d83781c88eb91d0cdba0d47b29ce58c31a6bccbda6b14dab38222b77e", "source": { "decomp_file": "data/maps/FuchsiaCity/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -957,7 +957,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/FuchsiaCity.json", - "sha256": "7e12993a8b23f0d3e1ed50f3faab10997915db0e36cfd77e29cafa13cf6a18a5" + "sha256": "3158f40d83781c88eb91d0cdba0d47b29ce58c31a6bccbda6b14dab38222b77e" } }, { @@ -1697,7 +1697,7 @@ { "name": "PewterCity", "file": "data/games/frlg/maps/runtime/PewterCity.json", - "sha256": "3da486c09b14463a00a07f98b0280f62fc88f04b67acc583db456310735327df", + "sha256": "01309842cc67d52ace13ce9ac788836c8b0764101701be2f82670423359149a5", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/PewterCity.json", "source": { "decomp_file": "data/maps/PewterCity/map.json", @@ -1732,7 +1732,7 @@ }, "base": { "file": "data/games/frlg/maps/base/PewterCity.json", - "sha256": "3da486c09b14463a00a07f98b0280f62fc88f04b67acc583db456310735327df" + "sha256": "01309842cc67d52ace13ce9ac788836c8b0764101701be2f82670423359149a5" } }, { @@ -2958,7 +2958,7 @@ { "name": "Route10", "file": "data/games/frlg/maps/runtime/Route10.json", - "sha256": "af453e3bd0656a54e973328781e28e6ce3db53f4671cd334f4c66ef33d655983", + "sha256": "9cb1abae67b80756184ed1e8e992696798e18c64faae9cb0038829fc6ad324d8", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/Route10.json", "source": { "decomp_file": "data/maps/Route10/map.json", @@ -2992,7 +2992,7 @@ }, "base": { "file": "data/games/frlg/maps/base/Route10.json", - "sha256": "af453e3bd0656a54e973328781e28e6ce3db53f4671cd334f4c66ef33d655983" + "sha256": "9cb1abae67b80756184ed1e8e992696798e18c64faae9cb0038829fc6ad324d8" } }, { @@ -3119,7 +3119,7 @@ { "name": "Route12", "file": "data/games/frlg/maps/runtime/Route12.json", - "sha256": "152d55c8a18240b026e6cf67b30508d51a6aac06bea68719093e41d080dc7b1b", + "sha256": "70523f00ef17860123d9b8e5834b7c27d0ddd897f7db0b3e6d5085d3f59178c9", "source": { "decomp_file": "data/maps/Route12/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -3159,7 +3159,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/Route12.json", - "sha256": "152d55c8a18240b026e6cf67b30508d51a6aac06bea68719093e41d080dc7b1b" + "sha256": "70523f00ef17860123d9b8e5834b7c27d0ddd897f7db0b3e6d5085d3f59178c9" } }, { @@ -3200,7 +3200,7 @@ { "name": "Route13", "file": "data/games/frlg/maps/runtime/Route13.json", - "sha256": "0ab17830586baa895708f6c290eb5e4ded94753ed1b278a55b4bbe34434c3209", + "sha256": "ab082baaa3e38e72996fccaf94624f23a1a19c7e1a187450ed3731ef4b5cc72a", "source": { "decomp_file": "data/maps/Route13/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -3228,13 +3228,13 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/Route13.json", - "sha256": "0ab17830586baa895708f6c290eb5e4ded94753ed1b278a55b4bbe34434c3209" + "sha256": "ab082baaa3e38e72996fccaf94624f23a1a19c7e1a187450ed3731ef4b5cc72a" } }, { "name": "Route14", "file": "data/games/frlg/maps/runtime/Route14.json", - "sha256": "eda215f6fbf9f5da026dc3e62d016dcd79f87f97a5104a5d3020582501e79eab", + "sha256": "84a83f7226dce8beea025a94ba570c1b6be58220eb71eb62b238ded2d721f0f4", "source": { "decomp_file": "data/maps/Route14/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -3262,7 +3262,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/Route14.json", - "sha256": "eda215f6fbf9f5da026dc3e62d016dcd79f87f97a5104a5d3020582501e79eab" + "sha256": "84a83f7226dce8beea025a94ba570c1b6be58220eb71eb62b238ded2d721f0f4" } }, { @@ -3350,7 +3350,7 @@ { "name": "Route16", "file": "data/games/frlg/maps/runtime/Route16.json", - "sha256": "642273d4824f60c6c78953691c398b2f6522c8a15f91cdd9f0b745e5ecf9d563", + "sha256": "3a5a25056b98699993774ed31de4290f2feadbb5e4ac6626cee6b30652f22292", "source": { "decomp_file": "data/maps/Route16/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -3378,7 +3378,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/Route16.json", - "sha256": "642273d4824f60c6c78953691c398b2f6522c8a15f91cdd9f0b745e5ecf9d563" + "sha256": "3a5a25056b98699993774ed31de4290f2feadbb5e4ac6626cee6b30652f22292" } }, { @@ -3557,7 +3557,7 @@ { "name": "Route2", "file": "data/games/frlg/maps/runtime/Route2.json", - "sha256": "791f723a806c664b6892b101a866208745c4ed58f9e44dacbbc892780a62cc26", + "sha256": "2e2feb1973bea4a064a1d409d4073bb1a6dcae8504e16d22641ee51582c5d33f", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/Route2.json", "source": { "decomp_file": "data/maps/Route2/map.json", @@ -3604,7 +3604,7 @@ }, "base": { "file": "data/games/frlg/maps/base/Route2.json", - "sha256": "791f723a806c664b6892b101a866208745c4ed58f9e44dacbbc892780a62cc26" + "sha256": "2e2feb1973bea4a064a1d409d4073bb1a6dcae8504e16d22641ee51582c5d33f" } }, { @@ -3873,7 +3873,7 @@ { "name": "Route25", "file": "data/games/frlg/maps/runtime/Route25.json", - "sha256": "a5c4db46c5f057734da815e35d5449a0a6de58d1956ccbf3e4d38cd2ec62eeae", + "sha256": "8fdb04744b63fd3d24b6098e374f0b08664e33e356a25736b933b79935005696", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/Route25.json", "source": { "decomp_file": "data/maps/Route25/map.json", @@ -3919,7 +3919,7 @@ }, "base": { "file": "data/games/frlg/maps/base/Route25.json", - "sha256": "a5c4db46c5f057734da815e35d5449a0a6de58d1956ccbf3e4d38cd2ec62eeae" + "sha256": "8fdb04744b63fd3d24b6098e374f0b08664e33e356a25736b933b79935005696" } }, { @@ -4437,7 +4437,7 @@ { "name": "Route8", "file": "data/games/frlg/maps/runtime/Route8.json", - "sha256": "6765f3632f56b06e7eb1840133b915eb47a1e64f386820bcec9e0e65cf5b884f", + "sha256": "58f3908dff28620d06be5b4c5e6c0df7d2d1376dde8904fb275369cc0e2b2c20", "source": { "decomp_file": "data/maps/Route8/map.json", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", @@ -4466,7 +4466,7 @@ "status": "candidate", "base": { "file": "data/games/frlg/maps/base/Route8.json", - "sha256": "6765f3632f56b06e7eb1840133b915eb47a1e64f386820bcec9e0e65cf5b884f" + "sha256": "58f3908dff28620d06be5b4c5e6c0df7d2d1376dde8904fb275369cc0e2b2c20" } }, { @@ -4507,7 +4507,7 @@ { "name": "Route9", "file": "data/games/frlg/maps/runtime/Route9.json", - "sha256": "19d388a37d42126b5069e341b75c3b86a37a86b4b927c88a25b22dc37b57ed33", + "sha256": "a30c2d7a65f38f8cbe94e6d6b8a0f8ba56d29d34b168c5c016639177d96e80a7", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/Route9.json", "source": { "decomp_file": "data/maps/Route9/map.json", @@ -4554,7 +4554,7 @@ }, "base": { "file": "data/games/frlg/maps/base/Route9.json", - "sha256": "19d388a37d42126b5069e341b75c3b86a37a86b4b927c88a25b22dc37b57ed33" + "sha256": "a30c2d7a65f38f8cbe94e6d6b8a0f8ba56d29d34b168c5c016639177d96e80a7" } }, { @@ -5904,7 +5904,7 @@ { "name": "VermilionCity", "file": "data/games/frlg/maps/runtime/VermilionCity.json", - "sha256": "6a1ba2482cee579265508ff6f837fca8bea0fcfeba02e1ea9351b8a0bb58a077", + "sha256": "ea2294f55e91d8d1c24cf094eb6aca0b4dd3b76c82ec12d0f40f38357b02b551", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/VermilionCity.json", "source": { "decomp_file": "data/maps/VermilionCity/map.json", @@ -5938,7 +5938,7 @@ }, "base": { "file": "data/games/frlg/maps/base/VermilionCity.json", - "sha256": "6a1ba2482cee579265508ff6f837fca8bea0fcfeba02e1ea9351b8a0bb58a077" + "sha256": "ea2294f55e91d8d1c24cf094eb6aca0b4dd3b76c82ec12d0f40f38357b02b551" } }, { @@ -6272,7 +6272,7 @@ { "name": "ViridianCity", "file": "data/games/frlg/maps/runtime/ViridianCity.json", - "sha256": "c18f797d9fe5edf8fceb86f5e439778b44f78cf4397cd6b566f3ff7246c2d8cb", + "sha256": "e1d3e20b047138e7132874ea92a8117f4db20ec677d797469127931a01deeff7", "upstream_path": "SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/Maps/ViridianCity.json", "source": { "decomp_file": "data/maps/ViridianCity/map.json", @@ -6318,7 +6318,7 @@ }, "base": { "file": "data/games/frlg/maps/base/ViridianCity.json", - "sha256": "c18f797d9fe5edf8fceb86f5e439778b44f78cf4397cd6b566f3ff7246c2d8cb" + "sha256": "e1d3e20b047138e7132874ea92a8117f4db20ec677d797469127931a01deeff7" } }, { diff --git a/docs/maps/runtime-maps.md b/docs/maps/runtime-maps.md index f263900..fd6262e 100644 --- a/docs/maps/runtime-maps.md +++ b/docs/maps/runtime-maps.md @@ -64,7 +64,7 @@ and navigation fields and preserves unknown extensions. | `npcs`, `items`, `signs`, `interactables` | Typed arrays of `name,coord` (identified pickups may derive `name` from `source_event` and default `quantity` to 1), optional facing, inclusive `wander` box (`min`, `max`), trainer sight/looks and hide flag. Section supplies kind; non-item interactions use `interactables` when enriched. | | `triggers`, `flag_sets` | Named story trigger boxes/conditions; named sets of game flags. Preserve game semantics. | | `coord_events` | BDSP extension: named `coord,width,length,var,value,source` scene triggers. | -| `gates`, `switches` | FRLG story barriers. `gates`: id -> `tiles`, `open_glyph` (`.` or `~`), `new_game` (`open`/`closed`) and what moves it: a Card Key door has `opens_by: card_key_face_a` and `flag`, a Cinnabar Gym quiz door `opens_by: quiz_answer` and `flag` (opened only by the story, never by a press); a switch gate has `switch` (id in `switches`) and `open_when` (`on`/`off`). `switches`: id -> shared `flag`, `toggle`, `floors` (maps that share the state), `statues` (`coord`, `face_from`, `facing`). A Strength-button switch (Victory Road) has `toggle: false`, a `VAR_` as `flag`, `set_value`, `pressed_by: strength_boulder` and `buttons` (`coord`, tile `B`); `open_glyph` may also be `2/4/6/8`. See the FRLG map README. | +| `gates`, `switches` | FRLG story barriers. `gates`: id -> `tiles`, `open_glyph` (`.` or `~`), `new_game` (`open`/`closed`) and what moves it: a Card Key door has `opens_by: card_key_face_a` and `flag`, a Cinnabar Gym quiz door `opens_by: quiz_answer` and `flag` (opened only by the story, never by a press); a cut tree `cut_tree__` `opens_by: cut` and its hide `flag` (`FLAG_TEMP_*`: cut, it grows back on any warp; the tree also stays an object); a switch gate has `switch` (id in `switches`) and `open_when` (`on`/`off`). `switches`: id -> shared `flag`, `toggle`, `floors` (maps that share the state), `statues` (`coord`, `face_from`, `facing`). A Strength-button switch (Victory Road) has `toggle: false`, a `VAR_` as `flag`, `set_value`, `pressed_by: strength_boulder` and `buttons` (`coord`, tile `B`); `open_glyph` may also be `2/4/6/8`. See the FRLG map README. | | `patches` | Ordered `coord,glyph,measured_by` overrides, applied by the loader over raw tiles. | Tiles: `#` blocked, `.` open, `~` encounter terrain (including cave floor), diff --git a/schemas/runtime-map-v2.schema.json b/schemas/runtime-map-v2.schema.json index 38c2e8a..593f3c0 100644 --- a/schemas/runtime-map-v2.schema.json +++ b/schemas/runtime-map-v2.schema.json @@ -149,7 +149,7 @@ "tiles": {"type": "array", "items": {"$ref": "#/$defs/coord"}, "minItems": 1}, "open_glyph": {"enum": [".", "~", "2", "4", "6", "8"]}, "new_game": {"enum": ["open", "closed"]}, - "opens_by": {"enum": ["card_key_face_a", "quiz_answer"]}, + "opens_by": {"enum": ["card_key_face_a", "quiz_answer", "cut"]}, "flag": {"type": "string", "pattern": "^FLAG_[A-Z0-9_]+$"}, "switch": {"type": "string", "minLength": 1}, "open_when": {"enum": ["on", "off"]} @@ -259,11 +259,7 @@ "minItems": 1, "items": { "type": "array", - "prefixItems": [ - {"$ref": "#/$defs/direction"}, - {"type": "integer", "minimum": 1}, - {"const": "stuck"} - ], + "prefixItems": [{"$ref": "#/$defs/direction"}, {"type": "integer", "minimum": 1}, {"const": "stuck"}], "items": false, "minItems": 2 } diff --git a/src/pokesim/maps/frlg_decomp_map_builder.py b/src/pokesim/maps/frlg_decomp_map_builder.py index e068b4a..d26e9d9 100644 --- a/src/pokesim/maps/frlg_decomp_map_builder.py +++ b/src/pokesim/maps/frlg_decomp_map_builder.py @@ -463,6 +463,34 @@ def quiz_door_gates(scripts, name, tiles): return gates +# Cut trees. A tree is an object (OBJ_EVENT_GFX_CUT_TREE) on open ground; +# EventScript_CutTree removes it and sets its hide flag, a temporary flag +# (FLAG_TEMP_*) that a warp clears, so the tree grows back. Its tile is a +# gate (glyph `G`) that opens to the ground under it (`opens_by: cut`, the +# hide flag); the object stays in `objects`. +CUT_TREE_GFX = 'OBJ_EVENT_GFX_CUT_TREE' + + +def cut_tree_gates(objects, tiles): + """The `gates` of a map's cut trees, `cut_tree__`, from its + `object_events` and the blockdata rows `tiles`. Raises if a tree stands on + a tile other than open ground or has no hide flag.""" + gates = {} + for obj in objects: + if obj.get('graphics_id') != CUT_TREE_GFX or not (0 <= obj['y'] < len(tiles) and 0 <= obj['x'] < len(tiles[0])): + continue + x, y = obj['x'], obj['y'] + ground = tiles[y][x] + if ground not in ('.', '~'): + raise ValueError(f'cut tree ({x}, {y}) stands on {ground!r}, not open ground') + flag = obj.get('flag') or '0' + if not flag.startswith('FLAG_'): + raise ValueError(f'cut tree ({x}, {y}) has no hide flag') + gates[f'cut_tree_{x}_{y}'] = { + 'tiles': [[x, y]], 'open_glyph': ground, 'new_game': 'closed', 'opens_by': 'cut', 'flag': flag} + return gates + + class Decomp: def __init__(self, commit, cache): self.commit = commit @@ -1030,6 +1058,7 @@ def map_json(decomp, name, sources, layouts, names, loaded, unhandled, land_maps gates, switches = victory_road_gates(decomp.read(f'data/maps/{name}/scripts.inc').decode(), source, name, open_tiles) if name == QUIZ_DOOR_MAP: gates = quiz_door_gates(decomp.read(f'data/maps/{name}/scripts.inc').decode(), name, open_tiles) + gates = {**gates, **cut_tree_gates(source.get('object_events', []), open_tiles)} tiles = set_tiles(open_tiles, [tuple(c) for gate in gates.values() for c in gate['tiles']], GATE_GLYPH) warp_events = source.get('warp_events', []) points = {n: [x, y] for n, (x, y) in POINTS.get(name, {}).items()} diff --git a/src/pokesim/maps/runtime_map_schema.py b/src/pokesim/maps/runtime_map_schema.py index 95b048b..a6575a5 100644 --- a/src/pokesim/maps/runtime_map_schema.py +++ b/src/pokesim/maps/runtime_map_schema.py @@ -102,9 +102,9 @@ def tile(x, y): claimed[(x, y)] = gate_id require(rows[y][x] in ('G', '#', gate['open_glyph']), f'gate {gate_id}: tile {(x, y)} is {rows[y][x]!r}') if 'flag' in gate: - require(gate.get('opens_by') in ('card_key_face_a', 'quiz_answer') and gate['new_game'] == 'closed' + require(gate.get('opens_by') in ('card_key_face_a', 'quiz_answer', 'cut') and gate['new_game'] == 'closed' and 'switch' not in gate and 'open_when' not in gate, - f'gate {gate_id}: a flag gate opens by Card Key or a quiz answer and starts closed') + f'gate {gate_id}: a flag gate opens by Card Key, a quiz answer or Cut and starts closed') else: require(gate.get('switch') in switches, f'gate {gate_id}: unknown switch {gate.get("switch")!r}') require(gate.get('open_when') in ('on', 'off') and 'opens_by' not in gate, f'gate {gate_id}: open_when') diff --git a/src/pokesim/maps/test_frlg_decomp_map_builder.py b/src/pokesim/maps/test_frlg_decomp_map_builder.py index 2916069..56dc496 100644 --- a/src/pokesim/maps/test_frlg_decomp_map_builder.py +++ b/src/pokesim/maps/test_frlg_decomp_map_builder.py @@ -360,6 +360,23 @@ def test_a_door_that_opens_no_wall_is_an_error(self): frlg_maps.quiz_door_gates(self.SCRIPTS, 'CinnabarIsland_Gym', ['....', '....', '....']) +class CutTreeGateTest(unittest.TestCase): + TREE = {'graphics_id': 'OBJ_EVENT_GFX_CUT_TREE', 'x': 1, 'y': 0, 'flag': 'FLAG_TEMP_13', 'script': 'EventScript_CutTree'} + + def test_a_cut_tree_is_a_gate_over_the_ground_it_stands_on(self): + gates = frlg_maps.cut_tree_gates([self.TREE], ['.~.']) + self.assertEqual(gates, {'cut_tree_1_0': { + 'tiles': [[1, 0]], 'open_glyph': '~', 'new_game': 'closed', 'opens_by': 'cut', 'flag': 'FLAG_TEMP_13'}}) + + def test_other_objects_are_no_gate(self): + person = dict(self.TREE, graphics_id='OBJ_EVENT_GFX_LASS') + self.assertEqual(frlg_maps.cut_tree_gates([person], ['...']), {}) + + def test_a_tree_on_a_wall_is_an_error(self): + with self.assertRaisesRegex(ValueError, 'stands on'): + frlg_maps.cut_tree_gates([self.TREE], ['.#.']) + + class EncounterTest(unittest.TestCase): # MtMoon_1F's cave floor: behavior MB_CAVE (0x08), encounter type LAND. CAVE_FLOOR = 0x08 | (frlg_maps.TILE_ENCOUNTER_LAND << frlg_maps.ENCOUNTER_TYPE_SHIFT) diff --git a/src/pokesim/maps/test_runtime_map_publication.py b/src/pokesim/maps/test_runtime_map_publication.py index aef328b..dcb87a0 100644 --- a/src/pokesim/maps/test_runtime_map_publication.py +++ b/src/pokesim/maps/test_runtime_map_publication.py @@ -95,6 +95,20 @@ def undo_added_links(game, data): data['connections'] = [c for c in data['connections'] if c['to_map'] not in connections] +# Cut trees published as gates after the v1 baseline (`opens_by: cut`): the +# tree's tile is `G` and its gate opens to the ground the tree stands on. +# Every such gate is removed and its tile drawn as that ground before digesting. +def undo_cut_tree_gates(data): + gates = data.get('gates', {}) + for gate_id in [g for g, gate in gates.items() if gate.get('opens_by') == 'cut']: + gate = gates.pop(gate_id) + for x, y in gate['tiles']: + row = data['tiles'][y] + data['tiles'][y] = row[:x] + gate['open_glyph'] + row[x + 1:] + if 'gates' in data and not gates: + del data['gates'] + + # What each approved FRLG map gained when it became generated base + overlays # (docs/maps/OVERLAYS.md step 1): every source warp and connection linked, their # arrival points, object provenance and pickup identities, elevation grids left @@ -168,6 +182,7 @@ def test_all_published_values_match_reviewed_v1_baseline_and_stable_formatter(se continue for field in ('item', 'quantity', 'source_event', 'hide_flag'): item.pop(field, None) + undo_cut_tree_gates(baseline_data) undo_base_delta(game, baseline_data, deltas) undo_corrections(game, baseline_data) undo_story_flags_and_wander(game, baseline_data)