Refactor OWG rules to use lists rather than generators

This commit is contained in:
KrisDavie
2023-12-04 19:43:13 +01:00
parent 9870217698
commit e1f2369f13
2 changed files with 259 additions and 224 deletions

View File

@@ -4,261 +4,296 @@ Helper functions to deliver entrance/exit/region sets to OWG rules.
from BaseClasses import Entrance from BaseClasses import Entrance
# Cave regions that superbunny can get through - but only with a sword.
sword_required_superbunny_mirror_regions = ["Spiral Cave (Top)"]
def get_sword_required_superbunny_mirror_regions(): # Cave regions that superbunny can get through - but only with boots.
""" boots_required_superbunny_mirror_regions = ["Two Brothers House"]
Cave regions that superbunny can get through - but only with a sword.
"""
yield 'Spiral Cave (Top)'
def get_boots_required_superbunny_mirror_regions(): # Cave locations that superbunny can access - but only with boots.
""" boots_required_superbunny_mirror_locations = [
Cave regions that superbunny can get through - but only with boots. "Sahasrahla's Hut - Left",
""" "Sahasrahla's Hut - Middle",
yield 'Two Brothers House' "Sahasrahla's Hut - Right",
]
def get_boots_required_superbunny_mirror_locations(): # Entrances that can't be superbunny-mirrored into.
""" invalid_mirror_bunny_entrances = [
Cave locations that superbunny can access - but only with boots. "Skull Woods Final Section",
""" "Hype Cave",
yield 'Sahasrahla\'s Hut - Left' "Bonk Fairy (Dark)",
yield 'Sahasrahla\'s Hut - Middle' "Thieves Town",
yield 'Sahasrahla\'s Hut - Right' "Hammer Peg Cave",
"Brewery",
"Hookshot Cave",
"Dark Lake Hylia Ledge Fairy",
"Dark Lake Hylia Ledge Spike Cave",
"Palace of Darkness",
"Misery Mire",
"Turtle Rock",
"Bonk Rock Cave",
"Bonk Fairy (Light)",
"50 Rupee Cave",
"20 Rupee Cave",
"Checkerboard Cave",
"Light Hype Fairy",
"Waterfall of Wishing",
"Light World Bomb Hut",
"Mini Moldorm Cave",
"Ice Rod Cave",
"Sanctuary Grave",
"Kings Grave",
"Sanctuary Grave",
"Hyrule Castle Secret Entrance Drop",
"Skull Woods Second Section Hole",
"Skull Woods First Section Hole (North)",
]
# Interior locations that can be accessed with superbunny state.
superbunny_accessible_locations = [
"Waterfall of Wishing - Left",
"Waterfall of Wishing - Right",
"King's Tomb",
"Floodgate",
"Floodgate Chest",
"Cave 45",
"Bonk Rock Cave",
"Brewery",
"C-Shaped House",
"Chest Game",
"Mire Shed - Left",
"Mire Shed - Right",
"Secret Passage",
"Ice Rod Cave",
"Pyramid Fairy - Left",
"Pyramid Fairy - Right",
"Superbunny Cave - Top",
"Superbunny Cave - Bottom",
"Blind's Hideout - Left",
"Blind's Hideout - Right",
"Blind's Hideout - Far Left",
"Blind's Hideout - Far Right",
"Kakariko Well - Left",
"Kakariko Well - Middle",
"Kakariko Well - Right",
"Kakariko Well - Bottom",
"Kakariko Tavern",
"Library",
"Spiral Cave",
] + boots_required_superbunny_mirror_locations
def get_invalid_mirror_bunny_entrances(): # Entrances that can be reached with full equipment using overworld glitches and don't need to be an exit.
""" # The following are still be mandatory exits:
Entrances that can't be superbunny-mirrored into. # Open:
""" # Turtle Rock Isolated Ledge Entrance
yield 'Skull Woods Final Section' # Skull Woods Second Section Door (West) (or Skull Woods Final Section)
yield 'Hype Cave' # Inverted:
yield 'Bonk Fairy (Dark)' # Two Brothers House (West)
yield 'Thieves Town' # Desert Palace Entrance (East)
yield 'Hammer Peg Cave'
yield 'Brewery'
yield 'Hookshot Cave'
yield 'Dark Lake Hylia Ledge Fairy'
yield 'Dark Lake Hylia Ledge Spike Cave'
yield 'Palace of Darkness'
yield 'Misery Mire'
yield 'Turtle Rock'
yield 'Bonk Rock Cave'
yield 'Bonk Fairy (Light)'
yield '50 Rupee Cave'
yield '20 Rupee Cave'
yield 'Checkerboard Cave'
yield 'Light Hype Fairy'
yield 'Waterfall of Wishing'
yield 'Light World Bomb Hut'
yield 'Mini Moldorm Cave'
yield 'Ice Rod Cave'
yield 'Sanctuary Grave'
yield 'Kings Grave'
yield 'Sanctuary Grave'
yield 'Hyrule Castle Secret Entrance Drop'
yield 'Skull Woods Second Section Hole'
yield 'Skull Woods First Section Hole (North)'
def get_superbunny_accessible_locations(): non_mandatory_exits = [
""" "Bumper Cave (Top)",
Interior locations that can be accessed with superbunny state. "Death Mountain Return Cave (West)",
""" "Hookshot Cave Back Entrance",
]
yield 'Waterfall of Wishing - Left' inverted_non_mandatory_exits = [
yield 'Waterfall of Wishing - Right' "Desert Palace Entrance (North)",
yield 'King\'s Tomb' "Desert Palace Entrance (West)",
yield 'Floodgate' "Agahnims Tower",
yield 'Floodgate Chest' "Hyrule Castle Entrance (West)",
yield 'Cave 45' "Hyrule Castle Entrance (East)",
yield 'Bonk Rock Cave' ] + non_mandatory_exits
yield 'Brewery'
yield 'C-Shaped House' open_non_mandatory_exits_ = [
yield 'Chest Game' "Dark Death Mountain Ledge (West)",
yield 'Mire Shed - Left' "Dark Death Mountain Ledge (East)",
yield 'Mire Shed - Right' "Mimic Cave",
yield 'Secret Passage' "Desert Palace Entrance (East)",
yield 'Ice Rod Cave' ] + non_mandatory_exits
yield 'Pyramid Fairy - Left'
yield 'Pyramid Fairy - Right'
yield 'Superbunny Cave - Top'
yield 'Superbunny Cave - Bottom'
yield 'Blind\'s Hideout - Left'
yield 'Blind\'s Hideout - Right'
yield 'Blind\'s Hideout - Far Left'
yield 'Blind\'s Hideout - Far Right'
yield 'Kakariko Well - Left'
yield 'Kakariko Well - Middle'
yield 'Kakariko Well - Right'
yield 'Kakariko Well - Bottom'
yield 'Kakariko Tavern'
yield 'Library'
yield 'Spiral Cave'
for location in get_boots_required_superbunny_mirror_locations():
yield location
def get_non_mandatory_exits(inverted): # Special Light World region exits that require boots clips.
"""
Entrances that can be reached with full equipment using overworld glitches and don't need to be an exit.
The following are still be mandatory exits:
Open: inverted_boots_clip_exits_lw = [
Turtle Rock Isolated Ledge Entrance ("Light World DMA Clip Spot", "Light World", "West Death Mountain (Bottom)"),
Skull Woods Second Section Door (West) (or Skull Woods Final Section) ("Hera Ascent", "West Death Mountain (Bottom)", "West Death Mountain (Top)"),
("Death Mountain Return Ledge Clip Spot", "Light World", "Death Mountain Return Ledge"),
("Death Mountain Entrance Clip Spot", "Light World", "Death Mountain Entrance"),
("Death Mountain Glitched Bridge", "West Death Mountain (Bottom)", "East Death Mountain (Top)"),
("Zora Descent Clip Spot", "East Death Mountain (Top)", "Zoras Domain"),
("Desert Northern Cliffs", "Light World", "Desert Northern Cliffs"),
("Desert Ledge Dropdown", "Desert Northern Cliffs", "Desert Ledge"),
("Desert Palace Entrance Dropdown", "Desert Northern Cliffs", "Desert Palace Entrance (North) Spot"),
("Lake Hylia Island Clip Spot", "Light World", "Lake Hylia Island"),
("Death Mountain Descent", "West Death Mountain (Bottom)", "Light World"),
("Kings Grave Clip Spot", "West Death Mountain (Bottom)", "Kings Grave Area"),
("Maze Race Clip Spot", "Light World", "Maze Race Ledge"),
]
Inverted: open_boots_clip_exits_lw = [
Two Brothers House (West) ("Graveyard Ledge Clip Spot", "West Death Mountain (Bottom)", "Graveyard Ledge"),
Desert Palace Entrance (East) ("Desert Ledge (Northeast) Dropdown", "Desert Northern Cliffs", "Desert Checkerboard Ledge"),
""" ("Spectacle Rock Clip Spot", "West Death Mountain (Top)", "Spectacle Rock"),
("Bombos Tablet Clip Spot", "Light World", "Bombos Tablet Ledge"),
("Floating Island Clip Spot", "East Death Mountain (Top)", "Death Mountain Floating Island"),
("Cave 45 Clip Spot", "Light World", "Cave 45 Ledge"),
] + inverted_boots_clip_exits_lw
yield 'Bumper Cave (Top)' # Special Dark World region exits that require boots clips.
yield 'Death Mountain Return Cave (West)' boots_clip_exits_dw = [
yield 'Hookshot Cave Back Entrance' ("Dark World DMA Clip Spot", "West Dark World", "West Dark Death Mountain (Bottom)"),
("Bumper Cave Ledge Clip Spot", "West Dark World", "Bumper Cave Ledge"),
("Bumper Cave Entrance Clip Spot", "West Dark World", "Bumper Cave Entrance"),
("Catfish Descent", "Dark Death Mountain (Top)", "Catfish Area"),
("Hammer Pegs River Clip Spot", "East Dark World", "Hammer Peg Area"),
("Dark Lake Hylia Ledge Clip Spot", "East Dark World", "Southeast Dark World"),
("Dark Desert Cliffs Clip Spot", "South Dark World", "Dark Desert"),
("DW Floating Island Clip Spot", "East Dark Death Mountain (Bottom)", "Dark Death Mountain Floating Island"),
]
if inverted: open_boots_clip_exits_dw = [
yield 'Desert Palace Entrance (North)' ("Dark Death Mountain Descent", "West Dark Death Mountain (Bottom)", "West Dark World"),
yield 'Desert Palace Entrance (West)' ("Ganons Tower Ascent", "West Dark Death Mountain (Bottom)", "Dark Death Mountain (Top)"),
yield 'Agahnims Tower' ("Dark Death Mountain Glitched Bridge", "West Dark Death Mountain (Bottom)", "Dark Death Mountain (Top)"),
yield 'Hyrule Castle Entrance (West)' ("Turtle Rock (Top) Clip Spot", "Dark Death Mountain (Top)", "Turtle Rock (Top)"),
yield 'Hyrule Castle Entrance (East)' ] + boots_clip_exits_dw
else:
yield 'Dark Death Mountain Ledge (West)' inverted_boots_clip_exits_dw = [
yield 'Dark Death Mountain Ledge (East)' ("Dark Desert Teleporter Clip Spot", "Dark Desert", "Dark Desert Ledge")
yield 'Mimic Cave' ] + boots_clip_exits_dw
yield 'Desert Palace Entrance (East)'
def get_boots_clip_exits_lw(inverted = False): # Dark World drop-down ledges that require glitched speed.
""" glitched_speed_drops_dw = [
Special Light World region exits that require boots clips. ("Dark Death Mountain Ledge Clip Spot", "Dark Death Mountain (Top)", "Dark Death Mountain Ledge")
""" ]
yield ('Bat Cave River Clip Spot', 'Light World', 'Bat Cave Ledge')
yield ('Light World DMA Clip Spot', 'Light World', 'West Death Mountain (Bottom)')
yield ('Hera Ascent', 'West Death Mountain (Bottom)', 'West Death Mountain (Top)')
yield ('Death Mountain Return Ledge Clip Spot', 'Light World', 'Death Mountain Return Ledge')
yield ('Death Mountain Entrance Clip Spot', 'Light World', 'Death Mountain Entrance')
yield ('Death Mountain Glitched Bridge', 'West Death Mountain (Bottom)', 'East Death Mountain (Top)')
yield ('Zora Descent Clip Spot', 'East Death Mountain (Top)', 'Zoras Domain')
yield ('Desert Northern Cliffs', 'Light World', 'Desert Northern Cliffs')
yield ('Desert Ledge Dropdown', 'Desert Northern Cliffs', 'Desert Ledge')
yield ('Desert Palace Entrance Dropdown', 'Desert Northern Cliffs', 'Desert Palace Entrance (North) Spot')
yield ('Lake Hylia Island Clip Spot', 'Light World', 'Lake Hylia Island')
yield ('Death Mountain Descent', 'West Death Mountain (Bottom)', 'Light World')
yield ('Kings Grave Clip Spot', 'West Death Mountain (Bottom)', 'Kings Grave Area')
if not inverted:
yield ('Graveyard Ledge Clip Spot', 'West Death Mountain (Bottom)', 'Graveyard Ledge')
yield ('Desert Ledge (Northeast) Dropdown', 'Desert Northern Cliffs', 'Desert Checkerboard Ledge')
yield ('Spectacle Rock Clip Spot', 'West Death Mountain (Top)', 'Spectacle Rock')
yield ('Bombos Tablet Clip Spot', 'Light World', 'Bombos Tablet Ledge')
yield ('Floating Island Clip Spot', 'East Death Mountain (Top)', 'Death Mountain Floating Island')
yield ('Cave 45 Clip Spot', 'Light World', 'Cave 45 Ledge')
def get_boots_clip_exits_dw(inverted): # Out of bounds transitions using the mirror
""" mirror_clip_spots_dw = [
Special Dark World region exits that require boots clips. ("Dark Death Mountain Bunny Descent Mirror Spot", "West Dark Death Mountain (Bottom)", "West Dark World"),
""" (
"Dark Death Mountain Bunny Mirror To East Jump",
"West Dark Death Mountain (Bottom)",
"East Dark Death Mountain (Bottom)",
),
("Desert East Mirror Clip", "Dark Desert", "Desert Palace Mouth"),
]
yield ('Dark World DMA Clip Spot', 'West Dark World', 'West Dark Death Mountain (Bottom)') # Mirror shenanigans placing a mirror portal with a broken camera
yield ('Bumper Cave Ledge Clip Spot', 'West Dark World', 'Bumper Cave Ledge') mirror_offset_spots_dw = [("Dark Death Mountain Offset Mirror", "West Dark Death Mountain (Bottom)", "East Dark World")]
yield ('Bumper Cave Entrance Clip Spot', 'West Dark World', 'Bumper Cave Entrance')
yield ('Catfish Descent', 'Dark Death Mountain (Top)', 'Catfish Area')
yield ('Hammer Pegs River Clip Spot', 'East Dark World', 'Hammer Peg Area')
yield ('Dark Lake Hylia Ledge Clip Spot', 'East Dark World', 'Southeast Dark World')
yield ('Dark Desert Cliffs Clip Spot', 'South Dark World', 'Dark Desert')
yield ('DW Floating Island Clip Spot', 'East Dark Death Mountain (Bottom)', 'Dark Death Mountain Floating Island')
if not inverted: # Mirror shenanigans placing a mirror portal with a broken camera
yield ('Dark Death Mountain Descent', 'West Dark Death Mountain (Bottom)', 'West Dark World')
yield ('Ganons Tower Ascent', 'West Dark Death Mountain (Bottom)', 'Dark Death Mountain (Top)') # This only gets you to the GT entrance
yield ('Dark Death Mountain Glitched Bridge', 'West Dark Death Mountain (Bottom)', 'Dark Death Mountain (Top)')
yield ('Turtle Rock (Top) Clip Spot', 'Dark Death Mountain (Top)', 'Turtle Rock (Top)')
else:
yield ('Dark Desert Teleporter Clip Spot', 'Dark Desert', 'Dark Desert Ledge')
mirror_offset_spots_lw = [
def get_glitched_speed_drops_dw(inverted = False): ("Death Mountain Offset Mirror", "West Death Mountain (Bottom)", "Light World"),
""" ("Death Mountain Uncle Offset Mirror", "West Death Mountain (Bottom)", "Hyrule Castle Secret Entrance Area"),
Dark World drop-down ledges that require glitched speed. ("Death Mountain Castle Ledge Offset Mirror", "West Death Mountain (Bottom)", "Hyrule Castle Ledge"),
""" ]
yield ('Dark Death Mountain Ledge Clip Spot', 'Dark Death Mountain (Top)', 'Dark Death Mountain Ledge')
def get_mirror_clip_spots_dw():
"""
Out of bounds transitions using the mirror
"""
yield ('Dark Death Mountain Bunny Descent Mirror Spot', 'West Dark Death Mountain (Bottom)', 'West Dark World')
yield ('Dark Death Mountain Bunny Mirror To East Jump', 'West Dark Death Mountain (Bottom)', 'East Dark Death Mountain (Bottom)')
yield ('Desert East Mirror Clip', 'Dark Desert', 'Desert Palace Mouth')
def get_mirror_offset_spots_dw():
"""
Mirror shenanigans placing a mirror portal with a broken camera
"""
yield ('Dark Death Mountain Offset Mirror', 'West Dark Death Mountain (Bottom)', 'East Dark World')
def get_mirror_offset_spots_lw(player):
"""
Mirror shenanigans placing a mirror portal with a broken camera
"""
yield ('Death Mountain Offset Mirror', 'West Death Mountain (Bottom)', 'Light World')
yield ('Death Mountain Uncle Offset Mirror', 'West Death Mountain (Bottom)', 'Hyrule Castle Secret Entrance Area')
yield ('Death Mountain Castle Ledge Offset Mirror', 'West Death Mountain (Bottom)', 'Hyrule Castle Ledge')
def create_owg_connections(world, player): def create_owg_connections(world, player):
""" """
Add OWG transitions to player's world without logic Add OWG transitions to player's world without logic
""" """
create_no_logic_connections(player, world, get_boots_clip_exits_lw(world.mode[player] == 'inverted')) if world.mode[player] == "inverted":
create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode[player] == 'inverted')) connections = (
inverted_boots_clip_exits_dw
# Glitched speed drops. + inverted_boots_clip_exits_lw
create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode[player] == 'inverted')) + glitched_speed_drops_dw
+ mirror_offset_spots_lw
# Mirror clip spots. )
if world.mode[player] != 'inverted':
create_no_logic_connections(player, world, get_mirror_clip_spots_dw())
create_no_logic_connections(player, world, get_mirror_offset_spots_dw())
else: else:
create_no_logic_connections(player, world, get_mirror_offset_spots_lw(player)) connections = (
open_boots_clip_exits_dw
+ open_boots_clip_exits_lw
+ glitched_speed_drops_dw
+ mirror_clip_spots_dw
+ mirror_offset_spots_dw
)
create_no_logic_connections(player, world, connections)
def overworld_glitches_rules(world, player): def overworld_glitches_rules(world, player):
# Boots-accessible locations. inverted = world.mode[player] == "inverted"
set_owg_rules(player, world, get_boots_clip_exits_lw(world.mode[player] == 'inverted'), lambda state: state.can_boots_clip_lw(player))
set_owg_rules(player, world, get_boots_clip_exits_dw(world.mode[player] == 'inverted'), lambda state: state.can_boots_clip_dw(player))
# Boots-accessible locations.
set_owg_rules(
player,
world,
inverted_boots_clip_exits_lw if inverted else open_boots_clip_exits_lw,
lambda state: state.can_boots_clip_lw(player),
)
set_owg_rules(
player,
world,
inverted_boots_clip_exits_dw if inverted else open_boots_clip_exits_dw,
lambda state: state.can_boots_clip_dw(player),
)
# Glitched speed drops. # Glitched speed drops.
set_owg_rules(player, world, get_glitched_speed_drops_dw(world.mode[player] == 'inverted'), lambda state: state.can_get_glitched_speed_dw(player)) set_owg_rules(
player,
world,
glitched_speed_drops_dw,
lambda state: state.can_get_glitched_speed_dw(player),
)
# Dark Death Mountain Ledge Clip Spot also accessible with mirror. # Dark Death Mountain Ledge Clip Spot also accessible with mirror.
if world.mode[player] != 'inverted': if not inverted:
add_alternate_rule(world.get_entrance('Dark Death Mountain Ledge Clip Spot', player), lambda state: state.has_Mirror(player)) add_alternate_rule(
world.get_entrance("Dark Death Mountain Ledge Clip Spot", player), lambda state: state.has_Mirror(player)
)
# Mirror clip spots. # Mirror clip spots.
if world.mode[player] != 'inverted': if inverted:
set_owg_rules(player, world, get_mirror_clip_spots_dw(), lambda state: state.has_Mirror(player)) set_owg_rules(
set_owg_rules(player, world, get_mirror_offset_spots_dw(), lambda state: state.has_Mirror(player) and state.can_boots_clip_lw(player)) player,
world,
mirror_offset_spots_lw,
lambda state: state.has_Mirror(player) and state.can_boots_clip_dw(player),
)
else: else:
set_owg_rules(player, world, get_mirror_offset_spots_lw(player), lambda state: state.has_Mirror(player) and state.can_boots_clip_dw(player)) set_owg_rules(player, world, mirror_clip_spots_dw, lambda state: state.has_Mirror(player))
set_owg_rules(
player,
world,
mirror_offset_spots_dw,
lambda state: state.has_Mirror(player) and state.can_boots_clip_lw(player),
)
# Regions that require the boots and some other stuff. # Regions that require the boots and some other stuff.
if world.mode[player] != 'inverted': if not inverted:
world.get_entrance('Turtle Rock Teleporter', player).access_rule = lambda state: (state.can_boots_clip_lw(player) or state.can_lift_heavy_rocks(player)) and state.has('Hammer', player) world.get_entrance("Turtle Rock Teleporter", player).access_rule = lambda state: (
add_alternate_rule(world.get_entrance('Waterfall Fairy Access', player), lambda state: state.has_Pearl(player) or state.has_Boots(player)) # assumes access to Waterwalk ability (boots case) state.can_boots_clip_lw(player) or state.can_lift_heavy_rocks(player)
else: ) and state.has("Hammer", player)
add_alternate_rule(world.get_entrance('Waterfall Fairy Access', player), lambda state: state.has_Pearl(player))
add_alternate_rule(
world.get_entrance("Waterfall Fairy Access", player),
lambda state: state.has_Pearl(player) or state.has_Boots(player),
) # assumes access to Waterwalk ability (boots case)
else:
add_alternate_rule(world.get_entrance("Waterfall Fairy Access", player), lambda state: state.has_Pearl(player))
world.get_entrance("Dark Desert Teleporter", player).access_rule = lambda state: (
state.can_flute(player) or state.can_boots_clip_dw(player)
) and state.can_lift_heavy_rocks(player)
add_alternate_rule(
world.get_entrance("Dark Witch Rock (North)", player), lambda state: state.can_boots_clip_dw(player)
)
add_alternate_rule(
world.get_entrance("Broken Bridge Pass (Top)", player), lambda state: state.can_boots_clip_dw(player)
)
add_alternate_rule(
world.get_location("Zora's Ledge", player), lambda state: state.can_boots_clip_lw(player)
) # assumes access to Waterwalk ability
# This is doable even with bad enemies
add_alternate_rule(world.get_location("Hobo", player), lambda state: state.can_boots_clip_lw(player))
world.get_entrance('Dark Desert Teleporter', player).access_rule = lambda state: (state.can_flute(player) or state.can_boots_clip_dw(player)) and state.can_lift_heavy_rocks(player)
add_alternate_rule(world.get_entrance('Dark Witch Rock (North)', player), lambda state: state.can_boots_clip_dw(player))
add_alternate_rule(world.get_entrance('Broken Bridge Pass (Top)', player), lambda state: state.can_boots_clip_dw(player))
add_alternate_rule(world.get_location('Zora\'s Ledge', player), lambda state: state.can_boots_clip_lw(player)) # assumes access to Waterwalk ability
def add_alternate_rule(entrance, rule): def add_alternate_rule(entrance, rule):

