Make Pyramid Fairy offset mirror require access to Hyrule Castle Courtyard through the secret passage entrance (the normal route is not possible if you killed Agahnim).

This commit is contained in:
compiling 2020-05-08 19:32:04 +10:00
parent e7a3637cc9
commit e812c8a3f7
3 changed files with 22 additions and 3 deletions

View File

@ -219,6 +219,7 @@ def add_alternate_rule(entrance, rule):
old_rule = entrance.access_rule old_rule = entrance.access_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_owg_connections(player, world, connections, rule): def create_owg_connections(player, world, connections, rule):
for entrance, parent_region, target_region in connections: for entrance, parent_region, target_region in connections:
parent = world.get_region(parent_region, player) parent = world.get_region(parent_region, player)

View File

@ -61,8 +61,9 @@ def set_rules(world, player):
if world.mode[player] != 'inverted': if world.mode[player] != 'inverted':
set_big_bomb_rules(world, player) set_big_bomb_rules(world, player)
if world.logic[player] == 'owglitches': if world.logic[player] == 'owglitches' and world.shuffle not in ('insanity', 'insanity_legacy'):
add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Dark Death Mountain (West Bottom)', 'Region', player) and state.has_Mirror(player), 'or') path_to_courtyard = mirrorless_path_to_castle_courtyard(world, player)
add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.world.get_entrance('Dark Death Mountain Offset Mirror', player).can_reach(state) and all(rule(state) for rule in path_to_courtyard), 'or')
else: else:
set_inverted_big_bomb_rules(world, player) set_inverted_big_bomb_rules(world, player)
@ -84,6 +85,23 @@ def set_rules(world, player):
set_bunny_rules(world, player, world.mode[player] == 'inverted') set_bunny_rules(world, player, world.mode[player] == 'inverted')
def mirrorless_path_to_castle_courtyard(world, player):
# If Agahnim is defeated then the courtyard needs to be accessible without using the mirror for the mirror offset glitch.
# Only considering the secret passage for now (in non-insanity shuffle). Basically, if it's Ganon you need the master sword.
start = world.get_entrance('Hyrule Castle Secret Entrance Drop', player)
target = world.get_region('Hyrule Castle Courtyard', player)
seen = {start.parent_region, start.connected_region}
queue = collections.deque([(start.connected_region, [])])
while queue:
(current, path) = queue.popleft()
for entrance in current.exits:
if entrance.connected_region not in seen:
new_path = path + [entrance.access_rule]
if entrance.connected_region == target:
return new_path
else:
queue.append((entrance.connected_region, new_path))
def set_rule(spot, rule): def set_rule(spot, rule):
spot.access_rule = rule spot.access_rule = rule

View File

@ -1,7 +1,7 @@
from test.owg.TestVanillaOWG import TestVanillaOWG from test.owg.TestVanillaOWG import TestVanillaOWG
class TestLightWorld(TestVanillaOWG): class TestDarkWorld(TestVanillaOWG):
def testSouthDarkWorld(self): def testSouthDarkWorld(self):
self.run_location_tests([ self.run_location_tests([