Merged in DR v0.4.0.4

This commit is contained in:
codemann8
2021-05-24 18:16:02 -05:00
20 changed files with 193 additions and 52 deletions

View File

@@ -5,7 +5,6 @@ from collections import defaultdict
def link_entrances(world, player):
connect_two_way(world, 'Links House', 'Links House Exit', player) # unshuffled. For now
connect_exit(world, 'Chris Houlihan Room Exit', 'Links House', player) # should always match link's house, except for plandos
Dungeon_Exits = Dungeon_Exits_Base.copy()
@@ -82,7 +81,7 @@ def link_entrances(world, player):
single_doors = list(Single_Cave_Doors)
bomb_shop_doors = list(Bomb_Shop_Single_Cave_Doors)
blacksmith_doors = list(Blacksmith_Single_Cave_Doors)
blacksmith_doors = list(Blacksmith_Single_Cave_Doors) + ['Links House']
door_targets = list(Single_Cave_Targets)
# we shuffle all 2 entrance caves as pairs as a start
@@ -105,6 +104,18 @@ def link_entrances(world, player):
connect_two_way(world, entrance1, exit1, player)
connect_two_way(world, entrance2, exit2, player)
# 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 LW_Single_Cave_Doors if i not in Isolated_LH_Doors_Open]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Links House Exit', player)
if links_house in bomb_shop_doors:
bomb_shop_doors.remove(links_house)
if links_house in blacksmith_doors:
blacksmith_doors.remove(links_house)
# at this point only Light World death mountain entrances remain
# place old man, has limited options
remaining_entrances = ['Old Man Cave (West)', 'Old Man House (Bottom)', 'Death Mountain Return Cave (West)', 'Paradox Cave (Bottom)', 'Paradox Cave (Middle)', 'Paradox Cave (Top)',
@@ -157,6 +168,16 @@ def link_entrances(world, player):
blacksmith_doors = list(Blacksmith_Single_Cave_Doors + Blacksmith_Multi_Cave_Doors)
door_targets = list(Single_Cave_Targets)
# 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 lw_entrances if i not in Isolated_LH_Doors_Open]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Links House Exit', player)
if links_house in lw_entrances:
lw_entrances.remove(links_house)
# tavern back door cannot be shuffled yet
connect_doors(world, ['Tavern North'], ['Tavern'], player)
@@ -301,7 +322,18 @@ def link_entrances(world, player):
else:
dw_entrances.append('Ganons Tower')
caves.append('Ganons Tower Exit')
# 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 lw_entrances + lw_must_exits if i not in Isolated_LH_Doors_Open]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Links House Exit', player)
if links_house in lw_entrances:
lw_entrances.remove(links_house)
if links_house in lw_must_exits:
lw_must_exits.remove(links_house)
# we randomize which world requirements we fulfill first so we get better dungeon distribution
#we also places the Old Man House at this time to make sure he can be connected to the desert one way
@@ -408,6 +440,22 @@ def link_entrances(world, player):
entrances.append('Ganons Tower')
caves.append('Ganons Tower Exit')
# 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 + must_exits 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(list(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 must_exits:
must_exits.remove(links_house)
#place must-exit caves
connect_mandatory_exits(world, entrances, caves, must_exits, player)
@@ -854,6 +902,23 @@ def link_entrances(world, player):
entrances.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]
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)
doors.remove(links_house)
# now let's deal with mandatory reachable stuff
def extract_reachable_exit(cavelist):
random.shuffle(cavelist)
@@ -1200,9 +1265,12 @@ def link_inverted_entrances(world, player):
connect_two_way(world, entrance2, exit2, player)
# place links house
links_house_doors = [i for i in bomb_shop_doors + blacksmith_doors if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(list(links_house_doors))
connect_two_way(world, links_house, 'Links House Exit', player)
if not world.shufflelinks[player]:
links_house = 'Inverted Links House'
else:
links_house_doors = [i for i in DW_Single_Cave_Doors if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Inverted Links House Exit', player)
if links_house in bomb_shop_doors:
bomb_shop_doors.remove(links_house)
if links_house in blacksmith_doors:
@@ -1277,15 +1345,14 @@ def link_inverted_entrances(world, player):
door_targets = list(Inverted_Single_Cave_Targets)
# place links house
links_house_doors = [i for i in lw_entrances + dw_entrances + lw_must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(list(links_house_doors))
connect_two_way(world, links_house, 'Links House Exit', player)
if links_house in lw_entrances:
lw_entrances.remove(links_house)
elif links_house in dw_entrances:
if not world.shufflelinks[player]:
links_house = 'Inverted Links House'
else:
links_house_doors = [i for i in dw_entrances if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Inverted Links House Exit', player)
if links_house in dw_entrances:
dw_entrances.remove(links_house)
elif links_house in lw_must_exits:
lw_must_exits.remove(links_house)
# place dark sanc
sanc_doors = [door for door in Inverted_Dark_Sanctuary_Doors if door in dw_entrances]
@@ -1407,15 +1474,14 @@ def link_inverted_entrances(world, player):
caves.remove('Agahnims Tower Exit')
# place links house
links_house_doors = [i for i in lw_entrances + dw_entrances + lw_must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(list(links_house_doors))
connect_two_way(world, links_house, 'Links House Exit', player)
if links_house in lw_entrances:
lw_entrances.remove(links_house)
if not world.shufflelinks[player]:
links_house = 'Inverted Links House'
else:
links_house_doors = [i for i in dw_entrances if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Inverted Links House Exit', player)
if links_house in dw_entrances:
dw_entrances.remove(links_house)
if links_house in lw_must_exits:
lw_must_exits.remove(links_house)
# place dark sanc
sanc_doors = [door for door in Inverted_Dark_Sanctuary_Doors if door in dw_entrances]
@@ -1529,7 +1595,7 @@ def link_inverted_entrances(world, player):
hc_ledge_entrances = ['Hyrule Castle Entrance (West)', 'Hyrule Castle Entrance (East)', 'Agahnims Tower']
# shuffle aga door. if it's on hc ledge, then one other hc ledge door has to be must_exit
aga_door = random.choice(list(entrances))
aga_door = random.choice(entrances)
if aga_door in hc_ledge_entrances:
hc_ledge_entrances.remove(aga_door)
@@ -1543,11 +1609,13 @@ def link_inverted_entrances(world, player):
connect_two_way(world, aga_door, 'Agahnims Tower Exit', player)
caves.remove('Agahnims Tower Exit')
# place links house
links_house_doors = [i for i in entrances + must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(list(links_house_doors))
connect_two_way(world, links_house, 'Links House Exit', player)
if not world.shufflelinks[player]:
links_house = 'Inverted Links House'
else:
links_house_doors = [i for i in entrances + must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Inverted Links House Exit', player)
if links_house in entrances:
entrances.remove(links_house)
elif links_house in must_exits:
@@ -1678,9 +1746,12 @@ def link_inverted_entrances(world, player):
caves.append(('Hyrule Castle Exit (South)', 'Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
# place links house and dark sanc
links_house_doors = [i for i in entrances + entrances_must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(list(links_house_doors))
connect_two_way(world, links_house, 'Links House Exit', player)
if not world.shufflelinks[player]:
links_house = 'Inverted Links House'
else:
links_house_doors = [i for i in entrances + entrances_must_exits if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Inverted Links House Exit', player)
if links_house in entrances:
entrances.remove(links_house)
elif links_house in entrances_must_exits:
@@ -2440,7 +2511,19 @@ LW_Single_Cave_Doors = ['Blinds Hideout',
'Kings Grave',
'Bonk Fairy (Light)',
'Hookshot Fairy',
'Mimic Cave']
'Mimic Cave',
'Links House']
Isolated_LH_Doors_Open = ['Mimic Cave',
'Kings Grave',
'Waterfall of Wishing',
'Desert Palace Entrance (South)',
'Desert Palace Entrance (North)',
'Capacity Upgrade',
'Ice Palace',
'Skull Woods Final Section',
'Dark World Hammer Peg Cave',
'Turtle Rock Isolated Ledge Entrance']
DW_Single_Cave_Doors = ['Bonk Fairy (Dark)',
'Dark Sanctuary Hint',
@@ -2728,7 +2811,7 @@ Inverted_Bomb_Shop_Multi_Cave_Doors = ['Hyrule Castle Entrance (South)',
Inverted_Blacksmith_Multi_Cave_Doors = Blacksmith_Multi_Cave_Doors # same as non-inverted
Inverted_LW_Single_Cave_Doors = LW_Single_Cave_Doors + ['Links House']
Inverted_LW_Single_Cave_Doors = [x for x in LW_Single_Cave_Doors if x != 'Links House'] + ['Inverted Big Bomb Shop']
Inverted_DW_Single_Cave_Doors = ['Bonk Fairy (Dark)',
'Dark Sanctuary Hint',
@@ -2974,7 +3057,9 @@ inverted_mandatory_connections = [('Sanctuary S&Q', 'Dark Sanctuary Hint'),
('Other World S&Q', 'Hyrule Castle Ledge')]
# non-shuffled entrance links
default_connections = [('Waterfall of Wishing', 'Waterfall of Wishing'),
default_connections = [('Links House', 'Links House'),
('Links House Exit', 'Links House Area'),
('Waterfall of Wishing', 'Waterfall of Wishing'),
("Blinds Hideout", "Blinds Hideout"),
('Dam', 'Dam'),
('Lumberjack House', 'Lumberjack House'),
@@ -3140,6 +3225,10 @@ inverted_default_connections = [('Old Man Cave (West)', 'Bumper Cave'),
('Death Mountain Return Cave (East)', 'Death Mountain Return Cave'),
('Death Mountain Return Cave Exit (West)', 'West Death Mountain (Bottom)'),
('Death Mountain Return Cave Exit (East)', 'West Death Mountain (Bottom)'),
('Links House', 'Big Bomb Shop'),
('Links House Exit', 'Big Bomb Shop Area'),
('Big Bomb Shop', 'Links House'),
('Pyramid Exit', 'Hyrule Castle Courtyard')]
# non shuffled dungeons