The Messenger: Transition Shuffle (#4402)

* The Messenger: transition rando

* remove unused import

* always link both directions for plando when using coupled transitions

* er_type was renamed to randomization_type

* use frozenset for things that shouldn't change

* review suggestions

* do portal and transition shuffle in `connect_entrances`

* remove some unnecessary connections that were causing entrance caching collisions

* add test for strictest possible ER settings

* use unittest.skip on the skipped test, so we don't waste time doing setUp and tearDown

* use the world helpers

* make the plando connection description more verbose

* always add searing crags portal if portal shuffle is disabled

* guarantee an arbitrary number of locations with first connection

* make the constraints more lenient for a bit more variety
This commit is contained in:
Aaron Wagener
2025-03-10 10:16:09 -05:00
committed by GitHub
parent 4882366ffc
commit 7c30c4a169
7 changed files with 258 additions and 75 deletions

View File

@@ -3,7 +3,8 @@ from dataclasses import dataclass
from schema import And, Optional, Or, Schema
from Options import Choice, DeathLinkMixin, DefaultOnToggle, ItemsAccessibility, OptionDict, PerGameCommonOptions, \
PlandoConnections, Range, StartInventoryPool, Toggle, Visibility
PlandoConnections, Range, StartInventoryPool, Toggle
from . import RANDOMIZED_CONNECTIONS
from .portals import CHECKPOINTS, PORTALS, SHOP_POINTS
@@ -30,17 +31,25 @@ class PortalPlando(PlandoConnections):
portals = [f"{portal} Portal" for portal in PORTALS]
shop_points = [point for points in SHOP_POINTS.values() for point in points]
checkpoints = [point for points in CHECKPOINTS.values() for point in points]
portal_entrances = PORTALS
portal_exits = portals + shop_points + checkpoints
entrances = portal_entrances
exits = portal_exits
entrances = frozenset(PORTALS)
exits = frozenset(portals + shop_points + checkpoints)
# for back compatibility. To later be replaced with transition plando
class HiddenPortalPlando(PortalPlando):
visibility = Visibility.none
entrances = PortalPlando.entrances
exits = PortalPlando.exits
class TransitionPlando(PlandoConnections):
"""
Plando connections to be used with transition shuffle.
List of valid connections can be found at https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/messenger/connections.py#L641.
Dictionary keys (left) are entrances and values (right) are exits. If transition shuffle is on coupled all plando
connections will be coupled. If on decoupled, "entrance" and "exit" will be treated the same, simply making the
plando connection one-way from entrance to exit.
Example:
- entrance: Searing Crags - Top
exit: Dark Cave - Right
direction: both
"""
entrances = frozenset(RANDOMIZED_CONNECTIONS.keys())
exits = frozenset(RANDOMIZED_CONNECTIONS.values())
class Logic(Choice):
@@ -226,7 +235,7 @@ class MessengerOptions(DeathLinkMixin, PerGameCommonOptions):
early_meditation: EarlyMed
available_portals: AvailablePortals
shuffle_portals: ShufflePortals
# shuffle_transitions: ShuffleTransitions
shuffle_transitions: ShuffleTransitions
goal: Goal
music_box: MusicBox
notes_needed: NotesNeeded
@@ -236,4 +245,4 @@ class MessengerOptions(DeathLinkMixin, PerGameCommonOptions):
shop_price: ShopPrices
shop_price_plan: PlannedShopPrices
portal_plando: PortalPlando
plando_connections: HiddenPortalPlando
plando_connections: TransitionPlando