View File

@@ -1905,7 +1905,7 @@ def set_bunny_rules(world, player, inverted):
# bunny revival accessible. # bunny revival accessible.
if world.logic[player] in ['owglitches', 'hybridglitches']: if world.logic[player] in ['owglitches', 'hybridglitches']:
if region.type != RegionType.Dungeon \ if region.type != RegionType.Dungeon \
and (location is None or location.name not in OverworldGlitchRules.get_superbunny_accessible_locations()) \ and (location is None or location.name not in OverworldGlitchRules.superbunny_accessible_locations) \
and not is_link(region): and not is_link(region):
return lambda state: state.has_Pearl(player) return lambda state: state.has_Pearl(player)
else: else:
@@ -1935,7 +1935,7 @@ def set_bunny_rules(world, player, inverted):
if not is_link(new_region): if not is_link(new_region):
if world.logic[player] in ['owglitches', 'hybridglitches']: if world.logic[player] in ['owglitches', 'hybridglitches']:
if region.type == RegionType.Dungeon and new_region.type != RegionType.Dungeon: if region.type == RegionType.Dungeon and new_region.type != RegionType.Dungeon:
if entrance.name in OverworldGlitchRules.get_invalid_mirror_bunny_entrances(): if entrance.name in OverworldGlitchRules.invalid_mirror_bunny_entrances:
continue continue
if entrance.name in drop_dungeon_entrances: if entrance.name in drop_dungeon_entrances:
lobby = entrance.connected_region lobby = entrance.connected_region
@@ -1949,21 +1949,21 @@ def set_bunny_rules(world, player, inverted):
possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_sword(player)], entrance)) possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_sword(player)], entrance))
continue continue
elif region.type == RegionType.Cave and new_region.type != RegionType.Cave: elif region.type == RegionType.Cave and new_region.type != RegionType.Cave:
if entrance.name in OverworldGlitchRules.get_invalid_mirror_bunny_entrances(): if entrance.name in OverworldGlitchRules.invalid_mirror_bunny_entrances:
continue continue
if region.name in OverworldGlitchRules.get_sword_required_superbunny_mirror_regions(): if region.name in OverworldGlitchRules.sword_required_superbunny_mirror_regions:
possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_sword(player)], entrance)) possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_sword(player)], entrance))
elif region.name in OverworldGlitchRules.get_boots_required_superbunny_mirror_regions(): elif region.name in OverworldGlitchRules.boots_required_superbunny_mirror_regions:
possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_Boots(player)], entrance)) possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_Boots(player)], entrance))
elif location and location.name in OverworldGlitchRules.get_superbunny_accessible_locations(): elif location and location.name in OverworldGlitchRules.superbunny_accessible_locations:
if location.name in OverworldGlitchRules.get_boots_required_superbunny_mirror_locations(): if location.name in OverworldGlitchRules.boots_required_superbunny_mirror_locations:
possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_Boots(player)], entrance)) possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player) and state.has_Boots(player)], entrance))
elif region.name == 'Kakariko Well (top)': elif region.name == 'Kakariko Well (top)':
possible_options.append(path_to_access_rule(new_path, entrance)) possible_options.append(path_to_access_rule(new_path, entrance))
else: else:
possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player)], entrance)) possible_options.append(path_to_access_rule(new_path + [lambda state: state.has_Mirror(player)], entrance))
continue continue
elif region.name == 'Superbunny Cave (Top)' and new_region.name == 'Superbunny Cave (Bottom)' and location and location.name in OverworldGlitchRules.get_superbunny_accessible_locations(): elif region.name == 'Superbunny Cave (Top)' and new_region.name == 'Superbunny Cave (Bottom)' and location and location.name in OverworldGlitchRules.superbunny_accessible_locations:
possible_options.append(path_to_access_rule(new_path, entrance)) possible_options.append(path_to_access_rule(new_path, entrance))
else: else:
continue continue