Add portal to tavern zone
This commit is contained in:
parent
d6920834c8
commit
7154dd86d3
2 changed files with 31 additions and 0 deletions
|
|
@ -19,3 +19,9 @@ rows = [
|
|||
|
||||
[terrain.impassable]
|
||||
tiles = ["#"]
|
||||
|
||||
[[portals]]
|
||||
x = 4
|
||||
y = 5
|
||||
target = "hub:14,7"
|
||||
label = "the tavern door"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue