Fix up no logic entrance rules - create all the OWG transitions, but don't apply any logic
This commit is contained in:
@@ -217,6 +217,24 @@ def get_invalid_bunny_revival_dungeons():
|
|||||||
yield 'Sanctuary'
|
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):
|
def overworld_glitches_rules(world, player):
|
||||||
|
|
||||||
# Boots-accessible locations.
|
# Boots-accessible locations.
|
||||||
@@ -256,6 +274,14 @@ def add_alternate_rule(entrance, rule):
|
|||||||
entrance.access_rule = lambda state: old_rule(state) or rule(state)
|
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):
|
def create_owg_connections(player, world, connections, default_rule):
|
||||||
for entrance, parent_region, target_region, *rule_override in connections:
|
for entrance, parent_region, target_region, *rule_override in connections:
|
||||||
parent = world.get_region(parent_region, player)
|
parent = world.get_region(parent_region, player)
|
||||||
|
|||||||
3
Rules.py
3
Rules.py
@@ -2,13 +2,14 @@ import collections
|
|||||||
import logging
|
import logging
|
||||||
import OverworldGlitchRules
|
import OverworldGlitchRules
|
||||||
from BaseClasses import RegionType, World
|
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):
|
def set_rules(world, player):
|
||||||
|
|
||||||
if world.logic == 'nologic':
|
if world.logic == 'nologic':
|
||||||
logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!')
|
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':
|
if world.mode != 'inverted':
|
||||||
world.get_region('Links House', player).can_reach_private = lambda state: True
|
world.get_region('Links House', player).can_reach_private = lambda state: True
|
||||||
world.get_region('Sanctuary', player).can_reach_private = lambda state: True
|
world.get_region('Sanctuary', player).can_reach_private = lambda state: True
|
||||||
|
|||||||
Reference in New Issue
Block a user