From 1c231b703a24e237da0bd9b57225459f33413cce Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Wed, 25 May 2022 17:52:49 -0500 Subject: [PATCH] OoT: trap display rework Traps from all games now disguise themselves as OoT items Traps all display "[Player] is a FOOL!" when picked up --- worlds/oot/Patches.py | 18 +++++++++--------- worlds/oot/__init__.py | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/worlds/oot/Patches.py b/worlds/oot/Patches.py index bb1c5888..522dd4cb 100644 --- a/worlds/oot/Patches.py +++ b/worlds/oot/Patches.py @@ -1828,7 +1828,6 @@ def get_override_entry(player_id, location): player_id = 0 if player_id == location.item.player else min(location.item.player, 255) if location.item.game != 'Ocarina of Time': # This is an AP sendable. It's guaranteed to not be None. - looks_like_item_id = 0 if location.item.advancement: item_id = 0xCB else: @@ -1838,10 +1837,11 @@ def get_override_entry(player_id, location): if None in [scene, default, item_id]: return None - if location.item.looks_like_item is not None: - looks_like_item_id = location.item.looks_like_item.index - else: - looks_like_item_id = 0 + if location.item.trap: + item_id = 0x7C # Ice Trap ID, to get "X is a fool" message + looks_like_item_id = location.item.looks_like_item.index + else: + looks_like_item_id = 0 if location.type in ['NPC', 'BossHeart']: type = 0 @@ -2078,15 +2078,15 @@ def place_shop_items(rom, world, shop_items, messages, locations, init_shop_id=F shop_objs.add(location.item.special['object']) rom.write_int16(location.address1, location.item.index) else: - if location.item.game != "Ocarina of Time": + if location.item.trap: + item_display = location.item.looks_like_item + elif location.item.game != "Ocarina of Time": item_display = location.item if location.item.advancement: item_display.index = 0xCB else: item_display.index = 0xCC item_display.special = {} - elif location.item.looks_like_item is not None: - item_display = location.item.looks_like_item else: item_display = location.item @@ -2137,7 +2137,7 @@ def place_shop_items(rom, world, shop_items, messages, locations, init_shop_id=F else: shop_item_name = item_display.name - if location.item.name == 'Ice Trap': + if location.item.trap: shop_item_name = create_fake_name(shop_item_name) if len(world.world.worlds) > 1: diff --git a/worlds/oot/__init__.py b/worlds/oot/__init__.py index 713d94ca..05dfed43 100644 --- a/worlds/oot/__init__.py +++ b/worlds/oot/__init__.py @@ -567,7 +567,7 @@ class OOTWorld(World): self.fake_items.extend(item for item in self.itempool if item.index and self.is_major_item(item)) if self.ice_trap_appearance in ['junk_only', 'anything']: self.fake_items.extend(item for item in self.itempool if - item.index and not self.is_major_item(item) and item.name != 'Ice Trap') + item.index and not self.type == 'Shop' and not self.is_major_item(item) and item.name != 'Ice Trap') # Kill unreachable events that can't be gotten even with all items # Make sure to only kill actual internal events, not in-game "events" @@ -803,8 +803,8 @@ class OOTWorld(World): self.hint_data_available.wait() with i_o_limiter: - # Make ice traps appear as other random items - ice_traps = [loc.item for loc in self.get_locations() if loc.item.name == 'Ice Trap'] + # Make traps appear as other random items + ice_traps = [loc.item for loc in self.get_locations() if loc.item.trap] for trap in ice_traps: trap.looks_like_item = self.create_item(self.world.slot_seeds[self.player].choice(self.fake_items).name)