diff --git a/DoorShuffle.py b/DoorShuffle.py index 8d14fa34..a0a6a8f8 100644 --- a/DoorShuffle.py +++ b/DoorShuffle.py @@ -322,6 +322,11 @@ def connect_simple_door(world, exit_name, region_name, player): d.dest = region +def connect_simple_door_to_region(exit_door, region): + exit_door.entrance.connect(region) + exit_door.dest = region + + def connect_door_only(world, exit_name, region, player): d = world.check_for_door(exit_name, player) if d is not None: @@ -354,6 +359,12 @@ def connect_two_way(world, entrancename, exitname, player): x.dest = y if y is not None: y.dest = x + if x.dependents: + for dep in x.dependents: + connect_simple_door_to_region(dep, ext.parent_region) + if y.dependents: + for dep in y.dependents: + connect_simple_door_to_region(dep, entrance.parent_region) def connect_one_way(world, entrancename, exitname, player): @@ -373,6 +384,9 @@ def connect_one_way(world, entrancename, exitname, player): y = world.check_for_door(exitname, player) if x is not None: x.dest = y + if x.dependents: + for dep in x.dependents: + connect_simple_door_to_region(dep, ext.parent_region) def unmark_ugly_smalls(world, player): for d in ['Eastern Hint Tile Blocked Path SE', 'Eastern Darkness S', 'Thieves Hallway SE', 'Mire Left Bridge S', diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index b0871c75..87eea7ea 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -1561,13 +1561,18 @@ def validate_key_layout_sub_loop(key_layout, state, checked_states, flat_proposa def invalid_self_locking_key(key_layout, state, prev_state, prev_avail, world, player): if prev_state is None or state.used_smalls == prev_state.used_smalls: return False - new_bk_doors = set(state.big_doors).difference(set(prev_state.big_doors)) - state_copy = state.copy() - while len(new_bk_doors) > 0: - for door in new_bk_doors: - open_a_door(door.door, state_copy, key_layout.flat_prop, world, player) - new_bk_doors = set(state_copy.big_doors).difference(set(prev_state.big_doors)) - expand_key_state(state_copy, key_layout.flat_prop, world, player) + if state.found_forced_bk() and not prev_state.found_forced_bk(): + return False + if state.big_key_opened: + new_bk_doors = set(state.big_doors).difference(set(prev_state.big_doors)) + state_copy = state.copy() + while len(new_bk_doors) > 0: + for door in new_bk_doors: + open_a_door(door.door, state_copy, key_layout.flat_prop, world, player) + new_bk_doors = set(state_copy.big_doors).difference(set(prev_state.big_doors)) + expand_key_state(state_copy, key_layout.flat_prop, world, player) + else: + state_copy = state new_locations = set(state_copy.found_locations).difference(set(prev_state.found_locations)) important_found = False for loc in new_locations: diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e91b6ef4..8ee37b73 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -110,6 +110,8 @@ These are now independent of retro mode and have three options: None, Random, an # Bug Fixes and Notes * 1.2.0.14u + * Small fix for key logic validation (got rid of a false negative) + * Customized doors in ice cross work properly now * GUI reorganization * Auto option for pyramid open (trinity or ER + crystals goal) * World model refactor (combining inverted and normal world models)