rework as region connectors (inverted will be broken)

This commit is contained in:
qadan
2020-02-10 23:54:35 -04:00
parent 2b44792f70
commit aa569d1c3d
6 changed files with 528 additions and 592 deletions

View File

@@ -398,7 +398,8 @@ def default_rules(world, player):
set_rule(world.get_entrance('Turtle Rock Teleporter', player), lambda state: state.can_lift_heavy_rocks(player) and state.has('Hammer', player))
set_rule(world.get_entrance('East Death Mountain (Top)', player), lambda state: state.has('Hammer', player))
set_rule(world.get_location('Catfish', player), lambda state: state.can_lift_rocks(player))
set_rule(world.get_entrance('Catfish Exit Rock', player), lambda state: state.can_lift_rocks(player))
set_rule(world.get_entrance('Catfish Entrance Rock', player), lambda state: state.can_lift_rocks(player))
set_rule(world.get_entrance('Northeast Dark World Broken Bridge Pass', player), lambda state: state.has_Pearl(player) and (state.can_lift_rocks(player) or state.has('Hammer', player) or state.has('Flippers', player)))
set_rule(world.get_entrance('East Dark World Broken Bridge Pass', player), lambda state: state.has_Pearl(player) and (state.can_lift_rocks(player) or state.has('Hammer', player)))
set_rule(world.get_entrance('South Dark World Bridge', player), lambda state: state.has('Hammer', player) and state.has_Pearl(player))
@@ -467,6 +468,20 @@ def default_rules(world, player):
set_rule(world.get_entrance('Ganons Tower', player), lambda state: state.has_crystals(world.crystals_needed_for_gt[player], player))
def forbid_overworld_glitches(world, player):
for exit in OWGSets.get_boots_clip_exits_lw():
set_rule(world.get_entrance(exit, player), lambda state: False)
for exit in OWGSets.get_boots_clip_exits_dw():
set_rule(world.get_entrance(exit, player), lambda state: False)
for exit in OWGSets.get_glitched_speed_drops_lw():
set_rule(world.get_entrance(exit, player), lambda state: False)
for exit in OWGSets.get_glitched_speed_drops_dw():
set_rule(world.get_entrance(exit, player), lambda state: False)
for exit in OWGSets.get_mirror_clip_spots_dw():
set_rule(world.get_entrance(exit, player), lambda state: False)
def inverted_rules(world, player):
# s&q regions. link's house entrance is set to true so the filler knows the chest inside can always be reached
world.get_region('Inverted Links House', player).can_reach_private = lambda state: True
@@ -644,6 +659,7 @@ def no_glitches_rules(world, player):
add_rule(world.get_entrance('Ganons Tower (Double Switch Room)', player), lambda state: state.has('Hookshot', player))
set_rule(world.get_entrance('Paradox Cave Push Block Reverse', player), lambda state: False) # no glitches does not require block override
forbid_bomb_jump_requirements(world, player)
forbid_overworld_glitches(world, player)
add_conditional_lamps(world, player)
@@ -731,46 +747,22 @@ def overworld_glitches_rules(world, player):
set_rule(world.get_entrance(entrance, player), lambda state: True)
# Boots-accessible locations.
for entrance in OWGSets.get_lw_boots_accessible_entrances(world, player):
add_rule(world.get_entrance(entrance, player), lambda state: state.can_boots_clip_lw(player), 'or')
for location in OWGSets.get_lw_boots_accessible_locations():
add_rule(world.get_location(location, player), lambda state: state.can_boots_clip_lw(player), 'or')
for entrance in OWGSets.get_dw_boots_accessible_entrances(world, player):
add_rule(world.get_entrance(entrance, player), lambda state: state.can_boots_clip_dw(player), 'or')
for location in OWGSets.get_dw_boots_accessible_locations():
add_rule(world.get_location(location, player), lambda state: state.can_boots_clip_dw(player), 'or')
for entrance in OWGSets.get_boots_clip_exits_lw():
set_rule(world.get_entrance(entrance, player), lambda state: state.can_boots_clip_lw(player))
for entrance in OWGSets.get_boots_clip_exits_dw():
set_rule(world.get_entrance(entrance, player), lambda state: state.can_boots_clip_dw(player))
# Boots-accessible regions.
boots_and_mirror = lambda state: state.has_Boots(player) and state.has_Mirror(player)
if world.mode[player] != 'inverted':
for boots_accessible_region in OWGSets.get_boots_accessible_regions_lw():
region = world.get_region(boots_accessible_region, player)
region.can_reach_private = lambda state: region.can_reach(state) or state.has_Boots(player)
# DMD with and without bunny.
for dmd_bunny_region in OWGSets.get_dmd_and_bunny_regions():
region = world.get_region(dmd_bunny_region, player)
region.can_reach_private = lambda state: region.can_reach(state) or (state.can_boots_clip_dw(player) or state.can_bunny_dmd(player))
for non_dmd_bunny_region in OWGSets.get_dmd_non_bunny_regions():
region = world.get_region(non_dmd_bunny_region, player)
region.can_reach_private = lambda state: region.can_reach(state) or state.can_boots_clip_dw(player)
edmb = world.get_region('Dark Death Mountain (East Bottom)', player)
edmb.can_reach_private = lambda state: edmb.can_reach(state) or state.can_bunny_dmd(player)
# Glitched speed drops.
for drop in OWGSets.get_glitched_speed_drops_lw():
set_rule(world.get_entrance(drop, player), lambda state: state.can_get_glitched_speed_lw(player))
for drop in OWGSets.get_glitched_speed_drops_dw():
set_rule(world.get_entrance(drop, player), lambda state: state.can_get_glitched_speed_dw(player))
# Dark Death Mountain Ledge Clip Spot also accessible with mirror.
add_rule(world.get_entrance('Dark Death Mountain Ledge Clip Spot', player), lambda state: state.has_Mirror(player), 'or')
# Set up some mirror-accessible DW entrances.
for spot in world.get_region('West Dark World', player).exits + world.get_region('South Dark World', player).exits:
if spot.name not in OWGSets.get_dw_bunny_inaccessible_locations():
add_rule(world.get_entrance(spot, player), boots_and_mirror, 'or')
# DW entrances accessible with mirror and hookshot.
for spot in OWGSets.get_mirror_hookshot_accessible_dw_locations(world, player):
add_rule(world.get_entrance(spot, player), lambda state: state.has_Boots(player) and 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)
add_rule(world.get_entrance('Mire Shed', player), boots_mirror_titans, 'or')
# Plus the mirror superbunny version.
add_rule(world.get_entrance('Mire Shed', player), lambda state: state.has('Ocarina', player) and state.has_Mirror(player) and state.can_lift_heavy_rocks(player), 'or')
add_rule(world.get_location('Frog', player), boots_mirror_titans, 'or')
else:
add_rule(world.get_entrance('East Death Mountain Mirror Spot (Bottom)', player), boots_and_mirror, 'or')
# Mirror clip spots.
for clip_spot in OWGSets.get_mirror_clip_spots_dw():
set_rule(world.get_entrance(clip_spot, player), lambda state: state.has_Mirror(player))
# Locations that you can superbunny mirror into, but need a sword to clear.
superbunny_mirror_weapon = lambda state: state.has_Mirror(player) and state.has_sword(player)
@@ -783,10 +775,11 @@ def overworld_glitches_rules(world, player):
# Regions that require the boots and some other stuff.
if world.mode[player] != 'inverted':
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)))
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), 'or')
set_rule(world.get_entrance('Dark Desert Teleporter', player), lambda state: state.has('Ocarina', player) or (state.can_boots_clip_dw(player) and state.can_lift_heavy_rocks(player)))
set_rule(world.get_entrance('Turtle Rock Teleporter', player), lambda state: (state.can_boots_clip_dw(player) or state.can_lift_heavy_rocks(player)) and state.has('Hammer', player))
add_rule(world.get_entrance('Catfish Exit Rock', player), lambda state: state.can_boots_clip_dw(player), 'or')
add_rule(world.get_entrance('East Dark World Broken Bridge Pass', player), lambda state: state.can_boots_clip_dw(player), 'or')
add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Dark Death Mountain (West Bottom)', 'Region', player) and state.has_Mirror(player))
else:
add_rule(world.get_entrance('South Dark World Teleporter', player), lambda state: state.has_Boots(player) and state.can_lift_rocks(player), 'or')