Simple key logic for Escape

Adds ability to make a location for required keys (enemy drops and pots), so the filler knows about them.

Uses the most pessimistic possible rule to make sure you can't keylock yourself in Escape.
This commit is contained in:
tolmar
2019-09-15 02:28:04 -07:00
parent 3a872723b0
commit 40f345df13
3 changed files with 33 additions and 7 deletions

View File

@@ -262,6 +262,17 @@ def global_rules(world, player):
# TODO: Do these need to flag off when door rando is off?
# TODO: Can these replace other rules?
# Hyrule Castle: Can't get keys from guards unless you can kill said guards.
add_rule(world.get_location('Hyrule Castle - Map Guard Key Drop', player), lambda state: state.can_kill_most_things(player))
add_rule(world.get_location('Hyrule Castle - Boomerang Guard Key Drop', player), lambda state: state.can_kill_most_things(player))
# Hyrule Castle: There are three keys and we don't know how we shuffled, so we
# need three keys to be accessible before you use any of these doors.
# TODO: Generate key rules in the shuffler. (But make sure this way works first.)
for door in ['Sewers Key Rat Key Door N', 'Sewers Secret Room Key Door S',
'Sewers Dark Cross Key Door N', 'Sewers Dark Cross Key Door S', 'Hyrule Dungeon Armory Interior Key Door N', 'Hyrule Dungeon Armory Interior Key Door S', 'Hyrule Dungeon Map Room Key Door S', 'Hyrule Dungeon North Abyss Key Door N']:
set_rule(world.get_entrance(door, player), lambda state: state.has_key('Small Key (Escape)', player, 3))
# Sewers: All sorts of things need lamps
# TODO: Need to play nice with other complicated lamp rules
set_rule(world.get_entrance('Sewers Behind Tapestry S', player), lambda state: state.has('Lamp', player))