From 9153dbd38268cc62008f9e775312698fd7b4c766 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 12 Aug 2021 13:44:47 -0600 Subject: [PATCH 1/4] Fixed a problem that cropped up in retro+vanilla with big key placement --- Dungeons.py | 7 +++++++ KeyDoorShuffle.py | 7 ++++--- Main.py | 2 +- RELEASENOTES.md | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Dungeons.py b/Dungeons.py index 596da920..81fc4941 100644 --- a/Dungeons.py +++ b/Dungeons.py @@ -375,6 +375,13 @@ flexible_starts = { 'Skull Woods': ['Skull Left Drop', 'Skull Pinball'] } +default_key_counts = { + 'Hyrule Castle': 1, 'Eastern Palace': 0, 'Desert Palace': 1, + 'Tower of Hera': 1, 'Agahnims Tower': 2, 'Palace of Darkness': 6, + 'Swamp Palace': 1, 'Skull Woods': 3, 'Thieves Town': 1, + 'Ice Palace': 2, 'Misery Mire': 3, 'Turtle Rock': 4, 'Ganons Tower': 4 +} + dungeon_keys = { 'Hyrule Castle': 'Small Key (Escape)', 'Eastern Palace': 'Small Key (Eastern Palace)', diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index 549a739c..3ce9132f 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -4,7 +4,7 @@ from collections import defaultdict, deque from BaseClasses import DoorType from Regions import dungeon_events -from Dungeons import dungeon_keys, dungeon_bigs +from Dungeons import dungeon_keys, dungeon_bigs, default_key_counts from DungeonGenerator import ExplorationState, special_big_key_doors @@ -1384,9 +1384,10 @@ def create_key_counters(key_layout, world, player): flat_proposal = key_layout.flat_prop state = ExplorationState(dungeon=key_layout.sector.name) if world.doorShuffle[player] == 'vanilla': - state.key_locations = len(world.get_dungeon(key_layout.sector.name, player).small_keys) + state.key_locations = default_key_counts[key_layout.sector.name] else: - state.key_locations = world.dungeon_layouts[player][key_layout.sector.name].key_doors_num + builder = world.dungeon_layouts[player][key_layout.sector.name] + state.key_locations = builder.key_doors_num - builder.key_drop_cnt state.big_key_special, special_region = False, None for region in key_layout.sector.regions: for location in region.locations: diff --git a/Main.py b/Main.py index df4426e8..eb36681f 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.0.2-u' +__version__ = '0.5.0.3-u' from source.classes.BabelFish import BabelFish diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b6be375d..3b414321 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -15,6 +15,10 @@ CLI: ```--bomblogic``` # Bug Fixes and Notes. +* 0.5.0.3 + * Fixed a bug in retro+vanilla and big key placement + * Fixed a problem with shops not registering in the Multiclient until you visit one + * Fixed a bug in the Mystery code with sfx * 0.5.0.2 * --shuffle_sfx option added * 0.5.0.1 From d6a56e645ecc741e782f1533ff7d0e0259b27587 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 12 Aug 2021 13:45:20 -0600 Subject: [PATCH 2/4] Bug with MutliClient that didn't register shop locations unless you were in one --- MultiClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MultiClient.py b/MultiClient.py index bf64a2d7..501630e0 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -846,7 +846,7 @@ async def track_locations(ctx : Context, roomid, roomdata): new_locations.append(Regions.lookup_name_to_id[location]) try: - if roomid in location_shop_ids: + if ctx.shop_mode or ctx.retro_mode: misc_data = await snes_read(ctx, SHOP_ADDR, SHOP_SRAM_LEN) for cnt, b in enumerate(misc_data): my_check = Regions.shop_table_by_location_id[0x400000 + cnt] From de6f3683d0ae9b7b9ac0bea7a8f95d1743a94326 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 12 Aug 2021 13:45:51 -0600 Subject: [PATCH 3/4] Fixed bug with sfx_shuffle in mystery --- Mystery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mystery.py b/Mystery.py index 306b5c27..c0666e6a 100644 --- a/Mystery.py +++ b/Mystery.py @@ -234,7 +234,7 @@ def roll_settings(weights): ret.heartbeep = get_choice('heartbeep', romweights) ret.ow_palettes = get_choice('ow_palettes', romweights) ret.uw_palettes = get_choice('uw_palettes', romweights) - ret.uw_palettes = get_choice('shuffle_sfx', romweights) == 'on' + ret.shuffle_sfx = get_choice('shuffle_sfx', romweights) == 'on' return ret From 71079269fa1159f793e8cce2e520aaeb35d54eb3 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 12 Aug 2021 15:59:01 -0600 Subject: [PATCH 4/4] Total keys fix for key logic (Basic reductions do not affect amount of keys placed while crossed does) --- DoorShuffle.py | 4 +++- DungeonGenerator.py | 1 + KeyDoorShuffle.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DoorShuffle.py b/DoorShuffle.py index 67e376f6..918d6192 100644 --- a/DoorShuffle.py +++ b/DoorShuffle.py @@ -1071,6 +1071,7 @@ def assign_cross_keys(dungeon_builders, world, player): # Step 3: Initial valid combination find - reduce flex if needed for name, builder in dungeon_builders.items(): suggested = builder.key_doors_num - builder.key_drop_cnt + builder.total_keys = builder.key_doors_num find_valid_combination(builder, start_regions_map[name], world, player) actual_chest_keys = builder.key_doors_num - builder.key_drop_cnt if actual_chest_keys < suggested: @@ -1087,6 +1088,7 @@ def assign_cross_keys(dungeon_builders, world, player): name = builder.name logger.debug('Cross Dungeon: Increasing key count by 1 for %s', name) builder.key_doors_num += 1 + builder.total_keys = builder.key_doors_num result = find_valid_combination(builder, start_regions_map[name], world, player, drop_keys=False) if result: remaining -= 1 @@ -1380,7 +1382,7 @@ def shuffle_key_doors(builder, world, player): skips.append(world.get_door(dp.door_a, player)) break num_key_doors += 1 - builder.key_doors_num = num_key_doors + builder.key_doors_num = builder.total_keys = num_key_doors find_small_key_door_candidates(builder, start_regions, world, player) find_valid_combination(builder, start_regions, world, player) reassign_key_doors(builder, world, player) diff --git a/DungeonGenerator.py b/DungeonGenerator.py index 1c49cba0..06af10da 100644 --- a/DungeonGenerator.py +++ b/DungeonGenerator.py @@ -1175,6 +1175,7 @@ class DungeonBuilder(object): self.pre_open_stonewalls = set() # used by stonewall system self.candidates = None + self.total_keys = None self.key_doors_num = None self.combo_size = None self.flex = 0 diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index 3ce9132f..ca4a7f10 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -1387,7 +1387,7 @@ def create_key_counters(key_layout, world, player): state.key_locations = default_key_counts[key_layout.sector.name] else: builder = world.dungeon_layouts[player][key_layout.sector.name] - state.key_locations = builder.key_doors_num - builder.key_drop_cnt + state.key_locations = builder.total_keys - builder.key_drop_cnt state.big_key_special, special_region = False, None for region in key_layout.sector.regions: for location in region.locations: