Fixed bug/oversight with vanilla_fill and prize_shuffle

This commit is contained in:
codemann8
2026-03-15 16:32:54 -05:00
parent 3547aef480
commit 0dbae8e21e
2 changed files with 15 additions and 5 deletions

17
Fill.py
View File

@@ -111,7 +111,7 @@ def fill_dungeons_restrictive(world, shuffled_locations):
for attempt in range(15):
try:
for player in range(1, world.players + 1):
if world.prizeshuffle[player] == 'nearby':
if world.prizeshuffle[player] == 'nearby' and world.algorithm != 'vanilla_fill':
dungeon_pool = []
for dungeon in world.dungeons:
from Dungeons import dungeon_table
@@ -143,6 +143,14 @@ def fill_dungeons_restrictive(world, shuffled_locations):
else:
raise FillError(f'Unable to place dungeon prizes: {", ".join(list(map(lambda d: d.name, prizes)))}')
if world.algorithm == 'vanilla_fill':
for prize in prizes_copy:
if prize.is_near_dungeon_item(world):
if prize.location and prize.location.parent_region.dungeon:
dungeon = prize.location.parent_region.dungeon
dungeon.prize = prize
prize.dungeon_object = dungeon
random.shuffle(shuffled_locations)
fill(all_state_base, others, shuffled_locations)
@@ -234,7 +242,8 @@ def verify_spot_to_fill(location, item_to_place, max_exp_state, single_player_pl
test_state.sweep_for_events()
if location.can_fill(test_state, item_to_place, perform_access_check):
if valid_key_placement(item_to_place, location, key_pool, test_state, world):
if (item_to_place.prize and world.prizeshuffle[item_to_place.player] == 'none') \
if (item_to_place.prize and (world.prizeshuffle[item_to_place.player] == 'none' \
or (world.algorithm == 'vanilla_fill' and item_to_place.is_near_dungeon_item(world)))) \
or valid_dungeon_placement(item_to_place, location, world):
return location
if item_to_place.smallkey or item_to_place.bigkey or item_to_place.prize:
@@ -330,6 +339,10 @@ def track_dungeon_items(item, location, world):
if item.prize:
location.parent_region.dungeon.prize = item
item.dungeon_object = location.parent_region.dungeon
elif world.algorithm == 'vanilla_fill' and item.prize and location.parent_region.dungeon:
dungeon = location.parent_region.dungeon
dungeon.prize = item
item.dungeon_object = dungeon
def is_dungeon_item(item, world):

View File

@@ -120,9 +120,6 @@ def create_item_pool_config(world):
LocationGroup('bkgt').locs(mode_grouping['GT Trash'])]
for loc_name in mode_grouping['Big Chests'] + mode_grouping['Heart Containers']:
config.reserved_locations[player].add(loc_name)
if world.prizeshuffle[player] != 'none':
for loc_name in mode_grouping['Prizes']:
config.reserved_locations[player].add(loc_name)
elif world.algorithm == 'major_only':
config.location_groups = [
LocationGroup('MajorItems'),