Core: move PlandoConnections and PlandoTexts to the options system (#2904)

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
Co-authored-by: beauxq <beauxq@yahoo.com>
Co-authored-by: alwaysintreble <mmmcheese158@gmail.com>
This commit is contained in:
Silvris
2024-06-01 06:34:41 -05:00
committed by GitHub
parent f40b10dc97
commit 4e5b6bb3d2
19 changed files with 767 additions and 71 deletions

View File

@@ -3,8 +3,9 @@ from typing import Dict
from schema import And, Optional, Or, Schema
from Options import Accessibility, Choice, DeathLinkMixin, DefaultOnToggle, OptionDict, PerGameCommonOptions, Range, \
StartInventoryPool, Toggle
from Options import Accessibility, Choice, DeathLinkMixin, DefaultOnToggle, OptionDict, PerGameCommonOptions, \
PlandoConnections, Range, StartInventoryPool, Toggle, Visibility
from worlds.messenger.portals import CHECKPOINTS, PORTALS, SHOP_POINTS
class MessengerAccessibility(Accessibility):
@@ -13,6 +14,36 @@ class MessengerAccessibility(Accessibility):
__doc__ = Accessibility.__doc__.replace(f"default {Accessibility.default}", f"default {default}")
class PortalPlando(PlandoConnections):
"""
Plando connections to be used with portal shuffle. Direction is ignored.
List of valid connections can be found here: https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/messenger/portals.py#L12.
The entering Portal should *not* have "Portal" appended.
For the exits, those in checkpoints and shops should just be the name of the spot, while portals should have " Portal" at the end.
Example:
- entrance: Riviere Turquoise
exit: Wingsuit
- entrance: Sunken Shrine
exit: Sunny Day
- entrance: Searing Crags
exit: Glacial Peak Portal
"""
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
# for back compatibility. To later be replaced with transition plando
class HiddenPortalPlando(PortalPlando):
visibility = Visibility.none
entrances = PortalPlando.entrances
exits = PortalPlando.exits
class Logic(Choice):
"""
The level of logic to use when determining what locations in your world are accessible.
@@ -205,3 +236,5 @@ class MessengerOptions(DeathLinkMixin, PerGameCommonOptions):
traps: Traps
shop_price: ShopPrices
shop_price_plan: PlannedShopPrices
portal_plando: PortalPlando
plando_connections: HiddenPortalPlando