From 441fa3e5db121c84d4574bcf1054211f4f51b68e Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 24 Jan 2021 08:26:39 +0100 Subject: [PATCH] Allow Plando'ing Dungeon Prizes There be dragons beyond this point. --- ItemPool.py | 4 ++-- Main.py | 8 +++---- .../assets/tutorial/zelda3/plando_en.md | 21 ++++++++++++++----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ItemPool.py b/ItemPool.py index 832531e1..3bb9f13e 100644 --- a/ItemPool.py +++ b/ItemPool.py @@ -602,9 +602,9 @@ def fill_prizes(world, attempts=15): crystal_locations = [world.get_location('Turtle Rock - Prize', player), world.get_location('Eastern Palace - Prize', player), world.get_location('Desert Palace - Prize', player), world.get_location('Tower of Hera - Prize', player), world.get_location('Palace of Darkness - Prize', player), world.get_location('Thieves\' Town - Prize', player), world.get_location('Skull Woods - Prize', player), world.get_location('Swamp Palace - Prize', player), world.get_location('Ice Palace - Prize', player), world.get_location('Misery Mire - Prize', player)] - placed_prizes = [loc.item.name for loc in crystal_locations if loc.item is not None] + placed_prizes = {loc.item.name for loc in crystal_locations if loc.item} unplaced_prizes = [crystal for crystal in crystals if crystal.name not in placed_prizes] - empty_crystal_locations = [loc for loc in crystal_locations if loc.item is None] + empty_crystal_locations = [loc for loc in crystal_locations if not loc.item] for attempt in range(attempts): try: prizepool = list(unplaced_prizes) diff --git a/Main.py b/Main.py index 7a4c8bab..29f70017 100644 --- a/Main.py +++ b/Main.py @@ -178,14 +178,14 @@ def main(args, seed=None): for player in range(1, world.players + 1): set_rules(world, player) - logger.info('Placing Dungeon Prizes.') - - fill_prizes(world) - logger.info("Running Item Plando") distribute_planned(world) + logger.info('Placing Dungeon Prizes.') + + fill_prizes(world) + logger.info('Placing Dungeon Items.') if args.algorithm in ['balanced', 'vt26'] or any( diff --git a/WebHostLib/static/assets/tutorial/zelda3/plando_en.md b/WebHostLib/static/assets/tutorial/zelda3/plando_en.md index 7eeac95f..ad7bc830 100644 --- a/WebHostLib/static/assets/tutorial/zelda3/plando_en.md +++ b/WebHostLib/static/assets/tutorial/zelda3/plando_en.md @@ -75,20 +75,22 @@ boss_shuffle: - items denotes the items to use, can be given a number to have multiple of that item - locations lists the possible locations those items can be placed in - placements are picked randomly, not sorted in any way +- Warning: Placing non-Dungeon Prizes on Prize locations and + Prizes on non-Prize locations will break the game in various ways. - [Available Items](https://github.com/Berserker66/MultiWorld-Utilities/blob/3b5ba161dea223b96e9b1fc890e03469d9c6eb59/Items.py#L26) - [Available Locations](https://github.com/Berserker66/MultiWorld-Utilities/blob/3b5ba161dea223b96e9b1fc890e03469d9c6eb59/Regions.py#L418) #### Examples ```yaml plando_items: - - item: + - item: # 1 Lamp: 1 Fire Rod: 1 location: Link's House from_pool: true world: true percentage: 50 - - items: + - items: # 2 Progressive Sword: 4 Progressive Bow: 1 Progressive Bow (Alt): 1 @@ -104,12 +106,21 @@ plando_items: - Turtle Rock - Big Chest - Palace of Darkness - Big Chest world: false + - items: # 3 + Red Pendant: 1 + Green Pendant: 1 + Blue Pendant: 1 + locations: + - Desert Palace - Prize + - Eastern Palace - Prize + - Tower of Hera - Prize + from_pool: true ``` -The first example has a 50% chance to occur, which if it does places either the Lamp or Fire Rod in one's own +1. has a 50% chance to occur, which if it does places either the Lamp or Fire Rod in one's own Link's House and removes the picked item from the item pool. - -The second example always triggers and places the Swords and Bows into one's own Big Chests +2. Always triggers and places the Swords and Bows into one's own Big Chests +3. Locks Pendants to The Light World and therefore Crystals to dark world ### Texts - This module is disabled by default.