Merged in DR v1.4.1.12

This commit is contained in:
codemann8
2024-05-23 21:49:24 -05:00
26 changed files with 557 additions and 3048 deletions

View File

@@ -271,6 +271,24 @@ def previously_reserved(location, world, player):
return False
def verify_item_pool_config(world):
if world.algorithm == 'major_only':
major_pool = defaultdict(list)
for item in world.itempool:
if item.name in world.item_pool_config.item_pool[item.player]:
major_pool[item.player].append(item)
for player in major_pool:
available_locations = [world.get_location(l, player) for l in world.item_pool_config.location_groups[0].locations]
available_locations = [l for l in available_locations if l.item is None]
if len(available_locations) < len(major_pool[player]):
if len(major_pool[player]) - len(available_locations) <= len(mode_grouping['Heart Pieces Visible']):
logging.getLogger('').warning('Expanding location pool for extra major items')
world.item_pool_config.location_groups[1].locations = set(mode_grouping['Heart Pieces Visible'])
else:
raise Exception(f'Major only: there are only {len(available_locations)} locations'
f' for {len(major_pool[player])} major items for player {player}. Cannot generate.')
def massage_item_pool(world):
player_pool = defaultdict(list)
dungeon_pool = defaultdict(list)
@@ -434,6 +452,9 @@ def filter_locations(item_to_place, locations, world, vanilla_skip=False, potion
if item_to_place.name in config.item_pool[item_to_place.player]:
restricted = config.location_groups[0].locations
filtered = [l for l in locations if l.name in restricted]
if len(filtered) == 0 and len(config.location_groups[1].locations) > 0:
restricted = config.location_groups[1].locations
filtered = [l for l in locations if l.name in restricted]
return filtered
if world.algorithm == 'district':
config = world.item_pool_config
@@ -711,7 +732,13 @@ mode_grouping = {
'Prizes': [
'Eastern Palace - Prize', 'Desert Palace - Prize', 'Tower of Hera - Prize',
'Palace of Darkness - Prize', 'Swamp Palace - Prize', 'Skull Woods - Prize',
"Thieves' Town - Prize", 'Ice Palace - Prize', 'Misery Mire - Prize', 'Turtle Rock - Prize',
"Thieves' Town - Prize", 'Ice Palace - Prize', 'Misery Mire - Prize', 'Turtle Rock - Prize'
],
'Heart Pieces Visible': [
'Bumper Cave Ledge', 'Desert Ledge', 'Lake Hylia Island', 'Floating Island', # visible on OW
'Maze Race', 'Pyramid', "Zora's Ledge", 'Sunken Treasure', 'Spectacle Rock',
'Lumberjack Tree', 'Spectacle Rock Cave', 'Lost Woods Hideout', 'Checkerboard Cave',
'Peg Cave', 'Cave 45', 'Graveyard Cave'
],
'Big Keys': [
'Eastern Palace - Big Key Chest', 'Ganons Tower - Big Key Chest',
@@ -784,7 +811,7 @@ mode_grouping = {
'Castle Tower - Dark Archer Key Drop', 'Castle Tower - Circle of Pots Key Drop',
'Skull Woods - Spike Corner Key Drop', 'Ice Palace - Jelly Key Drop', 'Ice Palace - Conveyor Key Drop',
'Misery Mire - Conveyor Crystal Key Drop', 'Turtle Rock - Pokey 1 Key Drop',
'Turtle Rock - Pokey 2 Key Drop', 'Ganons Tower - Mini Helmasuar Key Drop',
'Turtle Rock - Pokey 2 Key Drop', 'Ganons Tower - Mini Helmasaur Key Drop',
],
'Pot Keys': [
'Eastern Palace - Dark Square Pot Key', 'Desert Palace - Desert Tiles 1 Pot Key',