Fix up no logic entrance rules - create all the OWG transitions, but don't apply any logic

This commit is contained in:
compiling 2020-07-10 17:37:35 +10:00
parent ca1740121e
commit e15aad356a
2 changed files with 28 additions and 1 deletions

View File

@ -218,6 +218,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[player] == 'inverted'))
create_no_logic_connections(player, world, get_boots_clip_exits_dw(world.mode[player] == 'inverted', player))
# Glitched speed drops.
create_no_logic_connections(player, world, get_glitched_speed_drops_dw(world.mode[player] == 'inverted'))
# 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:
create_no_logic_connections(player, world, get_mirror_offset_spots_lw(player))
def overworld_glitches_rules(world, player):
# Boots-accessible locations.
@ -257,6 +275,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)

View File

@ -3,7 +3,7 @@ import logging
import OverworldGlitchRules
from BaseClasses import RegionType, World, Entrance
from Items import ItemFactory
from OverworldGlitchRules import overworld_glitches_rules
from OverworldGlitchRules import overworld_glitches_rules, no_logic_rules
def set_rules(world, player):
@ -11,6 +11,7 @@ def set_rules(world, player):
if world.logic[player] == 'nologic':
logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!')
world.get_region('Menu', player).can_reach_private = lambda state: True
no_logic_rules(world, player)
for exit in world.get_region('Menu', player).exits:
exit.hide_path = True
return