Minor tweaks in prep for ER rewrite

This commit is contained in:
codemann8
2021-10-02 13:45:14 -05:00
parent c54bd67ddc
commit c99805f47d
3 changed files with 243 additions and 252 deletions

View File

@@ -12,7 +12,6 @@ except ImportError:
from source.classes.BabelFish import BabelFish
from EntranceShuffle import door_addresses, indirect_connections
from Utils import int16_as_bytes
from Tables import normal_offset_table, spiral_offset_table, multiply_lookup, divisor_lookup
from RoomData import Room
@@ -598,6 +597,7 @@ class CollectionState(object):
self.path[new_region] = (new_region.name, self.path.get(connection, None))
# Retry connections if the new region can unblock them
from EntranceShuffle import indirect_connections
if new_region.name in indirect_connections:
new_entrance = self.world.get_entrance(indirect_connections[new_region.name], player)
if new_entrance in bc and new_entrance.parent_region in rrp:
@@ -2501,6 +2501,7 @@ class Shop(object):
# [id][roomID-low][roomID-high][doorID][zero][shop_config][shopkeeper_config][sram_index]
entrances = self.region.entrances
config = self.item_count
from EntranceShuffle import door_addresses
if len(entrances) == 1 and entrances[0].name in door_addresses:
door_id = door_addresses[entrances[0].name][0]+1
else:

View File

@@ -53,6 +53,9 @@ def link_entrances(world, player):
connect_custom(world, player)
if invFlag == (0x05 in world.owswaps[player][0] and world.owMixed[player]):
isolated_entrances.append('Mimic Cave')
# if we do not shuffle, set default connections
if world.shuffle[player] in ['vanilla', 'dungeonssimple', 'dungeonsfull']:
for entrancename, exitname in default_connections + drop_connections + default_item_connections + default_shop_connections:
@@ -141,10 +144,7 @@ def link_entrances(world, player):
if world.mode[player] == 'standard' or not world.shufflelinks[player]:
links_house = 'Links House'
else:
if not invFlag:
links_house_doors = [i for i in LW_Single_Cave_Doors if i not in Isolated_LH_Doors_Open]
else:
links_house_doors = [i for i in LW_Single_Cave_Doors if i not in Inverted_Dark_Sanctuary_Doors + Isolated_LH_Doors]
links_house_doors = [i for i in LW_Single_Cave_Doors if i not in isolated_entrances + ([] if not invFlag else Inverted_Dark_Sanctuary_Doors)]
links_house = random.choice(links_house_doors)
connect_two_way(world, links_house, 'Links House Exit', player)
connect_exit(world, 'Chris Houlihan Room Exit', links_house, player) # should always match link's house, except for plandos
@@ -1666,8 +1666,7 @@ LW_Single_Cave_Doors = ['Blinds Hideout',
'Mimic Cave',
'Links House']
Isolated_LH_Doors_Open = ['Mimic Cave',
'Kings Grave',
Isolated_LH_Doors = ['Kings Grave',
'Waterfall of Wishing',
'Desert Palace Entrance (South)',
'Desert Palace Entrance (North)',
@@ -2125,16 +2124,6 @@ Inverted_Dark_Sanctuary_Doors = ['Dark Sanctuary Hint',
'Bumper Cave (Top)',
'Thieves Town']
Isolated_LH_Doors = ['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']
# Entrances that cannot be used to access a must_exit entrance - symmetrical to allow reverse lookups
Must_Exit_Invalid_Connections = defaultdict(set, {
'Dark Death Mountain Ledge (East)': {'Dark Death Mountain Ledge (West)', 'Mimic Cave'},

View File

@@ -1629,6 +1629,7 @@ def find_rules_for_zelda_delivery(world, player):
def set_big_bomb_rules(world, player):
# this is a mess
if len(world.get_region('Big Bomb Shop', player).entrances) > 0:
bombshop_entrance = world.get_region('Big Bomb Shop', player).entrances[0]
Normal_LW_entrances = ['Blinds Hideout',
'Bonk Fairy (Light)',