From 7154dd86d31831cbde928cbf587dacc071fced16 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Wed, 11 Feb 2026 22:09:14 -0500 Subject: [PATCH] Add portal to tavern zone --- content/zones/tavern.toml | 6 ++++++ tests/test_zone_loading.py | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/content/zones/tavern.toml b/content/zones/tavern.toml index 22b7f9d..346a025 100644 --- a/content/zones/tavern.toml +++ b/content/zones/tavern.toml @@ -19,3 +19,9 @@ rows = [ [terrain.impassable] tiles = ["#"] + +[[portals]] +x = 4 +y = 5 +target = "hub:14,7" +label = "the tavern door" diff --git a/tests/test_zone_loading.py b/tests/test_zone_loading.py index 419b61c..7ddf2fc 100644 --- a/tests/test_zone_loading.py +++ b/tests/test_zone_loading.py @@ -351,3 +351,28 @@ aliases = ["gateway", "gate", "portal"] assert portal.aliases == ["gateway", "gate", "portal"] finally: temp_path.unlink() + + +def test_tavern_has_portal_to_hub(): + """Tavern zone has a portal at the door leading to hub zone.""" + project_root = pathlib.Path(__file__).resolve().parents[1] + tavern_path = project_root / "content" / "zones" / "tavern.toml" + + zone = load_zone(tavern_path) + + # Find portals in zone + portals = [obj for obj in zone._contents if obj.__class__.__name__ == "Portal"] + assert len(portals) == 1 + + # Check portal is at the door (4, 5) and leads to hub + portal = portals[0] + assert portal.name == "the tavern door" + assert portal.x == 4 + assert portal.y == 5 + assert portal.target_zone == "hub" + assert portal.target_x == 14 + assert portal.target_y == 7 + + # Verify portal is accessible at door coordinates + contents_at_door = zone.contents_at(4, 5) + assert portal in contents_at_door