entrances and locations

This commit is contained in:
qadan 2020-01-06 13:48:14 -05:00
parent f151b05b49
commit 62e84dfafd
1 changed files with 93 additions and 37 deletions

130
Rules.py
View File

@ -713,57 +713,113 @@ def add_conditional_lamps(world, player):
def overworld_glitches_rules(world, player):
# spots that are immediately accessible
# spots that are immediately accessible due to fake flippering
set_rule(world.get_entrance('Hobo Bridge', player), lambda state: True)
set_rule(world.get_region('Lake Hylia Central Island', player), lambda state: True)
set_rule(world.get_entrance('Zoras River', player), lambda state: True)
# lw boots-accessible locations
lw_boots_accessible_regions = [
# boots-accessible stuff
lw_boots_accessible_entrances = [
'Bat Cave Drop Ledge',
'Bat Cave Drop Ledge Mirror Spot',
'Lake Hylia Island Mirror Spot',
'Desert Ledge Return Rocks',
'Desert Ledge Mirror Spot',
'Checkerboard Cave',
'Old Man House Exit (Bottom)',
'Desert Ledge (Northeast) Mirror Spot',
'Death Mountain Return Cave Exit (East)',
'Desert Palace Entrance (North) Rocks',
'Desert Palace Entrance (North) Mirror Spot',
'Flute Spot 1',
'Broken Bridge (East)',
'Death Mountain Drop',
'Death Mountain Return Cave Exit (West)',
'Old Man Cave Exit (East)',
'Bumper Cave Ledge Mirror Spot',
'Broken Bridge (West)',
'East Death Mountain Drop',
'Spiral Cave Ledge Drop',
'Fairy Ascension Drop',
'East Death Mountain (Top)',
'East Death Mountain (Top) Mirror Spot',
'Death Mountain (Top)',
'Spectacle Rock Drop',
'Spectacle Rock Mirror Spot',
'Floating Island Mirror Spot',
'Fairy Ascension Cave Exit (Top)',
'Fairy Ascension Cave Exit (Bottom)',
'Death Mountain Return Cave Exit (East)',
'Spiral Cave Exit',
]
lw_boots_accessible_locations = [
'Lake Hylia Island',
'Desert Ledge',
'Desert Ledge (Northeast)',
'Desert Palace Lone Stairs',
'Desert Palace Entrance (North) Spot',
'Death Mountain',
'Death Mountain Return Ledge',
'East Death Mountain (Bottom)',
'East Death Mountain (Top)',
'Death Mountain (Top)',
'Ether Tablet',
'Spectacle Rock',
'Death Mountain Floating Island (Light World)',
'Floating Island',
]
# dw boots-accessible regions
dw_boots_accessible_regions = [
'East Dark World',
'Northeast Dark World',
'West Dark World',
'Hammer Peg Area',
dw_boots_accessible_entrances = [
'Northeast Dark World Broken Bridge Pass',
'Death Mountain Return Cave Exit (West)',
'Peg Area Rocks',
'Grassy Lawn Pegs',
'West Dark World Gap',
'Bumper Cave Ledge Drop',
'Turtle Rock Ledge Exit (West)',
'Turtle Rock Isolated Ledge Exit',
'Dark Desert Teleporter',
'Turtle Rock Exit (Front)',
'Turtle Rock Drop',
'Floating Island Drop',
'Turtle Rock Ledge Exit (East)',
'Dark Death Mountain Drop (East)',
'Village of Outcasts Drop',
'Dark Lake Hylia Ledge',
'Hype Cave',
'Dark World Potion Shop',
'Big Bomb Shop',
'Archery Game',
'Brewery',
'C-Shaped House',
'Chest Game',
'Thieves Town',
'Graveyard Ledge Mirror Spot',
'Kings Grave Mirror Spot',
'Bumper Cave Entrance Rock',
'Red Shield Shop',
'Dark Sanctuary Hint',
'Fortune Teller (Dark)',
'Dark World Lumberjack Shop',
]
dw_boots_accessible_locations = [
'Catfish',
'Frog',
'Dark Blacksmith Ruins',
'Bumper Cave Ledge',
'Dark Desert',
'Dark Death Mountain (Top)',
'Dark Death Mountain (East Bottom)',
'Dark Death Mountain Ledge',
'Death Mountain Floating Island (Dark World)',
'Turtle Rock (Top)',
]
# set up boots-accessible regions
if world.mode[player] != 'inverted':
lw_boots_accessible_regions.append('Cave 45 Ledge')
lw_boots_accessible_regions.append('Graveyard Ledge')
lw_boots_accessible_entrances.append('Cave 45 Mirror Spot')
lw_boots_accessible_entrances.append('Graveyard Ledge Mirror Spot')
# couple other random spots
set_rule(world.get_location('Bombos Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_beam_sword(player) and (state.has_Mirror(player) or state.has_Boots(player)))
set_rule(world.get_entrance('Dark Desert Teleporter', player), lambda state: (state.has('Ocarina', player) or state.has_Boots(player)) and state.can_lift_heavy_rocks(player))
set_rule(world.get_entrance('Dark Desert Teleporter', player), lambda state: state.has('Ocarina', player) or (state.has_Boots(player) and state.can_lift_heavy_rocks(player)))
set_rule(world.get_location('Zora\'s Ledge', player), lambda state: state.has_Boots(player))
add_rule(world.get_entrance('Ganons Tower', player), lambda state: state.has_Boots(player) and state.has_Pearl(player), 'or')
add_rule(world.get_entrance('East Death Mountain Teleporter', player), lambda state: state.can_lift_heavy_rocks(player) and state.has_Boots(player), 'or')
add_rule(world.get_entrance('Turtle Rock Teleporter', player), lambda state: state.has_Boots(player) and state.has('Hammer', player))
needs_boots = lambda state: state.has_Boots(player)
needs_boots_and_pearl = lambda state: state.has_Boots(player) and state.has_Pearl(player)
for spot in lw_boots_accessible_regions:
for location in world.get_region(spot, player).locations:
add_rule(world.get_location(location, player), needs_boots_and_pearl if world.mode[player] == 'inverted' else needs_boots, 'or')
for spot in dw_boots_accessible_regions:
for location in world.get_region(spot, player).locations:
add_rule(world.get_location(location, player), needs_boots if world.mode[player] == 'inverted' else needs_boots_and_pearl, 'or')
for entrance in lw_boots_accessible_entrances:
add_rule(world.get_entrance(entrance, player), needs_boots_and_pearl if world.mode[player] == 'inverted' else needs_boots, 'or')
for location in lw_boots_accessible_locations:
add_rule(world.get_location(location, player), needs_boots_and_pearl if world.mode[player] == 'inverted' else needs_boots, 'or')
# no inverted rules here; no DMD bunny known so far
for entrance in dw_boots_accessible_entrances:
add_rule(world.get_entrance(entrance, player), needs_boots_and_pearl, 'or')
for location in dw_boots_accessible_locations:
add_rule(world.get_location(location, player), needs_boots_and_pearl, 'or')
# bunny DMD rules
if world.mode[player] != 'inverted':
# set up some mirror-accessible dw entrances.
@ -779,13 +835,13 @@ def overworld_glitches_rules(world, player):
]
mirror_hookshot_accessible_dw_locations.extend(world.get_region('Dark Death Mountain Ledge', player).locations)
for spot in mirror_hookshot_accessible_dw_locations:
add_rule(world.get_entrance(spot, player), lambda state: state.has_Boots(player) and state.has_Mirror(player) and state.has('Hookshot', player), 'or')
add_rule(world.get_entrance(spot, player), lambda state: state.has_Mirror(player) and state.has('Hookshot', player), 'or')
# dw entrances accessible with mirror and titans
boots_mirror_titans = lambda state: state.has_Boots(player) and state.has_Mirror(player) and state.can_lift_heavy_rocks(player)
boots_mirror_titans = lambda state: state.has_Mirror(player) and state.can_lift_heavy_rocks(player)
add_rule(world.get_entrance('Mire Shed', player), boots_mirror_titans, 'or')
add_rule(world.get_location('Frog', player), boots_mirror_titans, 'or')
# all entrances you can't mirror bunny into
# all entrances you can't mirror bunny into. @todo: use for inverted
invalid_mirror_bunny_entrances_lw = [
'Bonk Rock Cave',
'Bonk Fairy (Light)',
@ -1372,7 +1428,7 @@ def set_bunny_rules(world, player):
def get_rule_to_add(region, location = None):
if not region.is_light_world:
if location in superbunny_accessible_locations and region.name not in invalid_mirror_bunny_entrances_dw:
if world.logic[player] == 'owglitches' and location in superbunny_accessible_locations and region.name not in invalid_mirror_bunny_entrances_dw:
return lambda state: (state.can_reach(region) and state.has_Mirror(player)) or state.has_Pearl(player)
return lambda state: state.has_Pearl(player)
# in this case we are mixed region.