From 337b7e1f35a2350da16aa75a4ac7879cf68b7fe6 Mon Sep 17 00:00:00 2001 From: Fenhl Date: Wed, 27 Sep 2023 06:08:29 +0000 Subject: [PATCH] Make minor_items_as_major_chest a multiselect and add capacity option --- Patches.py | 33 +++++++++++++++++++++------------ SettingsList.py | 24 +++++++++++++++--------- data/presets_default.json | 20 ++++++++++---------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/Patches.py b/Patches.py index 775bceb6a..c273610eb 100644 --- a/Patches.py +++ b/Patches.py @@ -2222,34 +2222,43 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p HEART_CHEST_BIG = 17 if world.settings.shuffle_tcgkeys == 'vanilla': # Force key chests in Treasure Chest Game to use the default chest texture when not shuffled - item = read_rom_item(rom, 0x71) + item = read_rom_item(rom, 0x0071) item['chest_type'] = BROWN_CHEST - write_rom_item(rom, 0x71, item) - if world.settings.free_bombchu_drops or world.settings.minor_items_as_major_chest: - bombchu_ids = [0x6A, 0x03, 0x6B] + write_rom_item(rom, 0x0071, item) + if world.settings.free_bombchu_drops or 'bombchus' in world.settings.minor_items_as_major_chest: + bombchu_ids = [0x006A, 0x0003, 0x006B] for i in bombchu_ids: item = read_rom_item(rom, i) item['chest_type'] = GILDED_CHEST write_rom_item(rom, i, item) if world.settings.bridge == 'tokens' or world.settings.lacs_condition == 'tokens' or world.settings.shuffle_ganon_bosskey == 'tokens': - item = read_rom_item(rom, 0x5B) + item = read_rom_item(rom, 0x005B) item['chest_type'] = SKULL_CHEST_BIG - write_rom_item(rom, 0x5B, item) + write_rom_item(rom, 0x005B, item) if world.settings.bridge == 'hearts' or world.settings.lacs_condition == 'hearts' or world.settings.shuffle_ganon_bosskey == 'hearts': - heart_ids = [0x3D, 0x3E, 0x76] + heart_ids = [0x003D, 0x003E, 0x0076] for i in heart_ids: item = read_rom_item(rom, i) item['chest_type'] = HEART_CHEST_BIG write_rom_item(rom, i, item) - if world.settings.minor_items_as_major_chest: + if 'shields' in world.settings.minor_items_as_major_chest: # Deku - item = read_rom_item(rom, 0x29) + item = read_rom_item(rom, 0x0029) item['chest_type'] = GILDED_CHEST - write_rom_item(rom, 0x29, item) + write_rom_item(rom, 0x0029, item) # Hylian - item = read_rom_item(rom, 0x2A) + item = read_rom_item(rom, 0x002A) item['chest_type'] = GILDED_CHEST - write_rom_item(rom, 0x2A, item) + write_rom_item(rom, 0x002A, item) + if 'capacity' in world.settings.minor_items_as_major_chest: + # Nuts + item = read_rom_item(rom, 0x0087) + item['chest_type'] = GILDED_CHEST + write_rom_item(rom, 0x0087, item) + # Sticks + item = read_rom_item(rom, 0x0088) + item['chest_type'] = GILDED_CHEST + write_rom_item(rom, 0x0088, item) # Update chest type appearance if world.settings.correct_chest_appearances == 'textures': diff --git a/SettingsList.py b/SettingsList.py index 72b13a8ba..eae8be6fd 100644 --- a/SettingsList.py +++ b/SettingsList.py @@ -3223,19 +3223,25 @@ class SettingInfos: }, ) - minor_items_as_major_chest = Checkbutton( + minor_items_as_major_chest = MultipleSelect( gui_text = 'Minor Items in Big/Gold chests', + choices = { + 'bombchus': 'Bombchus', + 'shields': 'Deku & Hylian Shields', + 'capacity': 'Deku Stick & Nut Capacity', + }, gui_tooltip = '''\ - Chests with Hylian Shield, Deku Shield, or - Bombchus will appear in Big and/or Gold chests, - depending on the Chest Appearance Matches - Contents setting. Bombchus are always in big - chests if Add Bombchu Bag and Drops is on. + Chests with Hylian or Deku Shields, Deku Stick + or Nut Capacity, or Bombchus will appear in Big + and/or Gold chests, depending on the Chest + Appearance Matches Contents setting. Bombchus + are always in big chests if Add Bombchu Bag and + Drops is on. ''', shared = True, - disabled_default = False, - gui_params = { - "hide_when_disabled" : True + default = [], + gui_params = { + "hide_when_disabled" : True, }, ) diff --git a/data/presets_default.json b/data/presets_default.json index 9d4ece862..418e07369 100644 --- a/data/presets_default.json +++ b/data/presets_default.json @@ -123,7 +123,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "off", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_unchecked", "key_appearance_match_dungeon": false, @@ -304,7 +304,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "both", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_content", "key_appearance_match_dungeon": false, @@ -482,7 +482,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "both", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_content", "key_appearance_match_dungeon": false, @@ -661,7 +661,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "off", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_unchecked", "key_appearance_match_dungeon": false, @@ -848,7 +848,7 @@ "ruto_already_f1_jabu": true, "ocarina_songs": "off", "correct_chest_appearances": "textures", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_unchecked", "key_appearance_match_dungeon": false, @@ -1022,7 +1022,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "both", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_content", "key_appearance_match_dungeon": false, @@ -1368,7 +1368,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "all", "correct_chest_appearances": "off", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": true, "correct_potcrate_appearances": "off", "key_appearance_match_dungeon": false, @@ -1534,7 +1534,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "off", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_unchecked", "key_appearance_match_dungeon": false, @@ -1711,7 +1711,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "both", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_content", "key_appearance_match_dungeon": false, @@ -1887,7 +1887,7 @@ "ruto_already_f1_jabu": false, "ocarina_songs": "off", "correct_chest_appearances": "off", - "minor_items_as_major_chest": false, + "minor_items_as_major_chest": [], "invisible_chests": false, "correct_potcrate_appearances": "textures_unchecked", "key_appearance_match_dungeon": false,