Bulk of Lobby randomization work

This commit is contained in:
aerinon
2020-08-28 12:42:20 -06:00
parent 18447cfe3e
commit 804309565b
16 changed files with 994 additions and 331 deletions

13
Main.py
View File

@@ -16,7 +16,7 @@ from InvertedRegions import create_inverted_regions, mark_dark_world_regions
from EntranceShuffle import link_entrances, link_inverted_entrances
from Rom import patch_rom, patch_race_rom, patch_enemizer, apply_rom_settings, LocalRom, JsonRom, get_hash_string
from Doors import create_doors
from DoorShuffle import link_doors
from DoorShuffle import link_doors, connect_portal
from RoomData import create_rooms
from Rules import set_rules
from Dungeons import create_dungeons, fill_dungeons, fill_dungeons_restrictive
@@ -434,6 +434,11 @@ def copy_world(world):
ret.inaccessible_regions = world.inaccessible_regions
ret.dungeon_layouts = world.dungeon_layouts
ret.key_logic = world.key_logic
ret.dungeon_portals = world.dungeon_portals
for player, portals in world.dungeon_portals.items():
for portal in portals:
connect_portal(portal, ret, player)
ret.sanc_portal = world.sanc_portal
for player in range(1, world.players + 1):
set_rules(ret, player)
@@ -495,11 +500,11 @@ def create_playthrough(world):
state_cache.append(state.copy())
logging.getLogger('').debug(world.fish.translate("cli","cli","building.calculating.spheres"), len(collection_spheres), len(sphere), len(prog_locations))
logging.getLogger('').debug(world.fish.translate("cli", "cli", "building.calculating.spheres"), len(collection_spheres), len(sphere), len(prog_locations))
if not sphere:
logging.getLogger('').error(world.fish.translate("cli","cli","cannot.reach.items"), [world.fish.translate("cli","cli","cannot.reach.item") % (location.item.name, location.item.player, location.name, location.player) for location in sphere_candidates])
logging.getLogger('').error(world.fish.translate("cli", "cli", "cannot.reach.items"), [world.fish.translate("cli","cli","cannot.reach.item") % (location.item.name, location.item.player, location.name, location.player) for location in sphere_candidates])
if any([world.accessibility[location.item.player] != 'none' for location in sphere_candidates]):
raise RuntimeError(world.fish.translate("cli","cli","cannot.reach.progression"))
raise RuntimeError(world.fish.translate("cli", "cli", "cannot.reach.progression"))
else:
old_world.spoiler.unreachables = sphere_candidates.copy()
break