From 2c8dded52f31485f6d9e9876a07dd667ddc38577 Mon Sep 17 00:00:00 2001 From: Aaron Wagener Date: Mon, 10 Mar 2025 21:13:49 -0500 Subject: [PATCH] The Messenger: Fix some transition plando issues (#4720) * don't allow one-way and two-way entrances to be connected to each other * add special handling for the tower hq nodes since they share the same parent region --- worlds/messenger/options.py | 6 ++++++ worlds/messenger/transitions.py | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/worlds/messenger/options.py b/worlds/messenger/options.py index 9ee04d26..85c746aa 100644 --- a/worlds/messenger/options.py +++ b/worlds/messenger/options.py @@ -51,6 +51,12 @@ class TransitionPlando(PlandoConnections): entrances = frozenset(RANDOMIZED_CONNECTIONS.keys()) exits = frozenset(RANDOMIZED_CONNECTIONS.values()) + @classmethod + def can_connect(cls, entrance: str, exit: str) -> bool: + if entrance != "Glacial Peak - Left" and entrance.lower() in cls.exits: + return exit.lower() in cls.entrances + return exit.lower() not in cls.entrances + class Logic(Choice): """ diff --git a/worlds/messenger/transitions.py b/worlds/messenger/transitions.py index 1db975b3..53cfd836 100644 --- a/worlds/messenger/transitions.py +++ b/worlds/messenger/transitions.py @@ -30,10 +30,19 @@ def connect_plando(world: "MessengerWorld", plando_connections: TransitionPlando for plando_connection in plando_connections: # get the connecting regions - reg1 = world.get_region(plando_connection.entrance) + # need to handle these special because the names are unique but have the same parent region + if plando_connection.entrance in ("Artificer", "Tower HQ"): + reg1 = world.get_region("Tower HQ") + if plando_connection.entrance == "Artificer": + dangling_exit = world.get_entrance("Artificer's Portal") + else: + dangling_exit = world.get_entrance("Artificer's Challenge") + reg1.exits.remove(dangling_exit) + else: + reg1 = world.get_region(plando_connection.entrance) + remove_dangling_exit(reg1) + reg2 = world.get_region(plando_connection.exit) - - remove_dangling_exit(reg1) remove_dangling_entrance(reg2) # connect the regions reg1.connect(reg2)