From cace88e8fa361bfec0f0a0ec34371d4365ad1924 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Fri, 10 Sep 2021 10:31:05 -0500 Subject: [PATCH] Reenable Chest Size Matches Contents --- playerSettings.yaml | 3 +++ worlds/oot/Options.py | 7 ++++++- worlds/oot/Patches.py | 26 ++++++++++++++++++-------- worlds/oot/__init__.py | 4 +--- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/playerSettings.yaml b/playerSettings.yaml index acb0bd78..b1d6bc1b 100644 --- a/playerSettings.yaml +++ b/playerSettings.yaml @@ -916,6 +916,9 @@ Ocarina of Time: random: 50 random-low: 0 random-high: 0 + correct_chest_sizes: # Changes chests containing progression into large chests, and nonprogression into small chests. + false: 50 + true: 0 hints: # Gossip Stones can give hints about item locations. none: 0 mask: 0 diff --git a/worlds/oot/Options.py b/worlds/oot/Options.py index 7f854323..3dd1e96c 100644 --- a/worlds/oot/Options.py +++ b/worlds/oot/Options.py @@ -483,6 +483,11 @@ timesavers_options: typing.Dict[str, type(Option)] = { } +class CSMC(Toggle): + """Changes chests containing progression into large chests, and nonprogression into small chests.""" + displayname = "Chest Size Matches Contents" + + class Hints(Choice): """Gossip Stones can give hints about item locations.""" displayname = "Gossip Stones" @@ -559,7 +564,7 @@ class RupeeStart(Toggle): misc_options: typing.Dict[str, type(Option)] = { - # "clearer_hints": DefaultOnToggle, + "correct_chest_sizes": CSMC, "hints": Hints, "hint_dist": HintDistribution, "text_shuffle": TextShuffle, diff --git a/worlds/oot/Patches.py b/worlds/oot/Patches.py index cf3f0ed2..fd123463 100644 --- a/worlds/oot/Patches.py +++ b/worlds/oot/Patches.py @@ -1624,10 +1624,15 @@ def patch_rom(world, rom): chest_name = 'Spirit Temple Compass Chest' chest_address = 0x2B6B07C location = world.get_location(chest_name) - item = read_rom_item(rom, location.item.index) - if item['chest_type'] in (1, 3): - rom.write_int16(chest_address + 2, 0x0190) # X pos - rom.write_int16(chest_address + 6, 0xFABC) # Z pos + if location.item.game == 'Ocarina of Time': + item = read_rom_item(rom, location.item.index) + if item['chest_type'] in (1, 3): + rom.write_int16(chest_address + 2, 0x0190) # X pos + rom.write_int16(chest_address + 6, 0xFABC) # Z pos + else: + if location.item.advancement: + rom.write_int16(chest_address + 2, 0x0190) # X pos + rom.write_int16(chest_address + 6, 0xFABC) # Z pos # Move Silver Gauntlets chest if it is small so it is reachable from Spirit Hover Seam if world.logic_rules != 'glitchless': @@ -1635,10 +1640,15 @@ def patch_rom(world, rom): chest_address_0 = 0x21A02D0 # Address in setup 0 chest_address_2 = 0x21A06E4 # Address in setup 2 location = world.get_location(chest_name) - item = read_rom_item(rom, location.item.index) - if item['chest_type'] in (1, 3): - rom.write_int16(chest_address_0 + 6, 0x0172) # Z pos - rom.write_int16(chest_address_2 + 6, 0x0172) # Z pos + if location.item.game == 'Ocarina of Time': + item = read_rom_item(rom, location.item.index) + if item['chest_type'] in (1, 3): + rom.write_int16(chest_address_0 + 6, 0x0172) # Z pos + rom.write_int16(chest_address_2 + 6, 0x0172) # Z pos + else: + if location.item.advancement: + rom.write_int16(chest_address_0 + 6, 0x0172) # Z pos + rom.write_int16(chest_address_2 + 6, 0x0172) # Z pos # give dungeon items the correct messages add_item_messages(messages, shop_items, world) diff --git a/worlds/oot/__init__.py b/worlds/oot/__init__.py index dc6eed26..aa434e0d 100644 --- a/worlds/oot/__init__.py +++ b/worlds/oot/__init__.py @@ -169,7 +169,6 @@ class OOTWorld(World): self.mq_dungeons_random = False # this will be a deprecated option later self.ocarina_songs = False # just need to pull in the OcarinaSongs module self.big_poe_count = 1 # disabled due to client-side issues for now - self.correct_chest_sizes = False # will probably never be implemented since multiworld items are always major # ER options self.shuffle_interior_entrances = 'off' self.shuffle_grotto_entrances = False @@ -180,8 +179,7 @@ class OOTWorld(World): self.spawn_positions = False # Set internal names used by the OoT generator - self.keysanity = self.shuffle_smallkeys in ['keysanity', 'remove', 'any_dungeon', - 'overworld'] # only 'keysanity' and 'remove' implemented + self.keysanity = self.shuffle_smallkeys in ['keysanity', 'remove', 'any_dungeon', 'overworld'] # Hint stuff self.misc_hints = True # this is just always on