Insanity restrictions lifted on multi-entrance caves and dungeon exits
This commit is contained in:
@@ -823,12 +823,12 @@ def link_entrances(world, player):
|
||||
elif world.shuffle[player] == 'insanity':
|
||||
# beware ye who enter here
|
||||
|
||||
entrances = LW_Entrances + LW_Dungeon_Entrances + DW_Entrances + DW_Dungeon_Entrances + Old_Man_Entrances + ['Skull Woods Second Section Door (East)', 'Skull Woods First Section Door', 'Kakariko Well Cave', 'Bat Cave Cave', 'North Fairy Cave', 'Sanctuary', 'Lost Woods Hideout Stump', 'Lumberjack Tree Cave']
|
||||
entrances_must_exits = DW_Entrances_Must_Exit + DW_Dungeon_Entrances_Must_Exit + LW_Dungeon_Entrances_Must_Exit + ['Skull Woods Second Section Door (West)']
|
||||
|
||||
doors = LW_Entrances + LW_Dungeon_Entrances + LW_Dungeon_Entrances_Must_Exit + ['Kakariko Well Cave', 'Bat Cave Cave', 'North Fairy Cave', 'Sanctuary', 'Lost Woods Hideout Stump', 'Lumberjack Tree Cave'] + Old_Man_Entrances +\
|
||||
DW_Entrances + DW_Dungeon_Entrances + DW_Entrances_Must_Exit + DW_Dungeon_Entrances_Must_Exit + ['Skull Woods First Section Door', 'Skull Woods Second Section Door (East)', 'Skull Woods Second Section Door (West)'] +\
|
||||
LW_Single_Cave_Doors + DW_Single_Cave_Doors
|
||||
exit_pool = list(doors)
|
||||
|
||||
# TODO: there are other possible entrances we could support here by way of exiting from a connector,
|
||||
# and rentering to find bomb shop. However appended list here is all those that we currently have
|
||||
@@ -866,7 +866,7 @@ def link_entrances(world, player):
|
||||
hole_entrances.append('Hyrule Castle Secret Entrance Drop')
|
||||
hole_targets.append('Hyrule Castle Secret Entrance')
|
||||
doors.append('Hyrule Castle Secret Entrance Stairs')
|
||||
entrances.append('Hyrule Castle Secret Entrance Stairs')
|
||||
exit_pool.append('Hyrule Castle Secret Entrance Stairs')
|
||||
caves.append('Hyrule Castle Secret Entrance Exit')
|
||||
|
||||
if not world.shuffle_ganon:
|
||||
@@ -874,16 +874,16 @@ def link_entrances(world, player):
|
||||
connect_two_way(world, 'Pyramid Entrance', 'Pyramid Exit', player)
|
||||
connect_entrance(world, 'Pyramid Hole', 'Pyramid', player)
|
||||
else:
|
||||
entrances.append('Ganons Tower')
|
||||
caves.extend(['Ganons Tower Exit', 'Pyramid Exit'])
|
||||
hole_entrances.append('Pyramid Hole')
|
||||
hole_targets.append('Pyramid')
|
||||
entrances_must_exits.append('Pyramid Entrance')
|
||||
exit_pool.extend(['Ganons Tower', 'Pyramid Entrance'])
|
||||
doors.extend(['Ganons Tower', 'Pyramid Entrance'])
|
||||
|
||||
random.shuffle(hole_entrances)
|
||||
random.shuffle(hole_targets)
|
||||
random.shuffle(entrances)
|
||||
random.shuffle(exit_pool)
|
||||
|
||||
# fill up holes
|
||||
for hole in hole_entrances:
|
||||
@@ -897,24 +897,21 @@ def link_entrances(world, player):
|
||||
caves.append(('Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
|
||||
else:
|
||||
doors.append('Hyrule Castle Entrance (South)')
|
||||
entrances.append('Hyrule Castle Entrance (South)')
|
||||
exit_pool.append('Hyrule Castle Entrance (South)')
|
||||
caves.append(('Hyrule Castle Exit (South)', 'Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
|
||||
|
||||
# place links house
|
||||
if world.mode[player] == 'standard' or not world.shufflelinks[player]:
|
||||
links_house = 'Links House'
|
||||
else:
|
||||
links_house_doors = [i for i in entrances + entrances_must_exits if i not in Isolated_LH_Doors_Open]
|
||||
links_house_doors = [i for i in doors if i not in Isolated_LH_Doors_Open]
|
||||
if world.doorShuffle[player] == 'crossed' and world.intensity[player] >= 3:
|
||||
exclusions = DW_Entrances + DW_Dungeon_Entrances + DW_Single_Cave_Doors \
|
||||
+ DW_Entrances_Must_Exit + DW_Dungeon_Entrances_Must_Exit + ['Ganons Tower']
|
||||
links_house_doors = [i for i in links_house_doors if i not in exclusions]
|
||||
links_house = random.choice(links_house_doors)
|
||||
connect_two_way(world, links_house, 'Links House Exit', player)
|
||||
if links_house in entrances:
|
||||
entrances.remove(links_house)
|
||||
elif links_house in entrances_must_exits:
|
||||
entrances_must_exits.remove(links_house)
|
||||
exit_pool.remove(links_house)
|
||||
doors.remove(links_house)
|
||||
|
||||
# now let's deal with mandatory reachable stuff
|
||||
@@ -934,7 +931,7 @@ def link_entrances(world, player):
|
||||
cavelist.remove(candidate)
|
||||
return candidate
|
||||
|
||||
def connect_reachable_exit(entrance, caves, doors):
|
||||
def connect_reachable_exit(entrance, caves, doors, exit_pool):
|
||||
cave = extract_reachable_exit(caves)
|
||||
|
||||
exit = cave[-1]
|
||||
@@ -942,18 +939,19 @@ def link_entrances(world, player):
|
||||
connect_exit(world, exit, entrance, player)
|
||||
connect_entrance(world, doors.pop(), exit, player)
|
||||
# rest of cave now is forced to be in this world
|
||||
exit_pool.remove(entrance)
|
||||
caves.append(cave)
|
||||
|
||||
# connect mandatory exits
|
||||
for entrance in entrances_must_exits:
|
||||
connect_reachable_exit(entrance, caves, doors)
|
||||
connect_reachable_exit(entrance, caves, doors, exit_pool)
|
||||
|
||||
# place old man, has limited options
|
||||
# exit has to come from specific set of doors, the entrance is free to move about
|
||||
old_man_entrances = [entrance for entrance in old_man_entrances if entrance in entrances]
|
||||
old_man_entrances = [entrance for entrance in old_man_entrances if entrance in exit_pool]
|
||||
random.shuffle(old_man_entrances)
|
||||
old_man_exit = old_man_entrances.pop()
|
||||
entrances.remove(old_man_exit)
|
||||
exit_pool.remove(old_man_exit)
|
||||
|
||||
connect_exit(world, 'Old Man Cave Exit (East)', old_man_exit, player)
|
||||
connect_entrance(world, doors.pop(), 'Old Man Cave Exit (East)', player)
|
||||
@@ -965,6 +963,7 @@ def link_entrances(world, player):
|
||||
blacksmith_hut = blacksmith_doors.pop()
|
||||
connect_entrance(world, blacksmith_hut, 'Blacksmiths Hut', player)
|
||||
doors.remove(blacksmith_hut)
|
||||
exit_pool.remove(blacksmith_hut)
|
||||
|
||||
# place dam and pyramid fairy, have limited options
|
||||
bomb_shop_doors = [door for door in bomb_shop_doors if door in doors]
|
||||
@@ -972,6 +971,7 @@ def link_entrances(world, player):
|
||||
bomb_shop = bomb_shop_doors.pop()
|
||||
connect_entrance(world, bomb_shop, 'Big Bomb Shop', player)
|
||||
doors.remove(bomb_shop)
|
||||
exit_pool.remove(bomb_shop)
|
||||
|
||||
# handle remaining caves
|
||||
for cave in caves:
|
||||
@@ -979,7 +979,7 @@ def link_entrances(world, player):
|
||||
cave = (cave,)
|
||||
|
||||
for exit in cave:
|
||||
connect_exit(world, exit, entrances.pop(), player)
|
||||
connect_exit(world, exit, exit_pool.pop(), player)
|
||||
connect_entrance(world, doors.pop(), exit, player)
|
||||
|
||||
# place remaining doors
|
||||
|
||||
Reference in New Issue
Block a user