remove keys option for get_all_state, collect dungeon-local keys, and fix all uses of the state

This commit is contained in:
espeon65536
2021-08-31 19:19:26 -05:00
committed by Fabian Dill
parent 7972aa6320
commit 631b6788c6
4 changed files with 11 additions and 25 deletions

View File

@@ -157,6 +157,8 @@ def fill_dungeons_restrictive(autoworld, world):
in_dungeon_items.sort(
key=lambda item: sort_order.get(item.type, 1) +
(5 if (item.player, item.name) in dungeon_specific else 0))
for item in in_dungeon_items:
all_state_base.remove(item)
fill_restrictive(world, all_state_base, locations, in_dungeon_items, True, True)

View File

@@ -853,7 +853,7 @@ def set_trock_key_rules(world, player):
for entrance in ['Turtle Rock Dark Room Staircase', 'Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)', 'Turtle Rock Pokey Room', 'Turtle Rock Big Key Door']:
set_rule(world.get_entrance(entrance, player), lambda state: False)
all_state = world.get_all_state(True)
all_state = world.get_all_state()
all_state.reachable_regions[player] = set() # wipe reachable regions so that the locked doors actually work
# Check if each of the four main regions of the dungoen can be reached. The previous code section prevents key-costing moves within the dungeon.

View File

@@ -212,7 +212,7 @@ class ALTTPWorld(World):
attempts = 5
world = self.world
player = self.player
all_state = world.get_all_state(keys=True)
all_state = world.get_all_state()
crystals = [self.create_item(name) for name in ['Red Pendant', 'Blue Pendant', 'Green Pendant', 'Crystal 1', 'Crystal 2', 'Crystal 3', 'Crystal 4', 'Crystal 7', 'Crystal 5', 'Crystal 6']]
crystal_locations = [world.get_location('Turtle Rock - Prize', player),
world.get_location('Eastern Palace - Prize', player),