From 84fb47ba9d5d8ef6625cbcb2339499faa7301c79 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 31 Aug 2021 15:36:38 -0600 Subject: [PATCH] Couple of big key logic fixes - one with bk forced Another with bk assumed to be found early in dungeon Catobat map check fix from rom --- BaseClasses.py | 1 + KeyDoorShuffle.py | 15 +++++++++++++-- Main.py | 2 +- RELEASENOTES.md | 11 +++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 820b2fed..b5462eb4 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -142,6 +142,7 @@ class World(object): set_player_attr('force_fix', {'gt': False, 'sw': False, 'pod': False, 'tr': False}) set_player_attr('exp_cache', defaultdict(dict)) + set_player_attr('enabled_entrances', {}) def get_name_string_for_object(self, obj): return obj.name if self.players == 1 else f'{obj.name} ({self.get_player_names(obj.player)})' diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index be4f03a2..23dd24be 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -282,6 +282,12 @@ def analyze_dungeon(key_layout, world, player): if not big_avail: if chest_keys == non_big_locs and chest_keys > 0 and available <= possible_smalls and not avail_bigs: key_logic.bk_restricted.update(filter_big_chest(key_counter.free_locations)) + # note to self: this is due to the enough_small_locations function in validate_key_layout_sub_loop + # I don't like this exception here or there + elif available <= possible_smalls and avail_bigs and non_big_locs > 0: + max_ctr = find_max_counter(key_layout) + bk_lockdown = [x for x in max_ctr.free_locations if x not in key_counter.free_locations] + key_logic.bk_restricted.update(filter_big_chest(bk_lockdown)) # try to relax the rules here? - smallest requirement that doesn't force a softlock child_queue = deque() for child in key_counter.child_doors.keys(): @@ -1619,8 +1625,13 @@ def can_open_door_by_counter(door, counter: KeyCounter, layout, world, player): # ttl_small_key_only = len(counter.key_only_locations) return cnt_avail_small_locations_by_ctr(ttl_locations, counter, layout, world, player) > 0 elif door.bigKey: - available_big_locations = cnt_avail_big_locations_by_ctr(ttl_locations, counter, layout, world, player) - return not counter.big_key_opened and available_big_locations > 0 and not layout.big_key_special + if counter.big_key_opened: + return False + if layout.big_key_special: + return any(x for x in counter.other_locations.keys() if x.forced_item and x.forced_item.bigkey) + else: + available_big_locations = cnt_avail_big_locations_by_ctr(ttl_locations, counter, layout, world, player) + return available_big_locations > 0 else: return True diff --git a/Main.py b/Main.py index ee9e83fb..be2cb2e6 100644 --- a/Main.py +++ b/Main.py @@ -28,7 +28,7 @@ from Fill import sell_potions, sell_keys, balance_multiworld_progression, balanc from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops from Utils import output_path, parse_player_names -__version__ = '0.5.1.0-u' +__version__ = '0.5.1.1-u' from source.classes.BabelFish import BabelFish diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 37877c89..4d212275 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -15,6 +15,17 @@ CLI: ```--bombbag``` # Bug Fixes and Notes. +* 0.5.1.1 + * Shop hints in ER are now more generic instead of using "near X" because they aren't near that anymore + * Added memory location for mutliworld scripts to read what item was just obtain (longer than one frame) + * Fix for bias in boss shuffle "full" + * Fix for certain lone big chests in keysanity (allowed you to get contents without big key) + * Fix for pinball checking + * Fix for multi-entrance dungeons + * 2 fixes for big key placement logic + * ensure big key is placed early if the validator assumes it) + * Open big key doors appropriately when generating rules and big key is forced somewhere + * Updated cutoff entrances for intensity 3 * 0.5.1.0 * Large logic refactor introducing a new method of key logic * Some performance optimization