Fix inverted checks

Fix superbunny / dungeon revive rules due to late binding
Fix inverted swamp patch
Fix most unit tests (dungeons still broken)
This commit is contained in:
compiling
2021-04-27 23:51:12 +10:00
parent df2b12774d
commit 639a3ec383
15 changed files with 103 additions and 159 deletions

View File

@@ -1761,7 +1761,7 @@ def link_inverted_entrances(world, player):
raise NotImplementedError('Shuffling not supported yet')
# check for swamp palace fix
if world.get_entrance('Dam', player).connected_region.name != 'Dam' or world.get_entrance('Swamp Palace', player).connected_region.name != 'Swamp Lobby':
if world.get_entrance('Dam', player).connected_region.name != 'Dam' or world.get_entrance('Swamp Palace', player).connected_region.name != 'Swamp Portal':
world.swamp_patch_required[player] = True
# check for potion shop location
@@ -1937,7 +1937,7 @@ def connect_random(world, exitlist, targetlist, player, two_way=False):
def connect_mandatory_exits(world, entrances, caves, must_be_exits, player):
# Keeps track of entrances that cannot be used to access each exit / cave
if world.mode == 'inverted':
if world.mode[player] == 'inverted':
invalid_connections = Inverted_Must_Exit_Invalid_Connections.copy()
else:
invalid_connections = Must_Exit_Invalid_Connections.copy()
@@ -1945,7 +1945,7 @@ def connect_mandatory_exits(world, entrances, caves, must_be_exits, player):
if world.logic[player] in ['owglitches', 'nologic']:
import OverworldGlitchRules
for entrance in OverworldGlitchRules.get_non_mandatory_exits(world.mode == 'inverted'):
for entrance in OverworldGlitchRules.get_non_mandatory_exits(world.mode[player] == 'inverted'):
invalid_connections[entrance] = set()
if entrance in must_be_exits:
must_be_exits.remove(entrance)
@@ -1956,7 +1956,7 @@ def connect_mandatory_exits(world, entrances, caves, must_be_exits, player):
random.shuffle(caves)
# Handle inverted Aga Tower - if it depends on connections, then so does Hyrule Castle Ledge
if world.mode == 'inverted':
if world.mode[player] == 'inverted':
for entrance in invalid_connections:
if world.get_entrance(entrance, player).connected_region == world.get_region('Inverted Agahnims Tower', player):
for exit in invalid_connections[entrance]: