Fixed bug/oversight with vanilla_fill and prize_shuffle
This commit is contained in:
17
Fill.py
17
Fill.py
@@ -111,7 +111,7 @@ def fill_dungeons_restrictive(world, shuffled_locations):
|
|||||||
for attempt in range(15):
|
for attempt in range(15):
|
||||||
try:
|
try:
|
||||||
for player in range(1, world.players + 1):
|
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 = []
|
dungeon_pool = []
|
||||||
for dungeon in world.dungeons:
|
for dungeon in world.dungeons:
|
||||||
from Dungeons import dungeon_table
|
from Dungeons import dungeon_table
|
||||||
@@ -143,6 +143,14 @@ def fill_dungeons_restrictive(world, shuffled_locations):
|
|||||||
else:
|
else:
|
||||||
raise FillError(f'Unable to place dungeon prizes: {", ".join(list(map(lambda d: d.name, prizes)))}')
|
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)
|
random.shuffle(shuffled_locations)
|
||||||
fill(all_state_base, others, 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()
|
test_state.sweep_for_events()
|
||||||
if location.can_fill(test_state, item_to_place, perform_access_check):
|
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 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):
|
or valid_dungeon_placement(item_to_place, location, world):
|
||||||
return location
|
return location
|
||||||
if item_to_place.smallkey or item_to_place.bigkey or item_to_place.prize:
|
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:
|
if item.prize:
|
||||||
location.parent_region.dungeon.prize = item
|
location.parent_region.dungeon.prize = item
|
||||||
item.dungeon_object = location.parent_region.dungeon
|
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):
|
def is_dungeon_item(item, world):
|
||||||
|
|||||||
@@ -120,9 +120,6 @@ def create_item_pool_config(world):
|
|||||||
LocationGroup('bkgt').locs(mode_grouping['GT Trash'])]
|
LocationGroup('bkgt').locs(mode_grouping['GT Trash'])]
|
||||||
for loc_name in mode_grouping['Big Chests'] + mode_grouping['Heart Containers']:
|
for loc_name in mode_grouping['Big Chests'] + mode_grouping['Heart Containers']:
|
||||||
config.reserved_locations[player].add(loc_name)
|
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':
|
elif world.algorithm == 'major_only':
|
||||||
config.location_groups = [
|
config.location_groups = [
|
||||||
LocationGroup('MajorItems'),
|
LocationGroup('MajorItems'),
|
||||||
|
|||||||
Reference in New Issue
Block a user