From 8fc913274685dd8b752f0c3b9fd0aa0fde45c8b5 Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Sat, 8 Feb 2020 11:31:50 +1100 Subject: [PATCH] Ignore impossible key counters when checking key placement. --- KeyDoorShuffle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index 4af145b1..a3813b13 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -1239,7 +1239,7 @@ def val_rule(rule, skn, allow=False, loc=None, askn=None, setCheck=None): # Soft lock stuff def validate_key_placement(key_layout, world, player): if world.retro[player] or world.accessibility[player] == 'none': - return True # Can't keylock in retro. Expected if beatable only. + return True # Can't keylock in retro. Expected if beatable only. max_counter = find_max_counter(key_layout) keys_outside = 0 big_key_outside = False @@ -1255,6 +1255,8 @@ def validate_key_placement(key_layout, world, player): if len(counter.child_doors) == 0: continue big_found = any(i.item == dungeon.big_key for i in counter.free_locations if "- Big Chest" not in i.name) or big_key_outside + if counter.big_key_opened and not big_found: + continue # Can't get to this state found_locations = set(i for i in counter.free_locations if big_found or "- Big Chest" not in i.name) found_keys = sum(1 for i in found_locations if i.item is not None and i.item.name == smallkey_name and i.item.player == player) + \ len(counter.key_only_locations) + keys_outside