From 2a3916c1c58e033b06042d5d5413ea85cd94babf Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 6 Feb 2026 13:43:45 -0500 Subject: Add shuffle_fast_travel and fast_travel_access to apworld --- apworld/regions.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'apworld/regions.py') diff --git a/apworld/regions.py b/apworld/regions.py index 2f9b571..500139f 100644 --- a/apworld/regions.py +++ b/apworld/regions.py @@ -5,6 +5,7 @@ from BaseClasses import Region, ItemClassification, Entrance from entrance_rando import randomize_entrances from .items import Lingo2Item from .locations import Lingo2Location +from .options import FastTravelAccess from .player_logic import AccessRequirements from .rules import make_location_lambda @@ -153,6 +154,23 @@ def create_regions(world: "Lingo2World"): for region in reqs.get_referenced_rooms(): world.multiworld.register_indirect_condition(regions[region], connection) + if world.options.fast_travel_access != FastTravelAccess.option_vanilla: + for rte_map_id in world.player_logic.rte_mapping: + rte_map = world.static_logic.objects.maps[rte_map_id] + to_region = world.static_logic.get_room_region_name(rte_map.rte_room) + + if to_region not in regions: + continue + + connection_name = f"Return to {to_region}" + + reqs = AccessRequirements() + + if world.options.fast_travel_access == FastTravelAccess.option_items: + reqs.items.add(world.static_logic.get_map_rte_item_name(rte_map_id)) + + regions["Menu"].connect(regions[to_region], connection_name, make_location_lambda(reqs, world, None)) + world.multiworld.regions += regions.values() -- cgit 1.4.1