From bc8cfee57768150ca7f7a6870c20a76a923a8db3 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Tue, 20 Sep 2022 17:57:53 -0700 Subject: [PATCH] Fix some stuff for bomb mode --- ItemList.py | 12 ++++++++++-- Rom.py | 11 ++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ItemList.py b/ItemList.py index b7b20672..8c332109 100644 --- a/ItemList.py +++ b/ItemList.py @@ -187,6 +187,14 @@ def get_custom_array_key(item): return key +def maybe_replace_item(world, player, item): + if world.retro[player] and item in ['Single Arrow', 'Arrows (5)', 'Arrows (10)', 'Arrow Upgrade (+5)', 'Arrow Upgrade (+10)']: + return 'Rupees (5)' + if world.swords[player] == 'bombs' and item in ['Single Bomb', 'Bombs (3)', 'Bombs (10)', 'Bomb Upgrade (+5)', 'Bomb Upgrade (+10)']: + return 'Small Heart' + return item + + def generate_itempool(world, player): if (world.difficulty[player] not in ['normal', 'hard', 'expert'] or world.goal[player] not in ['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'trinity', 'crystals'] or world.mode[player] not in ['open', 'standard', 'inverted'] or world.timer not in ['none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown'] or world.progressive not in ['on', 'off', 'random']): @@ -842,8 +850,7 @@ def add_pot_contents(world, player): for pot in pot_list: if pot.item not in [PotItem.Hole, PotItem.Key, PotItem.Switch]: if valid_pot_location(pot, world.pot_pool[player], world, player): - item = ('Rupees (5)' if world.retro[player] and pot_items[pot.item] == 'Arrows (5)' - else pot_items[pot.item]) + item = maybe_replace_item(world, player, pot_items[pot.item]) world.itempool.append(ItemFactory(item, player)) @@ -853,6 +860,7 @@ def add_bonkdrop_contents(world, player): if item_name not in item_table: item_name = alt_item while (count > 0): + item_name = maybe_replace_item(world, player, item_name) item = ItemFactory(item_name, player) world.itempool.append(item) count -= 1 diff --git a/Rom.py b/Rom.py index 79c98c66..926a5f27 100644 --- a/Rom.py +++ b/Rom.py @@ -1366,11 +1366,12 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): rom.write_byte(0x0301FD, 0xD9) rom.write_byte(0x030224, 0x04) # adjust width of offset for replaced pot bomb rom.write_byte(0x030229, 0x04) - rom.write_byte(0x04CC4A, 0xD9) # bonk rocks that drop bombs - rom.write_byte(0x04D028, 0xD9) - rom.write_byte(0x04D397, 0xD9) - rom.write_byte(0x04D3A3, 0xDB) - rom.write_byte(0x04D56A, 0xDA) + if not world.shuffle_bonk_drops[player]: + rom.write_byte(0x04CC4A, 0xD9) # bonk rocks that drop bombs + rom.write_byte(0x04D028, 0xD9) + rom.write_byte(0x04D397, 0xD9) + rom.write_byte(0x04D3A3, 0xDB) + rom.write_byte(0x04D56A, 0xDA) rom.write_byte(0x00EDA7, 0x35) # DW chest game (bomb -> blue rupee) # thiefs and pikits shouldn't steal bombs