Zero out more door frame tables, prepare structure for proper fix once understood.

This commit is contained in:
LLCoolDave 2017-06-17 13:16:13 +02:00
parent 2d81e87e7f
commit 57a6ba73c1
4 changed files with 180 additions and 157 deletions

View File

@ -35,6 +35,8 @@ class World(object):
self.clock_mode = 'off' self.clock_mode = 'off'
self.aga_randomness = 'off' self.aga_randomness = 'off'
self.lock_aga_door_in_escape = False self.lock_aga_door_in_escape = False
self.fix_door_frames = self.shuffle not in ['vanilla', 'dungeonssimple', 'dungeonsfull']
self.fix_trock_doors = self.shuffle != 'vanilla'
def get_region(self, regionname): def get_region(self, regionname):
if isinstance(regionname, Region): if isinstance(regionname, Region):
@ -417,6 +419,7 @@ class Entrance(object):
self.addresses = None self.addresses = None
self.spot_type = 'Entrance' self.spot_type = 'Entrance'
self.recursion_count = 0 self.recursion_count = 0
self.vanilla = None
def access_rule(self, state): def access_rule(self, state):
return True return True
@ -427,10 +430,11 @@ class Entrance(object):
return False return False
def connect(self, region, addresses=None, target=None): def connect(self, region, addresses=None, target=None, vanilla=None):
self.connected_region = region self.connected_region = region
self.target = target self.target = target
self.addresses = addresses self.addresses = addresses
self.vanilla = vanilla
region.entrances.append(self) region.entrances.append(self)
def __str__(self): def __str__(self):

View File

