Fix for vanilla mire key logic

This commit is contained in:
aerinon
2023-01-30 15:31:43 -07:00
parent ec557cd953
commit 7c75053cc1
3 changed files with 23 additions and 6 deletions

View File

@@ -743,6 +743,15 @@ class CollectionState(object):
rrp[k] = missing_regions[k]
possible_path = terminal_states[0].path[k]
self.path[k] = paths[k] = possible_path
for conn in k.exits:
if self.is_small_door(conn):
door = conn.door if conn.door.smallKey else conn.door.controller
key_logic = self.world.key_logic[player][dungeon_name]
if door.name not in self.reached_doors[player]:
self.door_counter[player][0][dungeon_name] += 1
self.reached_doors[player].add(door.name)
if key_logic.sm_doors[door]:
self.reached_doors[player].add(key_logic.sm_doors[door].name)
missing_bc = {}
for blocked, crystal in common_bc.items():
if (blocked not in bc and blocked.parent_region in rrp

View File

@@ -380,6 +380,11 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None
random.shuffle(fill_locations)
random.shuffle(world.itempool)
if world.item_pool_config.preferred:
pref = list(world.item_pool_config.preferred.keys())
pref_len = len(pref)
world.itempool.sort(key=lambda i: pref_len - pref.index((i.name, i.player))
if (i.name, i.player) in world.item_pool_config.preferred else 0)
progitempool = [item for item in world.itempool if item.advancement]
prioitempool = [item for item in world.itempool if not item.advancement and item.priority]
restitempool = [item for item in world.itempool if not item.advancement and not item.priority]

View File

@@ -1022,12 +1022,15 @@ def connect_custom(avail_pool, world, player):
if world.customizer and world.customizer.get_entrances():
custom_entrances = world.customizer.get_entrances()
player_key = player
for ent_name, exit_name in custom_entrances[player_key]['two-way'].items():
connect_two_way(ent_name, exit_name, avail_pool)
for ent_name, exit_name in custom_entrances[player_key]['entrances'].items():
connect_entrance(ent_name, exit_name, avail_pool)
for ent_name, exit_name in custom_entrances[player_key]['exits'].items():
connect_exit(exit_name, ent_name, avail_pool)
if 'two-way' in custom_entrances[player_key]:
for ent_name, exit_name in custom_entrances[player_key]['two-way'].items():
connect_two_way(ent_name, exit_name, avail_pool)
if 'entrances' in custom_entrances[player_key]:
for ent_name, exit_name in custom_entrances[player_key]['entrances'].items():
connect_entrance(ent_name, exit_name, avail_pool)
if 'exits' in custom_entrances[player_key]:
for ent_name, exit_name in custom_entrances[player_key]['exits'].items():
connect_exit(exit_name, ent_name, avail_pool)
def connect_simple(world, exit_name, region_name, player):