diff --git a/EntranceShuffle.py b/EntranceShuffle.py index 97998fc2..f73f0ea3 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -47,7 +47,24 @@ def link_entrances(world, player): if world.shuffle[player] == 'vanilla': for exitname, regionname in inverted_default_dungeon_connections: connect_simple(world, exitname, regionname, player) + + # inverted entrance mods + for owid in swapped_connections.keys(): + if (world.mode[player] == 'inverted') != (owid in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): + for (entrancename, exitname) in swapped_connections[owid]: + try: + connect_two_way(world, entrancename, exitname, player) + except RuntimeError: + connect_entrance(world, entrancename, exitname, player) + if (world.mode[player] == 'inverted') != (0x03 in world.owswaps[player][0] and world.owSwap[player] == 'mixed') and \ + (world.mode[player] == 'inverted') == (0x0a in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): + connect_entrance(world, 'Death Mountain Return Cave (West)', 'Dark Death Mountain Healer Fairy', player) + elif (world.mode[player] == 'inverted') != (0x0a in world.owswaps[player][0] and world.owSwap[player] == 'mixed') and \ + (world.mode[player] == 'inverted') == (0x03 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): + connect_two_way(world, 'Bumper Cave (Top)', 'Death Mountain Return Cave Exit (West)', player) + + # dungeon entrance shuffle if world.shuffle[player] == 'dungeonssimple': simple_shuffle_dungeons(world, player) elif world.shuffle[player] == 'dungeonsfull': @@ -1533,7 +1550,9 @@ def connect_entrance(world, entrancename, exitname, player): addresses = door_addresses[entrance.name][0] entrance.connect(region, addresses, target) - world.spoiler.set_entrance(entrance.name, exit.name if exit is not None else region.name, 'entrance', player) + + if world.shuffle[player] not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: + world.spoiler.set_entrance(entrance.name, exit.name if exit is not None else region.name, 'entrance', player) def connect_exit(world, exitname, entrancename, player): entrance = world.get_entrance(entrancename, player) @@ -1544,7 +1563,9 @@ def connect_exit(world, exitname, entrancename, player): exit.connected_region.entrances.remove(exit) exit.connect(entrance.parent_region, door_addresses[entrance.name][1], exit_ids[exit.name][1]) - world.spoiler.set_entrance(entrance.name, exit.name, 'exit', player) + + if world.shuffle[player] not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: + world.spoiler.set_entrance(entrance.name, exit.name, 'exit', player) def connect_two_way(world, entrancename, exitname, player): @@ -1559,7 +1580,9 @@ def connect_two_way(world, entrancename, exitname, player): entrance.connect(exit.parent_region, door_addresses[entrance.name][0], exit_ids[exit.name][0]) exit.connect(entrance.parent_region, door_addresses[entrance.name][1], exit_ids[exit.name][1]) - world.spoiler.set_entrance(entrance.name, exit.name, 'both', player) + + if world.shuffle[player] not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: + world.spoiler.set_entrance(entrance.name, exit.name, 'both', player) def scramble_holes(world, player): @@ -2853,46 +2876,34 @@ default_connections = [('Waterfall of Wishing', 'Waterfall of Wishing'), ('Pyramid Hole', 'Pyramid'), ('Pyramid Entrance', 'Bottom of Pyramid'), ('Inverted Pyramid Hole', 'Pyramid'), - ('Inverted Pyramid Entrance', 'Bottom of Pyramid') + ('Inverted Pyramid Entrance', 'Bottom of Pyramid'), + ('Pyramid Exit', 'Pyramid Exit Ledge') ] -open_default_connections = [('Old Man Cave (West)', 'Old Man Cave Ledge'), - ('Old Man Cave (East)', 'Old Man Cave'), - ('Old Man Cave Exit (West)', 'Mountain Entry Entrance'), - ('Old Man Cave Exit (East)', 'West Death Mountain (Bottom)'), - ('Death Mountain Return Cave (East)', 'Death Mountain Return Cave'), - ('Death Mountain Return Cave (West)', 'Death Mountain Return Cave'), - ('Death Mountain Return Cave Exit (West)', 'Mountain Entry Ledge'), - ('Death Mountain Return Cave Exit (East)', 'West Death Mountain (Bottom)'), - ('Bumper Cave (Bottom)', 'Bumper Cave'), - ('Bumper Cave (Top)', 'Bumper Cave'), - ('Bumper Cave Exit (Top)', 'Bumper Cave Ledge'), - ('Bumper Cave Exit (Bottom)', 'Bumper Cave Entrance'), - ('Dark Death Mountain Fairy', 'Dark Death Mountain Healer Fairy'), +swapped_connections = { + 0x03: [ + ('Old Man Cave (East)', 'Death Mountain Return Cave Exit (West)'), + #('Death Mountain Return Cave (East)', 'Death Mountain Return Cave Exit (East)'), + ('Dark Death Mountain Fairy', 'Old Man Cave Exit (East)') + ], + 0x0a: [ + ('Old Man Cave (West)', 'Bumper Cave Exit (Bottom)'), + ('Death Mountain Return Cave (West)', 'Bumper Cave Exit (Top)'), + ('Bumper Cave (Bottom)', 'Old Man Cave Exit (West)'), + ('Bumper Cave (Top)', 'Dark Death Mountain Healer Fairy') + ], + 0x1b: [ + ('Inverted Pyramid Entrance', 'Pyramid Exit') + ] +} - ('Links House', 'Links House'), +open_default_connections = [('Links House', 'Links House'), ('Links House Exit', 'Links House Area'), - ('Big Bomb Shop', 'Big Bomb Shop'), - ('Pyramid Exit', 'Pyramid Exit Ledge')] + ('Big Bomb Shop', 'Big Bomb Shop')] -inverted_default_connections = [('Old Man Cave (West)', 'Bumper Cave'), - ('Old Man Cave (East)', 'Death Mountain Return Cave'), - ('Old Man Cave Exit (West)', 'Bumper Cave Entrance'), - ('Old Man Cave Exit (East)', 'West Dark Death Mountain (Bottom)'), - ('Death Mountain Return 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)'), - ('Bumper Cave (Bottom)', 'Old Man Cave Ledge'), - ('Bumper Cave (Top)', 'Dark Death Mountain Healer Fairy'), - ('Bumper Cave Exit (Top)', 'Mountain Entry Ledge'), - ('Bumper Cave Exit (Bottom)', 'Mountain Entry Entrance'), - ('Dark Death Mountain Fairy', 'Old Man Cave'), - - ('Links House', 'Big Bomb Shop'), +inverted_default_connections = [('Links House', 'Big Bomb Shop'), ('Links House Exit', 'Big Bomb Shop Area'), - ('Big Bomb Shop', 'Links House'), - ('Pyramid Exit', 'Hyrule Castle Ledge')] + ('Big Bomb Shop', 'Links House')] # non shuffled dungeons default_dungeon_connections = [('Desert Palace Entrance (South)', 'Desert South Portal'), diff --git a/OWEdges.py b/OWEdges.py index dd77f8e7..22c67a54 100644 --- a/OWEdges.py +++ b/OWEdges.py @@ -780,7 +780,7 @@ OWTileGroups = { 'Ice Palace Area' ] ), - ("West Mountain", "Entrance"): ( + ("Mountain Entry", "Regular"): ( [ 0x0a, 0x4a ], diff --git a/Rom.py b/Rom.py index c2b8d1d5..54d0916d 100644 --- a/Rom.py +++ b/Rom.py @@ -2471,28 +2471,6 @@ def set_inverted_mode(world, player, rom, inverted_buffer): rom.write_byte(snes_to_pc(0x02D9B8), 0x12) rom.write_bytes(0x180247, [0x00, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00]) #indicates the overworld door being used for the single entrance spawn point - - rom.write_byte(0xDBB73 + 0x6F, 0x07) # DDM fairy entrance to old man fetch east UW - write_int16(rom, 0x15AEE + 2*0x18, 0x00F1) # old man fetch UW to DDM fairy entrance - rom.write_byte(0x15B8C + 0x18, 0x43) - write_int16(rom, 0x15BDB + 2 * 0x18, 0x1400) - write_int16(rom, 0x15C79 + 2 * 0x18, 0x0294) - write_int16(rom, 0x15D17 + 2 * 0x18, 0x0600) - write_int16(rom, 0x15DB5 + 2 * 0x18, 0x02E8) - write_int16(rom, 0x15E53 + 2 * 0x18, 0x0678) - write_int16(rom, 0x15EF1 + 2 * 0x18, 0x0303) - write_int16(rom, 0x15F8F + 2 * 0x18, 0x0685) - rom.write_byte(0x1602D + 0x18, 0x0A) - rom.write_byte(0x1607C + 0x18, 0xF6) - write_int16(rom, 0x160CB + 2 * 0x18, 0x0000) - write_int16(rom, 0x16169 + 2 * 0x18, 0x0000) - - rom.write_byte(0xDBB73 + 0x06, 0x2E) # old man fetch east entrance to DMD west UW - write_int16(rom, 0x15AEE + 2*0x08, 0x00E6) # DMD west UW to old man fetch east entrance - if (world.mode[player] == 'inverted') != (0x0A in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): - rom.write_byte(0xDBB73 + 0x16, 0x5E) # bumper cave top entrance to DDM Fairy UW - else: - rom.write_byte(0xDBB73 + 0x2D, 0x5E) # DMD west entrance to DDM Fairy if (world.mode[player] == 'inverted') != (0x05 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): rom.write_bytes(snes_to_pc(0x1BC655), [0x4A, 0x1D, 0x82]) # add warp under rock if (world.mode[player] == 'inverted') != (0x07 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): @@ -2502,17 +2480,6 @@ def set_inverted_mode(world, player, rom, inverted_buffer): rom.write_bytes(0x0086E, [0x5C, 0x00, 0xA0, 0xA1]) # TR tail if world.shuffle[player] in ['vanilla']: world.fix_trock_doors[player] = True - if (world.mode[player] == 'inverted') != (0x0A in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): - if world.shuffle[player] in ['vanilla', 'dungeonssimple', 'dungeonsfull']: - rom.write_byte(0xDBB73 + 0x15, 0x06) # bumper cave bottom entrance to old man fetch west UW - write_int16(rom, 0x15AEE + 2*0x17, 0x00F0) # old man fetch west UW to bumper cave bottom entrance - rom.write_byte(0xDBB73 + 0x05, 0x16) # old man fetch west entrance to bumper cave bottom UW - write_int16(rom, 0x15AEE + 2*0x07, 0x00FB) # bumper cave bottom UW to old man fetch west entrance - rom.write_byte(0xDBB73 + 0x2D, 0x17) # DMD west entrance to bumper cave top UW - write_int16(rom, 0x15AEE + 2*0x2F, 0x00EB) # bumper cave top UW to DMD west entrance - if (world.mode[player] == 'inverted') == (0x03 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): - rom.write_byte(0xDBB73 + 0x16, 0x2E) # bumper cave top entrance to DMD west UW - write_int16(rom, 0x15AEE + 2*0x18, 0x00E6) # DMD west UW to bumper cave top entrance if (world.mode[player] == 'inverted') != (0x10 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): rom.write_bytes(snes_to_pc(0x1BC67A), [0x2E, 0x0B, 0x82]) # add warp under rock if (world.mode[player] == 'inverted') != (0x1B in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): @@ -2603,21 +2570,6 @@ def set_inverted_mode(world, player, rom, inverted_buffer): write_int16(rom, 0xDB96F + 2 * 0x35, 0x001B) # move pyramid exit door write_int16(rom, 0xDBA71 + 2 * 0x35, 0x011C) - rom.write_byte(0xDBB73 + 0x35, 0x36) - - write_int16(rom, 0x15AEE + 2 * 0x37, 0x0010) # pyramid exit to new hc area - rom.write_byte(0x15B8C + 0x37, 0x1B) - write_int16(rom, 0x15BDB + 2 * 0x37, 0x000E) - write_int16(rom, 0x15C79 + 2 * 0x37, 0x0600) - write_int16(rom, 0x15D17 + 2 * 0x37, 0x0676) - write_int16(rom, 0x15DB5 + 2 * 0x37, 0x0604) - write_int16(rom, 0x15E53 + 2 * 0x37, 0x06E8) - write_int16(rom, 0x15EF1 + 2 * 0x37, 0x066D) - write_int16(rom, 0x15F8F + 2 * 0x37, 0x06F3) - rom.write_byte(0x1602D + 0x37, 0x00) - rom.write_byte(0x1607C + 0x37, 0x0A) - write_int16(rom, 0x160CB + 2 * 0x37, 0x0000) - write_int16(rom, 0x16169 + 2 * 0x37, 0x811C) if (world.mode[player] == 'inverted') != (0x29 in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): rom.write_bytes(snes_to_pc(0x06B2AB), [0xF0, 0xE1, 0x05]) # frog pickup on contact if (world.mode[player] == 'inverted') != (0x2C in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):