Fixed Swapped ER so that remaining cave placements in mandatory exits cannot choose vanilla

This commit is contained in:
codemann8
2023-08-17 07:05:38 -05:00
parent ed9585eef6
commit 70e1e7a28b
4 changed files with 73 additions and 3 deletions

View File

@@ -1379,7 +1379,8 @@ def do_mandatory_connections(avail, entrances, cave_options, must_exit):
entrances.remove(swap_ent)
if len(cave) == 2:
entrance = next(e for e in entrances[::-1] if e not in invalid_connections[exit]
and e not in invalid_cave_connections[tuple(cave)] and e not in must_exit)
and e not in invalid_cave_connections[tuple(cave)] and e not in must_exit
and (not avail.swapped or rnd_cave[0] != combine_map[e]))
entrances.remove(entrance)
connect_two_way(entrance, rnd_cave[0], avail)
if avail.swapped and combine_map[entrance] != rnd_cave[0]:
@@ -1398,7 +1399,8 @@ def do_mandatory_connections(avail, entrances, cave_options, must_exit):
entrance = avail.world.get_entrance(cave_exit, avail.player).parent_region.entrances[0].name
cave_entrances.append(entrance)
else:
entrance = next(e for e in entrances[::-1] if e not in invalid_connections[exit] and e not in must_exit)
entrance = next(e for e in entrances[::-1] if e not in invalid_connections[exit] and e not in must_exit
and (not avail.swapped or cave_exit != combine_map[e]))
cave_entrances.append(entrance)
entrances.remove(entrance)
connect_two_way(entrance, cave_exit, avail)
@@ -1428,7 +1430,8 @@ def do_mandatory_connections(avail, entrances, cave_options, must_exit):
if avail.swapped and cave_exit not in avail.exits:
continue
else:
entrance = next(e for e in entrances[::-1] if e not in invalid_cave_connections[tuple(cave)])
entrance = next(e for e in entrances[::-1] if e not in invalid_cave_connections[tuple(cave)]
and (not avail.swapped or cave_exit != combine_map[e]))
invalid_cave_connections[tuple(cave)] = set()
entrances.remove(entrance)
connect_two_way(entrance, cave_exit, avail)