diff --git a/OWGSets.py b/OWGSets.py index 6ab361d1..b36274ff 100644 --- a/OWGSets.py +++ b/OWGSets.py @@ -1,182 +1,166 @@ -''' +""" Helper functions to deliver entrance/exit/region sets to OWG rules. -''' +""" -def get_immediately_accessible_entrances(world, player): - ''' + +def get_immediately_accessible_entrances(): + """ Entrances that are available with no items at all. At this point, these are fake flipper spots. - ''' - entrances = [ - 'Hobo Bridge', - 'Zoras River', - 'Lake Hylia Central Island Pier', - ] - return entrances + """ + yield 'Hobo Bridge' + yield 'Zoras River' + yield 'Lake Hylia Central Island Pier' def get_sword_required_superbunny_mirror_regions(): - ''' + """ Cave regions that superbunny can get through - but only with a sword. - ''' - return [ - 'Mini Moldorm Cave', - 'Spiral Cave (Top)', - ] + """ + yield 'Mini Moldorm Cave' + yield 'Spiral Cave (Top)' def get_invalid_mirror_bunny_entrances_dw(): - ''' + """ Dark World entrances that can't be superbunny-mirrored into. - ''' - return [ - 'Skull Woods Final Section (Entrance)', - 'Hype Cave', - 'Bonk Fairy (Dark)', - 'Thieves Town', - 'Dark World Hammer Peg Cave', - 'Brewery', - 'Hookshot Cave', - 'Hookshot Cave Exit (South)', - 'Dark Lake Hylia Ledge Fairy', - 'Dark Lake Hylia Ledge Spike Cave', - ] + """ + + yield 'Skull Woods Final Section (Entrance)' + yield 'Hype Cave' + yield 'Bonk Fairy (Dark)' + yield 'Thieves Town' + yield 'Dark World Hammer Peg Cave' + yield 'Brewery' + yield 'Hookshot Cave' + yield 'Hookshot Cave Exit (South)' + yield 'Dark Lake Hylia Ledge Fairy' + yield 'Dark Lake Hylia Ledge Spike Cave' def get_invalid_mirror_bunny_entrances_lw(): - ''' + """ Light World entrances that can't be superbunny-mirrored into. A couple of these, like Blind's Hideout, are odd cases where the pixel leading into the entrance prevents mirror superbunnying - generally due to there being stairs there. - ''' - return [ - 'Bonk Rock Cave', - 'Bonk Fairy (Light)', - 'Blinds Hideout', - '50 Rupee Cave', - '20 Rupee Cave', - 'Checkerboard Cave', - 'Light Hype Fairy', - 'Waterfall of Wishing', - 'Light World Bomb Hut', - 'Mini Moldorm Cave', - 'Ice Rod Cave', - 'Hyrule Castle Secret Entrance Stairs', - 'Sanctuary Grave', - 'Kings Grave', - 'Tower of Hera', - ] + """ + + yield 'Bonk Rock Cave' + yield 'Bonk Fairy (Light)' + yield 'Blinds Hideout' + 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 'Hyrule Castle Secret Entrance Stairs' + yield 'Sanctuary Grave' + yield 'Kings Grave' + yield 'Tower of Hera' def get_superbunny_accessible_locations(): - ''' + """ Interior locations that can be accessed with superbunny state. - ''' - return [ - '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', - ] + """ + + yield 'Waterfall of Wishing - Left' + yield 'Waterfall of Wishing - Right' + yield 'King\'s Tomb', 'Floodgate' + yield 'Floodgate Chest' + yield 'Cave 45' + yield 'Bonk Rock Cave' + yield 'Brewery' + yield 'C-Shaped House' + yield 'Chest Game' + yield 'Mire Shed - Left' + yield 'Mire Shed - Right' + yield 'Secret Passage' + yield 'Ice Rod Cave' + yield 'Pyramid Fairy - Left' + yield 'Pyramid Fairy - Right' + yield 'Superbunny Cave - Top' + yield 'Superbunny Cave - Bottom' def get_boots_clip_exits_lw(inverted = False): - ''' + """ Special Light World region exits that require boots clips. - ''' - exits = [ - 'Bat Cave River Clip Spot', - 'Light World DMA Clip Spot', - 'Hera Ascent', - 'Death Mountain Return Ledge Clip Spot', - 'Death Mountain Glitched Bridge', - 'Zora Descent Clip Spot', - 'Desert Northern Cliffs', - 'Lake Hylia Island Clip Spot', - 'Death Mountain Descent', - 'Graveyard Ledge Clip Spot', - # Also requires a waterwalk setup, but the point still remains. - 'Waterfall of Wishing', - ] + """ + + yield 'Bat Cave River Clip Spot' + yield 'Light World DMA Clip Spot' + yield 'Hera Ascent' + yield 'Death Mountain Return Ledge Clip Spot' + yield 'Death Mountain Glitched Bridge' + yield 'Zora Descent Clip Spot' + yield 'Desert Northern Cliffs' + yield 'Lake Hylia Island Clip Spot' + yield 'Death Mountain Descent' + yield 'Graveyard Ledge Clip Spot' + # Also requires a waterwalk setup, but the point still remains. + yield 'Waterfall of Wishing' + if not inverted: - exits.append('Spectacle Rock Clip Spot') - exits.append('Bombos Tablet Clip Spot') - exits.append('Floating Island Clip Spot') - exits.append('Cave 45 Clip Spot') - return exits + yield 'Spectacle Rock Clip Spot' + yield 'Bombos Tablet Clip Spot' + yield 'Floating Island Clip Spot' + yield 'Cave 45 Clip Spot' def get_boots_clip_exits_dw(inverted = False): - ''' + """ Special Dark World region exits that require boots clips. - ''' - exits = [ - 'Dark World DMA Clip Spot', - 'Bumper Cave Ledge Clip Spot', - 'Catfish Descent', - 'Hammer Pegs River Clip Spot', - 'Dark Lake Hylia Ledge Clip Spot', - 'Dark Desert Cliffs Clip Spot', - 'Dark Death Mountain Descent', - ] + """ + + yield 'Dark World DMA Clip Spot' + yield 'Bumper Cave Ledge Clip Spot' + yield 'Catfish Descent' + yield 'Hammer Pegs River Clip Spot' + yield 'Dark Lake Hylia Ledge Clip Spot' + yield 'Dark Desert Cliffs Clip Spot' + yield 'Dark Death Mountain Descent' + if not inverted: - exits.append('Ganons Tower Ascent') - exits.append('Dark Death Mountain Glitched Bridge') - exits.append('Turtle Rock (Top) Clip Spot') - return exits + yield 'Ganons Tower Ascent' + yield 'Dark Death Mountain Glitched Bridge' + yield 'Turtle Rock (Top) Clip Spot' def get_glitched_speed_drops_dw(): - ''' + """ Dark World drop-down ledges that require glitched speed. - ''' - return [ - 'Dark Death Mountain Ledge Clip Spot', - ] + """ + yield 'Dark Death Mountain Ledge Clip Spot' def get_mirror_clip_spots_dw(): - ''' + """ Mirror shenanigans that are in logic even if the player is a bunny. - ''' - return [ - 'Dark Death Mountain Offset Mirror', - 'Dark Death Mountain Bunny Descent Mirror Spot', - ] + """ + yield 'Dark Death Mountain Offset Mirror' + yield 'Dark Death Mountain Bunny Descent Mirror Spot' def get_mirror_clip_spots_lw(): - ''' + """ Inverted mirror shenanigans in logic even if the player is a bunny. - ''' - return [ - 'Death Mountain Bunny Descent Mirror Spot', - 'Death Mountain Offset Mirror', - ] + """ + yield 'Death Mountain Bunny Descent Mirror Spot' + yield 'Death Mountain Offset Mirror' def get_invalid_bunny_revival_dungeons(): - ''' + """ Dungeon regions that can't be bunny revived from. - ''' - return [ - 'Tower of Hera (Bottom)', - 'Swamp Palace (Entrance)', - 'Turtle Rock (Entrance)', - ] + """ + + yield 'Tower of Hera (Bottom)' + yield 'Swamp Palace (Entrance)' + yield 'Turtle Rock (Entrance)' diff --git a/Rules.py b/Rules.py index 9f2f8ecd..c2c71cbb 100644 --- a/Rules.py +++ b/Rules.py @@ -40,7 +40,6 @@ def set_rules(world, player): if world.logic[player] == 'noglitches': no_glitches_rules(world, player) elif world.logic[player] == 'owglitches': - logging.getLogger('').info('There is a chance OWG has bugged edge case rulesets, especially in inverted. Definitely file a report on GitHub if you see anything strange.') # Initially setting no_glitches_rules to set the baseline rules for some # entrances. The overworld_glitches_rules set is primarily additive. no_glitches_rules(world, player) @@ -745,7 +744,7 @@ def add_conditional_lamps(world, player): def overworld_glitches_rules(world, player): # Spots that are immediately accessible. - for entrance in OWGSets.get_immediately_accessible_entrances(world, player): + for entrance in OWGSets.get_immediately_accessible_entrances(): set_rule(world.get_entrance(entrance, player), lambda state: True) # Boots-accessible locations. @@ -823,8 +822,6 @@ def standard_rules(world, player): def set_trock_key_rules(world, player): - - # First set all relevant locked doors to impassible. for entrance in ['Turtle Rock Dark Room Staircase', 'Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)', 'Turtle Rock Pokey Room']: set_rule(world.get_entrance(entrance, player), lambda state: False)