mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-29 19:03:25 -07:00
Merge, implement verify plando directions
This commit is contained in:
@@ -6,7 +6,7 @@ from .locations import location_table, location_name_groups, location_name_to_id
|
||||
from .rules import set_location_rules, set_region_rules, randomize_ability_unlocks, gold_hexagon
|
||||
from .er_rules import set_er_location_rules
|
||||
from .regions import tunic_regions
|
||||
from .er_scripts import create_er_regions
|
||||
from .er_scripts import create_er_regions, verify_plando_directions
|
||||
from .er_data import portal_mapping
|
||||
from .options import (TunicOptions, EntranceRando, tunic_option_groups, tunic_option_presets, TunicPlandoConnections,
|
||||
LaurelsLocation, EntranceLayout)
|
||||
@@ -96,6 +96,12 @@ class TunicWorld(World):
|
||||
self.options.plando_connections.value.remove(cxn)
|
||||
self.options.plando_connections.value.insert(index, replacement)
|
||||
|
||||
if (self.options.entrance_layout == EntranceLayout.option_direction_pairs
|
||||
and not verify_plando_directions(cxn)):
|
||||
raise OptionError(f"TUNIC: Player {self.player_name} has invalid plando connections. "
|
||||
f"They have Direction Pairs enabled and the connection "
|
||||
f"{cxn.entrance} --> {cxn.exit} does not abide by this option.")
|
||||
|
||||
# Universal tracker stuff, shouldn't do anything in standard gen
|
||||
if hasattr(self.multiworld, "re_gen_passthrough"):
|
||||
if "TUNIC" in self.multiworld.re_gen_passthrough:
|
||||
|
||||
@@ -323,11 +323,11 @@ def pair_portals(world: "TunicWorld", regions: Dict[str, Region]) -> Dict[Portal
|
||||
# if it's not a dead end, it might be a shop
|
||||
if p_exit == "Shop Portal":
|
||||
# 6 of the shops have south exits, 2 of them have west exits
|
||||
dir = Direction.south
|
||||
shop_dir = Direction.south
|
||||
if world.shop_num > 6:
|
||||
dir = Direction.west
|
||||
shop_dir = Direction.west
|
||||
portal2 = Portal(name=f"Shop Portal {world.shop_num}", region=f"Shop {world.shop_num}",
|
||||
destination="Previous Region", tag="_", direction=dir)
|
||||
destination="Previous Region", tag="_", direction=shop_dir)
|
||||
create_shop_region(world, regions)
|
||||
shop_count -= 1
|
||||
# need to maintain an even number of portals total
|
||||
@@ -472,11 +472,11 @@ def pair_portals(world: "TunicWorld", regions: Dict[str, Region]) -> Dict[Portal
|
||||
if portal1 is None:
|
||||
raise Exception("Too many shops in the pool, or something else went wrong.")
|
||||
# 6 of the shops have south exits, 2 of them have west exits
|
||||
dir = Direction.south
|
||||
shop_dir = Direction.south
|
||||
if world.shop_num > 6:
|
||||
dir = Direction.west
|
||||
shop_dir = Direction.west
|
||||
portal2 = Portal(name=f"Shop Portal {world.shop_num}", region=f"Shop {world.shop_num}",
|
||||
destination="Previous Region", tag="_", direction=dir)
|
||||
destination="Previous Region", tag="_", direction=shop_dir)
|
||||
create_shop_region(world, regions)
|
||||
|
||||
portal_pairs[portal1] = portal2
|
||||
|
||||
Reference in New Issue
Block a user