diff --git a/OverworldGlitchRules.py b/OverworldGlitchRules.py index 2a44ac11..da354965 100644 --- a/OverworldGlitchRules.py +++ b/OverworldGlitchRules.py @@ -217,6 +217,24 @@ def get_invalid_bunny_revival_dungeons(): yield 'Sanctuary' +def no_logic_rules(world, player): + """ + Add OWG transitions to no logic player's world + """ + create_no_logic_connections(player, world, get_boots_clip_exits_lw(world.mode == 'inverted')) + create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode == 'inverted', player)) + + # Glitched speed drops. + create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode == 'inverted')) + + # Mirror clip spots. + if world.mode != 'inverted': + create_no_logic_connections(player, world, get_mirror_clip_spots_dw()) + create_no_logic_connections(player, world, get_mirror_offset_spots_dw()) + else: + create_no_logic_connections(player, world, get_mirror_offset_spots_lw(player)) + + def overworld_glitches_rules(world, player): # Boots-accessible locations. @@ -256,6 +274,14 @@ def add_alternate_rule(entrance, rule): entrance.access_rule = lambda state: old_rule(state) or rule(state) +def create_no_logic_connections(player, world, connections): + for entrance, parent_region, target_region, *rule_override in connections: + parent = world.get_region(parent_region, player) + target = world.get_region(target_region, player) + connection = Entrance(player, entrance, parent) + parent.exits.append(connection) + connection.connect(target) + def create_owg_connections(player, world, connections, default_rule): for entrance, parent_region, target_region, *rule_override in connections: parent = world.get_region(parent_region, player) diff --git a/Rules.py b/Rules.py index dea6907d..8dc854b1 100644 --- a/Rules.py +++ b/Rules.py @@ -2,13 +2,14 @@ import collections import logging import OverworldGlitchRules from BaseClasses import RegionType, World -from OverworldGlitchRules import overworld_glitches_rules +from OverworldGlitchRules import overworld_glitches_rules, no_logic_rules def set_rules(world, player): if world.logic == 'nologic': logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!') + no_logic_rules(world, player) if world.mode != 'inverted': world.get_region('Links House', player).can_reach_private = lambda state: True world.get_region('Sanctuary', player).can_reach_private = lambda state: True