LttP: keep Small Key Hyrule Castle local even if keyshuffle is wished.
This commit is contained in:
parent
111b7e204f
commit
651e22b14a
|
@ -350,16 +350,16 @@ class ALTTPWorld(World):
|
||||||
# Make sure the escape small key is placed first in standard with key shuffle to prevent running out of spots
|
# Make sure the escape small key is placed first in standard with key shuffle to prevent running out of spots
|
||||||
# TODO: this might be worthwhile to introduce as generic option for various games and then optimize it
|
# TODO: this might be worthwhile to introduce as generic option for various games and then optimize it
|
||||||
if standard_keyshuffle_players:
|
if standard_keyshuffle_players:
|
||||||
viable = []
|
viable = {}
|
||||||
for location in world.get_locations():
|
for location in world.get_locations():
|
||||||
if location.player in standard_keyshuffle_players \
|
if location.player in standard_keyshuffle_players \
|
||||||
and location.item is None \
|
and location.item is None \
|
||||||
and location.can_reach(world.state):
|
and location.can_reach(world.state):
|
||||||
viable.append(location)
|
viable.setdefault(location.player, []).append(location)
|
||||||
world.random.shuffle(viable)
|
|
||||||
for player in standard_keyshuffle_players:
|
for player in standard_keyshuffle_players:
|
||||||
|
loc = world.random.choice(viable[player])
|
||||||
key = world.create_item("Small Key (Hyrule Castle)", player)
|
key = world.create_item("Small Key (Hyrule Castle)", player)
|
||||||
loc = viable.pop()
|
|
||||||
loc.place_locked_item(key)
|
loc.place_locked_item(key)
|
||||||
fill_locations.remove(loc)
|
fill_locations.remove(loc)
|
||||||
world.random.shuffle(fill_locations)
|
world.random.shuffle(fill_locations)
|
||||||
|
|
Loading…
Reference in New Issue