diff options
Diffstat (limited to 'apworld/regions.py')
| -rw-r--r-- | apworld/regions.py | 18 |
1 files changed, 18 insertions, 0 deletions
| 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 | |||
| 5 | from entrance_rando import randomize_entrances | 5 | from entrance_rando import randomize_entrances |
| 6 | from .items import Lingo2Item | 6 | from .items import Lingo2Item |
| 7 | from .locations import Lingo2Location | 7 | from .locations import Lingo2Location |
| 8 | from .options import FastTravelAccess | ||
| 8 | from .player_logic import AccessRequirements | 9 | from .player_logic import AccessRequirements |
| 9 | from .rules import make_location_lambda | 10 | from .rules import make_location_lambda |
| 10 | 11 | ||
| @@ -153,6 +154,23 @@ def create_regions(world: "Lingo2World"): | |||
| 153 | for region in reqs.get_referenced_rooms(): | 154 | for region in reqs.get_referenced_rooms(): |
| 154 | world.multiworld.register_indirect_condition(regions[region], connection) | 155 | world.multiworld.register_indirect_condition(regions[region], connection) |
| 155 | 156 | ||
| 157 | if world.options.fast_travel_access != FastTravelAccess.option_vanilla: | ||
| 158 | for rte_map_id in world.player_logic.rte_mapping: | ||
| 159 | rte_map = world.static_logic.objects.maps[rte_map_id] | ||
| 160 | to_region = world.static_logic.get_room_region_name(rte_map.rte_room) | ||
| 161 | |||
| 162 | if to_region not in regions: | ||
| 163 | continue | ||
| 164 | |||
| 165 | connection_name = f"Return to {to_region}" | ||
| 166 | |||
| 167 | reqs = AccessRequirements() | ||
| 168 | |||
| 169 | if world.options.fast_travel_access == FastTravelAccess.option_items: | ||
| 170 | reqs.items.add(world.static_logic.get_map_rte_item_name(rte_map_id)) | ||
| 171 | |||
| 172 | regions["Menu"].connect(regions[to_region], connection_name, make_location_lambda(reqs, world, None)) | ||
| 173 | |||
| 156 | world.multiworld.regions += regions.values() | 174 | world.multiworld.regions += regions.values() |
| 157 | 175 | ||
| 158 | 176 | ||
