From bde58fb677443b6eed541fb6bf252e4248f1a325 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 9 Jan 2022 04:48:31 +0100 Subject: [PATCH] LttP: remove "bonus" small key hyrule castle in case of standard + own_dungeons --- worlds/alttp/Dungeons.py | 2 +- worlds/alttp/__init__.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/worlds/alttp/Dungeons.py b/worlds/alttp/Dungeons.py index 4b0814d3..cca78999 100644 --- a/worlds/alttp/Dungeons.py +++ b/worlds/alttp/Dungeons.py @@ -3,7 +3,7 @@ from worlds.alttp.Bosses import BossFactory from Fill import fill_restrictive from worlds.alttp.Items import ItemFactory from worlds.alttp.Regions import lookup_boss_drops -from worlds.alttp.Options import smallkey_shuffle +from worlds.alttp.Options import smallkey_shuffle def create_dungeons(world, player): diff --git a/worlds/alttp/__init__.py b/worlds/alttp/__init__.py index 3c075c8d..9cb46ff9 100644 --- a/worlds/alttp/__init__.py +++ b/worlds/alttp/__init__.py @@ -336,7 +336,8 @@ class ALTTPWorld(World): standard_keyshuffle_players = set() for player in world.get_game_players("A Link to the Past"): if world.mode[player] == 'standard' and world.smallkey_shuffle[player] \ - and world.smallkey_shuffle[player] != smallkey_shuffle.option_universal: + and world.smallkey_shuffle[player] != smallkey_shuffle.option_universal and \ + world.smallkey_shuffle[player] != smallkey_shuffle.option_own_dungeons: standard_keyshuffle_players.add(player) if not world.ganonstower_vanilla[player] or \ world.logic[player] in {'owglitches', 'hybridglitches', "nologic"}: @@ -364,9 +365,17 @@ class ALTTPWorld(World): fill_locations.remove(loc) world.random.shuffle(fill_locations) # TODO: investigate not creating the key in the first place - progitempool[:] = [item for item in progitempool if - item.player not in standard_keyshuffle_players or - item.name != "Small Key (Hyrule Castle)"] + if __debug__: + # keeping this here while I'm not sure we caught all instances of multiple HC small keys in the pool + count = len(progitempool) + progitempool[:] = [item for item in progitempool if + item.player not in standard_keyshuffle_players or + item.name != "Small Key (Hyrule Castle)"] + assert len(progitempool) + len(standard_keyshuffle_players) == count + else: + progitempool[:] = [item for item in progitempool if + item.player not in standard_keyshuffle_players or + item.name != "Small Key (Hyrule Castle)"] if trash_counts: locations_mapping = {player: [] for player in trash_counts}