Improve exclusion calculation

This commit is contained in:
aerinon
2021-08-30 15:21:25 -06:00
parent 67c4fee636
commit 07287d85a7
3 changed files with 4 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ class World(object):
self._room_cache = {} self._room_cache = {}
self.dungeon_layouts = {} self.dungeon_layouts = {}
self.inaccessible_regions = {} self.inaccessible_regions = {}
self.enabled_entrances = {}
self.key_logic = {} self.key_logic = {}
self.pool_adjustment = {} self.pool_adjustment = {}
self.key_layout = defaultdict(dict) self.key_layout = defaultdict(dict)

View File

@@ -753,7 +753,7 @@ def handle_split_dungeons(dungeon_builders, recombinant_builders, entrances_map,
def main_dungeon_generation(dungeon_builders, recombinant_builders, connections_tuple, world, player): def main_dungeon_generation(dungeon_builders, recombinant_builders, connections_tuple, world, player):
entrances_map, potentials, connections = connections_tuple entrances_map, potentials, connections = connections_tuple
enabled_entrances = {} enabled_entrances = world.enabled_entrances[player] = {}
sector_queue = deque(dungeon_builders.values()) sector_queue = deque(dungeon_builders.values())
last_key, loops = None, 0 last_key, loops = None, 0
logging.getLogger('').info(world.fish.translate("cli", "cli", "generating.dungeon")) logging.getLogger('').info(world.fish.translate("cli", "cli", "generating.dungeon"))

View File

@@ -109,7 +109,8 @@ def generate_dungeon_find_proposal(builder, entrance_region_names, split_dungeon
p_region = portal.door.entrance.connected_region p_region = portal.door.entrance.connected_region
access_region = next(x.parent_region for x in p_region.entrances access_region = next(x.parent_region for x in p_region.entrances
if x.parent_region.type in [RegionType.LightWorld, RegionType.DarkWorld]) if x.parent_region.type in [RegionType.LightWorld, RegionType.DarkWorld])
if access_region.name in world.inaccessible_regions[player]: if (access_region.name in world.inaccessible_regions[player] and
region.name not in world.enabled_entrances[player]):
excluded[region] = None excluded[region] = None
entrance_regions = [x for x in entrance_regions if x not in excluded.keys()] entrance_regions = [x for x in entrance_regions if x not in excluded.keys()]
doors_to_connect = {} doors_to_connect = {}