Allow Plando'ing Dungeon Prizes

There be dragons beyond this point.
This commit is contained in:
Fabian Dill 2021-01-24 08:26:39 +01:00
parent ba224535dc
commit 441fa3e5db
3 changed files with 22 additions and 11 deletions

View File

@ -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), 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('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)] 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] 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): for attempt in range(attempts):
try: try:
prizepool = list(unplaced_prizes) prizepool = list(unplaced_prizes)

View File

@ -178,14 +178,14 @@ def main(args, seed=None):
for player in range(1, world.players + 1): for player in range(1, world.players + 1):
set_rules(world, player) set_rules(world, player)
logger.info('Placing Dungeon Prizes.')
fill_prizes(world)
logger.info("Running Item Plando") logger.info("Running Item Plando")
distribute_planned(world) distribute_planned(world)
logger.info('Placing Dungeon Prizes.')
fill_prizes(world)
logger.info('Placing Dungeon Items.') logger.info('Placing Dungeon Items.')
if args.algorithm in ['balanced', 'vt26'] or any( if args.algorithm in ['balanced', 'vt26'] or any(

View File

@ -75,20 +75,22 @@ boss_shuffle:
- items denotes the items to use, can be given a number to have multiple of that item - 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 - locations lists the possible locations those items can be placed in
- placements are picked randomly, not sorted in any way - 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 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) - [Available Locations](https://github.com/Berserker66/MultiWorld-Utilities/blob/3b5ba161dea223b96e9b1fc890e03469d9c6eb59/Regions.py#L418)
#### Examples #### Examples
```yaml ```yaml
plando_items: plando_items:
- item: - item: # 1
Lamp: 1 Lamp: 1
Fire Rod: 1 Fire Rod: 1
location: Link's House location: Link's House
from_pool: true from_pool: true
world: true world: true
percentage: 50 percentage: 50
- items: - items: # 2
Progressive Sword: 4 Progressive Sword: 4
Progressive Bow: 1 Progressive Bow: 1
Progressive Bow (Alt): 1 Progressive Bow (Alt): 1
@ -104,12 +106,21 @@ plando_items:
- Turtle Rock - Big Chest - Turtle Rock - Big Chest
- Palace of Darkness - Big Chest - Palace of Darkness - Big Chest
world: false 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. Link's House and removes the picked item from the item pool.
2. Always triggers and places the Swords and Bows into one's own Big Chests
The second example 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 ### Texts
- This module is disabled by default. - This module is disabled by default.