Fill: create minimal excluded location rule only once

This commit is contained in:
Fabian Dill 2022-10-14 03:56:03 +02:00 committed by Fabian Dill
parent 722b3c5369
commit 0aea1e780f
1 changed files with 6 additions and 3 deletions

View File

@ -233,9 +233,12 @@ def accessibility_corrections(world: MultiWorld, state: CollectionState, locatio
def inaccessible_location_rules(world: MultiWorld, state: CollectionState, locations):
maximum_exploration_state = sweep_from_pool(state, [])
unreachable_locations = [location for location in locations if not location.can_reach(maximum_exploration_state)]
for location in unreachable_locations:
add_item_rule(location, lambda item: not ((item.classification & 0b0011) and
world.accessibility[item.player] != 'minimal'))
if unreachable_locations:
def forbid_important_item_rule(item: Item):
return not (item.classification & 0b0011) and world.accessibility[item.player] != 'minimal'
for location in unreachable_locations:
add_item_rule(location, forbid_important_item_rule)
def distribute_items_restrictive(world: MultiWorld) -> None: