From f1f0ef8224237907b11d25cd3cf6956d6e701700 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 1 Sep 2025 10:57:11 -0500 Subject: [PATCH] WIP --- BaseClasses.py | 4 ++++ CLI.py | 3 ++- Fill.py | 29 ++++++++++++++++++++++++++++- ItemList.py | 2 +- Main.py | 7 ++++++- resources/app/cli/args.json | 6 ++++++ 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 4e4b8827..ab053317 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -73,6 +73,7 @@ class World(object): self.shuffle_ganon = shuffle_ganon self.dark_rooms = {} self.damage_challenge = {} + self.big_chest_items = {} self.shuffle_damage_table = {} self.custom = custom self.customitemarray = customitemarray @@ -148,6 +149,7 @@ class World(object): set_player_attr('bigkeyshuffle', 'none') set_player_attr('prizeshuffle', 'none') set_player_attr('restrict_boss_items', 'none') + set_player_attr('big_chest_items', 'random') set_player_attr('bombbag', False) set_player_attr('flute_mode', False) set_player_attr('bow_mode', False) @@ -3054,6 +3056,7 @@ class Spoiler(object): 'open_pyramid': self.world.open_pyramid, 'accessibility': self.world.accessibility, 'restricted_boss_items': self.world.restrict_boss_items, + 'big_chest_items': self.world.big_chest_items, 'hints': self.world.hints, 'mapshuffle': self.world.mapshuffle, 'compassshuffle': self.world.compassshuffle, @@ -3332,6 +3335,7 @@ class Spoiler(object): outfile.write('Dark Rooms:'.ljust(line_width) + '%s\n' % self.metadata['dark_rooms'][player]) outfile.write('Damage Challenge:'.ljust(line_width) + '%s\n' % self.metadata['damage_challenge'][player]) outfile.write('Damage Table Randomization:'.ljust(line_width) + '%s\n' % self.metadata['shuffle_damage_table'][player]) + outfile.write('Big Chest Item Randomization:'.ljust(line_width) + '%s\n' % self.metadata['big_chest_items'][player]) outfile.write('Crystal Book:'.ljust(line_width) + '%s\n' % yn(self.metadata['crystal_book'][player])) outfile.write('Hints:'.ljust(line_width) + '%s\n' % yn(self.metadata['hints'][player])) outfile.write('Race:'.ljust(line_width) + '%s\n' % yn(self.world.settings.world_rep['meta']['race'])) diff --git a/CLI.py b/CLI.py index 8f51760c..da723f8c 100644 --- a/CLI.py +++ b/CLI.py @@ -135,7 +135,7 @@ def parse_cli(argv, no_defaults=False): 'flute_mode', 'bow_mode', 'take_any', 'boots_hint', 'shuffle_followers', 'shuffle', 'door_shuffle', 'intensity', 'crystals_ganon', 'crystals_gt', 'openpyramid', 'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'prizeshuffle', 'startinventory', - 'usestartinventory', 'bombbag', 'shuffleganon', 'overworld_map', 'restrict_boss_items', + 'usestartinventory', 'bombbag', 'shuffleganon', 'overworld_map', 'restrict_boss_items', 'big_chest_items', 'triforce_max_difference', 'triforce_pool_min', 'triforce_pool_max', 'triforce_goal_min', 'triforce_goal_max', 'triforce_min_difference', 'triforce_goal', 'triforce_pool', 'shufflelinks', 'shuffletavern', 'skullwoods', 'linked_drops', @@ -189,6 +189,7 @@ def parse_settings(): "mystery": False, "suppress_meta": False, "restrict_boss_items": "none", + "big_chest_items": "random", # Shuffle Ganon defaults to TRUE "openpyramid": "auto", diff --git a/Fill.py b/Fill.py index b6b793db..0ac2e7ca 100644 --- a/Fill.py +++ b/Fill.py @@ -43,6 +43,33 @@ def dungeon_tracking(world): layout.free_items = layout.location_cnt - layout.dungeon_items +def fill_vanilla_big_chests(world): + def place_item(player, location_name, item_name): + location = world.get_location(location_name, player) + items = [item for item in world.itempool if item.location is None and item.name == item_name and item.player == player] + if len(items) == 0: + raise RuntimeError('Cannot find item %s for player %s in pool.' % (item_name, item.player)) + item = items[0] + world.itempool.remove(item) + world.push_item(location, item, False) + + for player in range(1, world.players + 1): + if world.big_chest_items[player] == 'vanilla': + place_item(player, "Hyrule Castle - Zelda's Chest", "Lamp") + place_item(player, "Sahasrahla", "Pegasus Boots") + place_item(player, "Eastern Palace - Big Chest", "Bow") + place_item(player, "Desert Palace - Big Chest", "Progressive Glove") + place_item(player, "Tower of Hera - Big Chest", "Moon Pearl") + place_item(player, "Palace of Darkness - Big Chest", "Hammer") + place_item(player, "Swamp Palace - Big Chest", "Hookshot") + place_item(player, "Skull Woods - Big Chest", "Fire Rod") + place_item(player, "Thieves' Town - Big Chest", "Progressive Glove") + place_item(player, "Ice Palace - Big Chest", "Flippers") + place_item(player, "Misery Mire - Big Chest", "Cane of Somaria") + place_item(player, "Turtle Rock - Big Chest", "Ice Rod") + place_item(player, "Ganons Tower - Big Chest", "Magic Mirror") + + def fill_dungeons_restrictive(world, shuffled_locations): # with shuffled dungeon items they are distributed as part of the normal item pool for item in world.get_items(): @@ -1285,4 +1312,4 @@ def set_prize_drops(world, player): # saved fish prize world.prizes[player]['fish'] = prizes.pop() - world.prizes[player]['enemies'] = prizes \ No newline at end of file + world.prizes[player]['enemies'] = prizes diff --git a/ItemList.py b/ItemList.py index 693fa96d..387e1d9b 100644 --- a/ItemList.py +++ b/ItemList.py @@ -1146,7 +1146,7 @@ def get_pool_core(world, player, progressive, shuffle, difficulty, treasure_hunt else: pool.extend(diff.basicarmor) - if 'silvers' not in world.bow_mode[player]: + if 'silvers' not in world.bow_mode[player] and world.big_chest_items[player] != 'vanilla': pool.extend(['Progressive Bow'] * 2) elif swords != 'swordless': pool.extend(diff.basicbow) diff --git a/Main.py b/Main.py index 67c4c01e..ee2101fa 100644 --- a/Main.py +++ b/Main.py @@ -26,7 +26,7 @@ from Rules import set_rules from Dungeons import create_dungeons from Fill import distribute_items_restrictive, promote_dungeon_items, fill_dungeons_restrictive, ensure_good_items from Fill import dungeon_tracking -from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression, lock_shop_locations, set_prize_drops +from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression, lock_shop_locations, set_prize_drops, fill_vanilla_big_chests from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops, fill_specific_items, create_farm_locations, shuffle_event_items, follower_pickups from UnderworldGlitchRules import connect_hmg_entrances_regions, create_hmg_entrances_regions from Utils import output_path, parse_player_names @@ -254,6 +254,8 @@ def main(args, seed=None, fish=None): logger.info(world.fish.translate("cli","cli","placing.dungeon.items")) + fill_vanilla_big_chests(world) + if args.algorithm != 'equitable': shuffled_locations = world.get_unfilled_locations() random.shuffle(shuffled_locations) @@ -520,6 +522,7 @@ def init_world(args, fish): world.overworld_map = args.overworld_map.copy() world.take_any = args.take_any.copy() world.restrict_boss_items = args.restrict_boss_items.copy() + world.big_chest_items = args.big_chest_items.copy() world.collection_rate = args.collection_rate.copy() world.colorizepots = args.colorizepots.copy() world.aga_randomness = args.aga_randomness.copy() @@ -652,6 +655,7 @@ def copy_world(world): ret.allow_flip_sanc = world.allow_flip_sanc.copy() ret.prizes = world.prizes.copy() ret.restrict_boss_items = world.restrict_boss_items.copy() + ret.big_chest_items = world.big_chest_items.copy() ret.inaccessible_regions = world.inaccessible_regions.copy() ret.damage_table = world.damage_table ret.data_tables = world.data_tables # can be changed... @@ -877,6 +881,7 @@ def copy_world_premature(world, player): ret.allow_flip_sanc = world.allow_flip_sanc.copy() ret.prizes = world.prizes.copy() ret.restrict_boss_items = world.restrict_boss_items.copy() + ret.big_chest_items = world.big_chest_items.copy() ret.inaccessible_regions = world.inaccessible_regions.copy() ret.damage_table = world.damage_table ret.data_tables = world.data_tables # can be changed... diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 94308c69..05150c3e 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -461,6 +461,12 @@ "dungeon" ] }, + "big_chest_items": { + "choices": [ + "random", + "vanilla" + ] + }, "hints": { "action": "store_true", "type": "bool"