Skip to content

Commit

Permalink
Make minor_items_as_major_chest a multiselect and add capacity option
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Sep 27, 2023
1 parent b1285ac commit 337b7e1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
33 changes: 21 additions & 12 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
24 changes: 15 additions & 9 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)

Expand Down
20 changes: 10 additions & 10 deletions data/presets_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 337b7e1

Please sign in to comment.