@ -694,9 +694,14 @@ def connect_entrance(world, entrancename, exitname):
entrance.connected_region.entrances.remove(entrance) entrance.connected_region.entrances.remove(entrance)
target = exit_ids[exit.name][0] if exit is not None else exit_ids.get(region.name, None) target = exit_ids[exit.name][0] if exit is not None else exit_ids.get(region.name, None)
addresses = door_addresses[entrance.name][0] if exit is not None else door_addresses[entrance.name] addresses = door_addresses[entrance.name][0][0] if exit is not None else door_addresses[entrance.name][0]
try:
vanilla_ref = door_addresses[entrance.name][1]
vanilla = exit_ids[vanilla_ref]
except IndexError:
vanilla = None
entrance.connect(region, addresses, target) entrance.connect(region, addresses, target, vanilla)
return '%s => %s' % (entrance.name, exit.name if exit is not None else region.name) return '%s => %s' % (entrance.name, exit.name if exit is not None else region.name)
@ -708,7 +713,7 @@ def connect_exit(world, exitname, entrancename):
if exit.connected_region is not None: if exit.connected_region is not None:
exit.connected_region.entrances.remove(exit) exit.connected_region.entrances.remove(exit)
exit.connect(entrance.parent_region, door_addresses[entrance.name][1], exit_ids[exit.name][1]) exit.connect(entrance.parent_region, door_addresses[entrance.name][0][1], exit_ids[exit.name][1])
return '%s <= %s' % (entrance.name, exit.name) return '%s <= %s' % (entrance.name, exit.name)
@ -722,8 +727,8 @@ def connect_two_way(world, entrancename, exitname):
if exit.connected_region is not None: if exit.connected_region is not None:
exit.connected_region.entrances.remove(exit) exit.connected_region.entrances.remove(exit)
entrance.connect(exit.parent_region, door_addresses[entrance.name][0], exit_ids[exit.name][0]) entrance.connect(exit.parent_region, door_addresses[entrance.name][0][0], exit_ids[exit.name][0])
exit.connect(entrance.parent_region, door_addresses[entrance.name][1], exit_ids[exit.name][1]) exit.connect(entrance.parent_region, door_addresses[entrance.name][0][1], exit_ids[exit.name][1])
return '%s <=> %s' % (entrance.name, exit.name) return '%s <=> %s' % (entrance.name, exit.name)
@ -1231,10 +1236,10 @@ mandatory_connections = [('Links House', 'Links House'), # unshuffled. For now
('South Hyrule Teleporter', 'South Dark World'), ('South Hyrule Teleporter', 'South Dark World'),
('Kakariko Teleporter', 'West Dark World'), ('Kakariko Teleporter', 'West Dark World'),
('Death Mountain Teleporter', 'Dark Death Mountain (West Bottom)'), ('Death Mountain Teleporter', 'Dark Death Mountain (West Bottom)'),
('7 Chest Cave Push Block Reverse', '7 Chest Cave Cave Chest Area'), ('7 Chest Cave Push Block Reverse', '7 Chest Cave Chest Area'),
('7 Chest Cave Push Block', '7 Chest Cave Cave Front'), ('7 Chest Cave Push Block', '7 Chest Cave Front'),
('7 Chest Cave Bomb Jump', '7 Chest Cave Cave'), ('7 Chest Cave Bomb Jump', '7 Chest Cave'),
('7 Chest Cave Drop', '7 Chest Cave Cave Chest Area'), ('7 Chest Cave Drop', '7 Chest Cave Chest Area'),
('Fairy Ascension Rocks', 'Fairy Ascension Plateau'), ('Fairy Ascension Rocks', 'Fairy Ascension Plateau'),
('Fairy Ascension Mirror Spot', 'Fairy Ascension Plateau'), ('Fairy Ascension Mirror Spot', 'Fairy Ascension Plateau'),
('Fairy Ascension Drop', 'East Death Mountain (Bottom)'), ('Fairy Ascension Drop', 'East Death Mountain (Bottom)'),
@ -1408,9 +1413,9 @@ default_connections = [('Waterfall of Wishing', 'Waterfall of Wishing'),
('Spectacle Rock Cave Exit', 'Death Mountain'), ('Spectacle Rock Cave Exit', 'Death Mountain'),
('Spectacle Rock Cave Exit (Top)', 'Death Mountain'), ('Spectacle Rock Cave Exit (Top)', 'Death Mountain'),
('Spectacle Rock Cave Exit (Peak)', 'Death Mountain'), ('Spectacle Rock Cave Exit (Peak)', 'Death Mountain'),
('7 Chest Cave (Bottom)', '7 Chest Cave Cave Front'), ('7 Chest Cave (Bottom)', '7 Chest Cave Front'),
('7 Chest Cave (Middle)', '7 Chest Cave Cave'), ('7 Chest Cave (Middle)', '7 Chest Cave'),
('7 Chest Cave (Top)', '7 Chest Cave Cave'), ('7 Chest Cave (Top)', '7 Chest Cave'),
('7 Chest Cave Exit (Bottom)', 'East Death Mountain (Bottom)'), ('7 Chest Cave Exit (Bottom)', 'East Death Mountain (Bottom)'),
('7 Chest Cave Exit (Middle)', 'East Death Mountain (Bottom)'), ('7 Chest Cave Exit (Middle)', 'East Death Mountain (Bottom)'),
('7 Chest Cave Exit (Top)', 'East Death Mountain (Top)'), ('7 Chest Cave Exit (Top)', 'East Death Mountain (Top)'),
@ -1527,145 +1532,145 @@ default_dungeon_connections = [('Desert Palace Entrance (South)', 'Desert Palace
# ToDo somehow merge this with creation of the locations # ToDo somehow merge this with creation of the locations
door_addresses = {'Desert Palace Entrance (South)': (0xDBB7B, 0x15B02), door_addresses = {'Desert Palace Entrance (South)': ((0xDBB7B, 0x15B02),),
'Desert Palace Entrance (West)': (0xDBB7D, 0x15B06), 'Desert Palace Entrance (West)': ((0xDBB7D, 0x15B06),),
'Desert Palace Entrance (North)': (0xDBB7E, 0x15B08), 'Desert Palace Entrance (North)': ((0xDBB7E, 0x15B08),),
'Desert Palace Entrance (East)': (0xDBB7C, 0x15B04), 'Desert Palace Entrance (East)': ((0xDBB7C, 0x15B04),),
'Eastern Palace': (0xDBB7A, 0x15B00), 'Eastern Palace': ((0xDBB7A, 0x15B00),),
'Tower of Hera': (0xDBBA5, 0x15B48), 'Tower of Hera': ((0xDBBA5, 0x15B48),),
'Hyrule Castle Entrance (South)': (0xDBB76, 0x15AF4), 'Hyrule Castle Entrance (South)': ((0xDBB76, 0x15AF4),),
'Hyrule Castle Entrance (West)': (0xDBB75, 0x15AF2), 'Hyrule Castle Entrance (West)': ((0xDBB75, 0x15AF2),),
'Hyrule Castle Entrance (East)': (0xDBB77, 0x15AF6), 'Hyrule Castle Entrance (East)': ((0xDBB77, 0x15AF6),),
'Agahnims Tower': (0xDBB96, 0x15B38), 'Agahnims Tower': ((0xDBB96, 0x15B38),),
'Thieves Town': (0xDBBA6, 0x15B58), 'Thieves Town': ((0xDBBA6, 0x15B58),),
'Skull Woods First Section Door': (0xDBB9C, 0x15B44), 'Skull Woods First Section Door': ((0xDBB9C, 0x15B44),),
'Skull Woods Second Section Door (East)': (0xDBB9B, 0x15B42), 'Skull Woods Second Section Door (East)': ((0xDBB9B, 0x15B42),),
'Skull Woods Second Section Door (West)': (0xDBB9A, 0x15B40), 'Skull Woods Second Section Door (West)': ((0xDBB9A, 0x15B40),),
'Skull Woods Final Section': (0xDBB9D, 0x15B46), 'Skull Woods Final Section': ((0xDBB9D, 0x15B46),),
'Ice Palace': (0xDBB9F, 0x15B4A), 'Ice Palace': ((0xDBB9F, 0x15B4A),),
'Misery Mire': (0xDBB99, 0x15B3E), 'Misery Mire': ((0xDBB99, 0x15B3E),),
'Palace of Darkness': (0xDBB98, 0x15B3C), 'Palace of Darkness': ((0xDBB98, 0x15B3C),),
'Swamp Palace': (0xDBB97, 0x15B3A), 'Swamp Palace': ((0xDBB97, 0x15B3A),),
'Turtle Rock': (0xDBBA7, 0x15B56), 'Turtle Rock': ((0xDBBA7, 0x15B56),),
'Dark Death Mountain Ledge (West)': (0xDBB87, 0x15B1A), 'Dark Death Mountain Ledge (West)': ((0xDBB87, 0x15B1A),),
'Dark Death Mountain Ledge (East)': (0xDBB8B, 0x15B22), 'Dark Death Mountain Ledge (East)': ((0xDBB8B, 0x15B22),),
'Turtle Rock Isolated Ledge Entrance': (0xDBB8A, 0x15B20), 'Turtle Rock Isolated Ledge Entrance': ((0xDBB8A, 0x15B20),),
'Hyrule Castle Secret Entrance Stairs': (0xDBBA4, 0x15B54), 'Hyrule Castle Secret Entrance Stairs': ((0xDBBA4, 0x15B54),),
'Kakariko Well Cave': (0xDBBAB, 0x15B62), 'Kakariko Well Cave': ((0xDBBAB, 0x15B62),),
'Bat Cave Cave': (0xDBB83, 0x15B12), 'Bat Cave Cave': ((0xDBB83, 0x15B12),),
'Elder House (East)': (0xDBB80, 0x15B0C), 'Elder House (East)': ((0xDBB80, 0x15B0C),),
'Elder House (West)': (0xDBB7F, 0x15B0A), 'Elder House (West)': ((0xDBB7F, 0x15B0A),),
'North Fairy Cave': (0xDBBAA, 0x15B60), 'North Fairy Cave': ((0xDBBAA, 0x15B60),),
'Thieves Forest Hideout Stump': (0xDBB9E, 0x15B5A), 'Thieves Forest Hideout Stump': ((0xDBB9E, 0x15B5A),),
'Lumberjack Tree Cave': (0xDBB84, 0x15B14), 'Lumberjack Tree Cave': ((0xDBB84, 0x15B14),),
'Two Brothers House (East)': (0xDBB82, 0x15B10), 'Two Brothers House (East)': ((0xDBB82, 0x15B10),),
'Two Brothers House (West)': (0xDBB81, 0x15B0E), 'Two Brothers House (West)': ((0xDBB81, 0x15B0E),),
'Sanctuary': (0xDBB74, 0x15AF0), 'Sanctuary': ((0xDBB74, 0x15AF0),),
'Old Man Cave (West)': (0xDBB78, 0x15AFC), 'Old Man Cave (West)': ((0xDBB78, 0x15AFC),),
'Old Man Cave (East)': (0xDBB79, 0x15AFE), 'Old Man Cave (East)': ((0xDBB79, 0x15AFE),),
'Old Man House (Bottom)': (0xDBBA2, 0x15B50), 'Old Man House (Bottom)': ((0xDBBA2, 0x15B50),),
'Old Man House (Top)': (0xDBBA3, 0x15B52), 'Old Man House (Top)': ((0xDBBA3, 0x15B52),),
'Death Mountain Return Cave (East)': (0xDBBA1, 0x15B4E), 'Death Mountain Return Cave (East)': ((0xDBBA1, 0x15B4E),),
'Death Mountain Return Cave (West)': (0xDBBA0, 0x15B4C), 'Death Mountain Return Cave (West)': ((0xDBBA0, 0x15B4C),),
'Spectacle Rock Cave Peak': (0xDBB95, 0x15B36), 'Spectacle Rock Cave Peak': ((0xDBB95, 0x15B36),),
'Spectacle Rock Cave': (0xDBB94, 0x15B34), 'Spectacle Rock Cave': ((0xDBB94, 0x15B34),),
'Spectacle Rock Cave (Bottom)': (0xDBB93, 0x15B32), 'Spectacle Rock Cave (Bottom)': ((0xDBB93, 0x15B32),),
'7 Chest Cave (Bottom)': (0xDBB90, 0x15B2C), '7 Chest Cave (Bottom)': ((0xDBB90, 0x15B2C),),
'7 Chest Cave (Middle)': (0xDBB91, 0x15B2E), '7 Chest Cave (Middle)': ((0xDBB91, 0x15B2E),),
'7 Chest Cave (Top)': (0xDBB92, 0x15B30), '7 Chest Cave (Top)': ((0xDBB92, 0x15B30),),
'Fairy Ascension Cave (Bottom)': (0xDBB8C, 0x15B24), 'Fairy Ascension Cave (Bottom)': ((0xDBB8C, 0x15B24),),
'Fairy Ascension Cave (Top)': (0xDBB8D, 0x15B26), 'Fairy Ascension Cave (Top)': ((0xDBB8D, 0x15B26),),
'Spiral Cave': (0xDBB8F, 0x15B2A), 'Spiral Cave': ((0xDBB8F, 0x15B2A),),
'Spiral Cave (Bottom)': (0xDBB8E, 0x15B28), 'Spiral Cave (Bottom)': ((0xDBB8E, 0x15B28),),
'Bumper Cave (Bottom)': (0xDBB88, 0x15B1C), 'Bumper Cave (Bottom)': ((0xDBB88, 0x15B1C),),
'Bumper Cave (Top)': (0xDBB89, 0x15B1E), 'Bumper Cave (Top)': ((0xDBB89, 0x15B1E),),
'Dark Death Mountain Ascend (Top)': (0xDBB86, 0x15B18), 'Dark Death Mountain Ascend (Top)': ((0xDBB86, 0x15B18),),
'Dark Death Mountain Ascend (Bottom)': (0xDBB85, 0x15B16), 'Dark Death Mountain Ascend (Bottom)': ((0xDBB85, 0x15B16),),
'Hookshot Cave': (0xDBBAC, 0x15B64), 'Hookshot Cave': ((0xDBBAC, 0x15B64),),
'Hookshot Cave Back Entrance': (0xDBBAD, 0x15B66), 'Hookshot Cave Back Entrance': ((0xDBBAD, 0x15B66),),
'Ganons Tower': (0xDBBA9, 0x15B5E), 'Ganons Tower': ((0xDBBA9, 0x15B5E),),
'Pyramid Entrance': (0xDBBA8, 0x15B5C), 'Pyramid Entrance': ((0xDBBA8, 0x15B5C),),
'Skull Woods First Section Hole (East)': (0xDB84D, 0xDB84E), 'Skull Woods First Section Hole (East)': ((0xDB84D, 0xDB84E),),
'Skull Woods First Section Hole (West)': (0xDB84F, 0xDB850), 'Skull Woods First Section Hole (West)': ((0xDB84F, 0xDB850),),
'Skull Woods First Section Hole (North)': 0xDB84C, 'Skull Woods First Section Hole (North)': (0xDB84C,),
'Skull Woods Second Section Hole': (0xDB851, 0xDB852), 'Skull Woods Second Section Hole': ((0xDB851, 0xDB852),),
'Pyramid Hole': (0xDB854, 0xDB855, 0xDB856), 'Pyramid Hole': ((0xDB854, 0xDB855, 0xDB856),),
'Waterfall of Wishing': 0xDBBCE, 'Waterfall of Wishing': (0xDBBCE, 'Waterfall of Wishing'),
'Dam': 0xDBBC0, 'Dam': (0xDBBC0, 'Dam'),
'Thiefs Hut': 0xDBBD3, 'Thiefs Hut': (0xDBBD3, 'Thiefs Hut'),
'Hyrule Castle Secret Entrance Drop': 0xDB858, 'Hyrule Castle Secret Entrance Drop': (0xDB858,),
'Bonk Fairy (Light)': 0xDBBE9, 'Bonk Fairy (Light)': (0xDBBE9, 'Bonk Fairy'),
'Lake Hylia Fairy': 0xDBBD0, 'Lake Hylia Fairy': (0xDBBD0, 'Healer Fairy'),
'Swamp Fairy': 0xDBBDE, 'Swamp Fairy': (0xDBBDE, 'Healer Fairy'),
'Desert Fairy': 0xDBBE4, 'Desert Fairy': (0xDBBE4, 'Healer Fairy'),
'Kings Grave': 0xDBBCD, 'Kings Grave': (0xDBBCD, 'Kings Grave'),
'Tavern North': 0xDBBB5, # do not use, buggy 'Tavern North': (0xDBBB5, 'Tavern'), # do not use, buggy
'Chicken House': 0xDBBBD, 'Chicken House': (0xDBBBD, 'Chicken House'),
'Aginahs Cave': 0xDBBE3, 'Aginahs Cave': (0xDBBE3, 'Aginahs Cave'),
'Sahasrahlas Hut': 0xDBBB7, 'Sahasrahlas Hut': (0xDBBB7, 'Sahasrahlas Hut'),
'Cave Shop (Lake Hylia)': 0xDBBCA, 'Cave Shop (Lake Hylia)': (0xDBBCA, 'Cave Shop'),
'Capacity Upgrade': 0xDBBCF, 'Capacity Upgrade': (0xDBBCF, 'Capacity Upgrade'),
'Kakariko Well Drop': (0xDB85C, 0xDB85D), 'Kakariko Well Drop': ((0xDB85C, 0xDB85D),),
'Blacksmiths Hut': 0xDBBD6, 'Blacksmiths Hut': (0xDBBD6, 'Blacksmiths Hut'),
'Bat Cave Drop': (0xDB859, 0xDB85A), 'Bat Cave Drop': ((0xDB859, 0xDB85A),),
'Sick Kids House': 0xDBBB2, 'Sick Kids House': (0xDBBB2, 'Sick Kids House'),
'North Fairy Cave Drop': 0xDB857, 'North Fairy Cave Drop': (0xDB857,),
'Lost Woods Gamble': 0xDBBAE, 'Lost Woods Gamble': (0xDBBAE, 'Lost Woods Gamble'),
'Fortune Teller (Light)': 0xDBBD7, 'Fortune Teller (Light)': (0xDBBD7, 'Fortune Teller (Light)'),
'Snitch Lady (East)': 0xDBBB0, 'Snitch Lady (East)': (0xDBBB0, 'Snitch Lady (East)'),
'Snitch Lady (West)': 0xDBBB1, 'Snitch Lady (West)': (0xDBBB1, 'Snitch Lady (West)'),
'Bush Covered House': 0xDBBB6, 'Bush Covered House': (0xDBBB6, 'Bush Covered House'),
'Tavern (Front)': 0xDBBB4, 'Tavern (Front)': (0xDBBB4, 'Tavern (Front)'),
'Light World Bomb Hut': 0xDBBBC, 'Light World Bomb Hut': (0xDBBBC, 'Light World Bomb Hut'),
'Kakariko Shop': 0xDBBB8, 'Kakariko Shop': (0xDBBB8, 'Kakariko Shop'),
'Thieves Forest Hideout Drop': 0xDB853, 'Thieves Forest Hideout Drop': (0xDB853,),
'Lumberjack Tree Tree': 0xDB85B, 'Lumberjack Tree Tree': (0xDB85B,),
'Cave South of Haunted Grove': 0xDBBC3, 'Cave South of Haunted Grove': (0xDBBC3, 'Cave South of Haunted Grove'),
'Graveyard Cave': 0xDBBC4, 'Graveyard Cave': (0xDBBC4, 'Graveyard Cave'),
'Checkerboard Cave': 0xDBBF0, 'Checkerboard Cave': (0xDBBF0, 'Checkerboard Cave'),
'Mini Moldorm Cave': 0xDBBEF, 'Mini Moldorm Cave': (0xDBBEF, 'Mini Moldorm Cave'),
'Long Fairy Cave': 0xDBBC7, 'Long Fairy Cave': (0xDBBC7, 'Long Fairy Cave'),
'Good Bee Cave': 0xDBBDD, 'Good Bee Cave': (0xDBBDD, 'Good Bee Cave'),
'20 Rupee Cave': 0xDBBED, '20 Rupee Cave': (0xDBBED, '20 Rupee Cave'),
'50 Rupee Cave': 0xDBBEB, '50 Rupee Cave': (0xDBBEB, '50 Rupee Cave'),
'Ice Cave': 0xDBBF2, 'Ice Cave': (0xDBBF2, 'Ice Cave'),
'Bonk Rock Cave': 0xDBBEC, 'Bonk Rock Cave': (0xDBBEC, 'Bonk Rock Cave'),
'Library': 0xDBBBB, 'Library': (0xDBBBB, 'Library'),
'Witch Hut': 0xDBBBE, 'Witch Hut': (0xDBBBE, 'Witch Hut'),
'Sanctuary Grave': 0xDB85E, 'Sanctuary Grave': (0xDB85E,),
'Hookshot Fairy': 0xDBBC2, 'Hookshot Fairy': (0xDBBC2, 'Hookshot Fairy'),
'Pyramid Fairy': 0xDBBD5, 'Pyramid Fairy': (0xDBBD5, 'Pyramid Fairy'),
'East Dark World Hint': 0xDBBDB, 'East Dark World Hint': (0xDBBDB, 'East Dark World Hint'),
'Palace of Darkness Hint': 0xDBBDA, 'Palace of Darkness Hint': (0xDBBDA, 'Palace of Darkness Hint'),
'Dark Lake Hylia Fairy': 0xDBBDF, 'Dark Lake Hylia Fairy': (0xDBBDF, 'Healer Fairy'),
'Dark Lake Hylia Ledge Fairy': 0xDBBF3, 'Dark Lake Hylia Ledge Fairy': (0xDBBF3, 'Healer Fairy'),
'Dark Lake Hylia Ledge Spike Cave': 0xDBBEE, 'Dark Lake Hylia Ledge Spike Cave': (0xDBBEE, 'Dark Lake Hylia Ledge Spike Cave'),
'Dark Lake Hylia Ledge Hint': 0xDBBDC, 'Dark Lake Hylia Ledge Hint': (0xDBBDC, 'Dark Lake Hylia Ledge Hint'),
'Dark Swamp Cave': 0xDBBAF, 'Dark Swamp Cave': (0xDBBAF, 'Dark Swamp Cave'),
'Bonk Fairy (Dark)': 0xDBBEA, 'Bonk Fairy (Dark)': (0xDBBEA, 'Bonk Fairy'),
'Doorless Hut': 0xDBBBA, 'Doorless Hut': (0xDBBBA, 'Doorless Hut'),
'C-Shaped House': 0xDBBC6, 'C-Shaped House': (0xDBBC6, 'C-Shaped House'),
'Chest Game': 0xDBBB9, 'Chest Game': (0xDBBB9, 'Chest Game'),
'Dark World Hammer Peg Cave': 0xDBBF1, 'Dark World Hammer Peg Cave': (0xDBBF1, 'Dark World Hammer Peg Cave'),
'Red Shield Shop': 0xDBBE7, 'Red Shield Shop': (0xDBBE7, 'Red Shield Shop'),
'Dark Sanctuary Hint': 0xDBBCC, 'Dark Sanctuary Hint': (0xDBBCC, 'Dark Sanctuary Hint'),
'Fortune Teller (Dark)': 0xDBBD8, 'Fortune Teller (Dark)': (0xDBBD8, 'Fortune Teller (Dark)'),
'Dark World Shop': 0xDBBD2, 'Dark World Shop': (0xDBBD2, 'Dark World Shop'),
'Dark World Lumberjack Shop': 0xDBBC9, 'Dark World Lumberjack Shop': (0xDBBC9, 'Dark World Shop'),
'Dark World Potion Shop': 0xDBBE1, 'Dark World Potion Shop': (0xDBBE1, 'Dark World Shop'),
'Archery Game': 0xDBBCB, 'Archery Game': (0xDBBCB, 'Archery Game'),
'Dark Desert Cave': 0xDBBD1, 'Dark Desert Cave': (0xDBBD1, 'Dark Desert Cave'),
'Dark Desert Hint': 0xDBBD4, 'Dark Desert Hint': (0xDBBD4, 'Dark Desert Hint'),
'Dark Desert Fairy': 0xDBBC8, 'Dark Desert Fairy': (0xDBBC8, 'Healer Fairy'),
'Spike Cave': 0xDBBB3, 'Spike Cave': (0xDBBB3, 'Spike Cave'),
'Cave Shop (Dark Death Mountain)': 0xDBBE0, 'Cave Shop (Dark Death Mountain)': (0xDBBE0, 'Cave Shop'),
'Dark Death Mountain Fairy': 0xDBBE2, 'Dark Death Mountain Fairy': (0xDBBE2, 'Healer Fairy'),
'Mimic Cave Mirror Spot': 0xDBBC1, 'Mimic Cave Mirror Spot': (0xDBBC1, 'Mimic Cave'),
'Big Bomb Shop': 0xDBBC5, 'Big Bomb Shop': (0xDBBC5, 'Big Bomb Shop'),
'Dark Lake Hylia Shop': 0xDBBE6, 'Dark Lake Hylia Shop': (0xDBBE6, 'Dark World Shop'),
'Lumberjack House': 0xDBBE8, 'Lumberjack House': (0xDBBE8, 'Lumberjack House'),
'Lake Hylia Fortune Teller': 0xDBBE5, 'Lake Hylia Fortune Teller': (0xDBBE5, 'Fortune Teller (Light)'),
'Kakariko Gamble Game': 0xDBBD9} 'Kakariko Gamble Game': (0xDBBD9, 'Kakariko Gamble Game')}
exit_ids = {'Desert Palace Exit (South)': (0x09, 0x84), exit_ids = {'Desert Palace Exit (South)': (0x09, 0x84),
'Desert Palace Exit (West)': (0x0B, 0x83), 'Desert Palace Exit (West)': (0x0B, 0x83),

View File

@ -108,8 +108,8 @@ def create_regions(world):
create_region('Spectacle Rock Cave (Peak)', None, ['Spectacle Rock Cave Peak Drop', 'Spectacle Rock Cave Exit (Peak)']), create_region('Spectacle Rock Cave (Peak)', None, ['Spectacle Rock Cave Peak Drop', 'Spectacle Rock Cave Exit (Peak)']),
create_region('East Death Mountain (Bottom)', None, ['Broken Bridge (East)', '7 Chest Cave (Bottom)', '7 Chest Cave (Middle)', 'East Death Mountain Teleporter', 'Hookshot Fairy', 'Fairy Ascension Rocks', 'Spiral Cave (Bottom)']), create_region('East Death Mountain (Bottom)', None, ['Broken Bridge (East)', '7 Chest Cave (Bottom)', '7 Chest Cave (Middle)', 'East Death Mountain Teleporter', 'Hookshot Fairy', 'Fairy Ascension Rocks', 'Spiral Cave (Bottom)']),
create_region('Hookshot Fairy'), create_region('Hookshot Fairy'),
create_region('7 Chest Cave Cave Front', None, ['7 Chest Cave Push Block Reverse', '7 Chest Cave Exit (Bottom)']), create_region('7 Chest Cave Front', None, ['7 Chest Cave Push Block Reverse', '7 Chest Cave Exit (Bottom)']),
create_region('7 Chest Cave Cave Chest Area', ['[cave-009-1F] Death Mountain - right cave [top left chest]', create_region('7 Chest Cave Chest Area', ['[cave-009-1F] Death Mountain - right cave [top left chest]',
'[cave-009-1F] Death Mountain - right cave [top left middle chest]', '[cave-009-1F] Death Mountain - right cave [top left middle chest]',
'[cave-009-1F] Death Mountain - right cave [top right middle chest]', '[cave-009-1F] Death Mountain - right cave [top right middle chest]',
'[cave-009-1F] Death Mountain - right cave [top right chest]', '[cave-009-1F] Death Mountain - right cave [top right chest]',
@ -117,7 +117,7 @@ def create_regions(world):
'[cave-009-B1] Death Mountain - right cave [left chest]', '[cave-009-B1] Death Mountain - right cave [left chest]',
'[cave-009-B1] Death Mountain - right cave [right chest]'], '[cave-009-B1] Death Mountain - right cave [right chest]'],
['7 Chest Cave Push Block', '7 Chest Cave Bomb Jump']), ['7 Chest Cave Push Block', '7 Chest Cave Bomb Jump']),
create_region('7 Chest Cave Cave', None, ['7 Chest Cave Exit (Middle)', '7 Chest Cave Exit (Top)', '7 Chest Cave Drop']), create_region('7 Chest Cave', None, ['7 Chest Cave Exit (Middle)', '7 Chest Cave Exit (Top)', '7 Chest Cave Drop']),
create_region('East Death Mountain (Top)', None, ['7 Chest Cave (Top)', 'Death Mountain (Top)', 'Spiral Cave Ledge Access', 'East Death Mountain Drop', 'Turtle Rock Teleporter', 'Fairy Ascension Ledge']), create_region('East Death Mountain (Top)', None, ['7 Chest Cave (Top)', 'Death Mountain (Top)', 'Spiral Cave Ledge Access', 'East Death Mountain Drop', 'Turtle Rock Teleporter', 'Fairy Ascension Ledge']),
create_region('Spiral Cave Ledge', None, ['Spiral Cave', 'Spiral Cave Ledge Drop']), create_region('Spiral Cave Ledge', None, ['Spiral Cave', 'Spiral Cave Ledge Drop']),
create_region('Spiral Cave (Top)', ['[cave-012-1F] Death Mountain - left cave]'], ['Spiral Cave (top to bottom)', 'Spiral Cave Exit (Top)']), create_region('Spiral Cave (Top)', ['[cave-012-1F] Death Mountain - left cave]'], ['Spiral Cave (top to bottom)', 'Spiral Cave Exit (Top)']),

18
Rom.py
View File

@ -35,6 +35,9 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
for music_address in music_addresses: for music_address in music_addresses:
write_byte(rom, music_address, music) write_byte(rom, music_address, music)
# store old door overlay table
door_overlays = bytearray(rom[0x15488:0x15488+0x10A])
# patch entrances # patch entrances
for region in world.regions: for region in world.regions:
for exit in region.exits: for exit in region.exits:
@ -43,6 +46,12 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
for address in addresses: for address in addresses:
write_byte(rom, address, exit.target) write_byte(rom, address, exit.target)
# this does not yet seem to fix our door headaches ...
if world.fix_door_frames and exit.vanilla is not None:
# patch door overlay table. The value of where this now leads is patched into the location where this entrance would lead in vanilla
write_byte(rom, 0x15488 + (2*exit.vanilla), door_overlays[2*exit.target])
write_byte(rom, 0x15489 + (2 * exit.vanilla), door_overlays[(2 * exit.target) + 1])
# patch medallion requirements # patch medallion requirements
if world.required_medallions[0] == 'Bombos': if world.required_medallions[0] == 'Bombos':
write_byte(rom, 0x180022, 0x00) # requirement write_byte(rom, 0x180022, 0x00) # requirement
@ -236,12 +245,17 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
# disable open door sprites when exiting caves # disable open door sprites when exiting caves
# this does not seem to work completely yet # this does not seem to work completely yet
if world.shuffle not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: if world.fix_door_frames:
for i in range(0x85): for i in range(0x85):
write_byte(rom, 0x15274 + i, 0x00) write_byte(rom, 0x15274 + i, 0x00)
for i in range(0x86):
write_byte(rom, 0x15488 + i, 0x02)
# leave the entry marking tavern north a north facing exit
for i in range(0x82):
write_byte(rom, 0x15510 + i, 0x02)
# fix trock doors for reverse entrances # fix trock doors for reverse entrances
if world.shuffle != 'vanilla': if world.fix_trock_doors:
write_byte(rom, 0xFED31, 0x0E) # preopen bombable exit write_byte(rom, 0xFED31, 0x0E) # preopen bombable exit
write_byte(rom, 0xFEE41, 0x0E) # preopen bombable exit write_byte(rom, 0xFEE41, 0x0E) # preopen bombable exit
write_byte(rom, 0xFE465, 0x1E) # remove small key door on backside of big key door write_byte(rom, 0xFE465, 0x1E) # remove small key door on backside of big key door