Skip to content

Commit 2039f88

Browse files
Alchavqwint
authored andcommitted
ALTTP: Bomb Walls Logic Fixes (ArchipelagoMW#3130)
1 parent f8fa42c commit 2039f88

File tree

9 files changed

+54
-28
lines changed

9 files changed

+54
-28
lines changed

BaseClasses.py

-8
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,6 @@ def __init__(self, players: int):
160160
self.local_early_items = {player: {} for player in self.player_ids}
161161
self.indirect_connections = {}
162162
self.start_inventory_from_pool: Dict[int, Options.StartInventoryPool] = {}
163-
self.fix_trock_doors = self.AttributeProxy(
164-
lambda player: self.shuffle[player] != 'vanilla' or self.mode[player] == 'inverted')
165-
self.fix_skullwoods_exit = self.AttributeProxy(
166-
lambda player: self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeons_simple'])
167-
self.fix_palaceofdarkness_exit = self.AttributeProxy(
168-
lambda player: self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeons_simple'])
169-
self.fix_trock_exit = self.AttributeProxy(
170-
lambda player: self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeons_simple'])
171163

172164
for player in range(1, players + 1):
173165
def set_player_attr(attr, val):

worlds/alttp/EntranceShuffle.py

+8
Original file line numberDiff line numberDiff line change
@@ -2657,6 +2657,10 @@ def plando_connect(world, player: int):
26572657
('Turtle Rock (Dark Room) (North)', 'Turtle Rock (Crystaroller Room)'),
26582658
('Turtle Rock (Dark Room) (South)', 'Turtle Rock (Eye Bridge)'),
26592659
('Turtle Rock Dark Room (South)', 'Turtle Rock (Dark Room)'),
2660+
('Turtle Rock Second Section Bomb Wall', 'Turtle Rock (Second Section Bomb Wall)'),
2661+
('Turtle Rock Second Section from Bomb Wall', 'Turtle Rock (Second Section)'),
2662+
('Turtle Rock Eye Bridge Bomb Wall', 'Turtle Rock (Eye Bridge Bomb Wall)'),
2663+
('Turtle Rock Eye Bridge from Bomb Wall', 'Turtle Rock (Eye Bridge)'),
26602664
('Turtle Rock (Trinexx)', 'Turtle Rock (Trinexx)'),
26612665
('Palace of Darkness Bridge Room', 'Palace of Darkness (Center)'),
26622666
('Palace of Darkness Bonk Wall', 'Palace of Darkness (Bonk Section)'),
@@ -2815,6 +2819,10 @@ def plando_connect(world, player: int):
28152819
('Turtle Rock (Dark Room) (North)', 'Turtle Rock (Crystaroller Room)'),
28162820
('Turtle Rock (Dark Room) (South)', 'Turtle Rock (Eye Bridge)'),
28172821
('Turtle Rock Dark Room (South)', 'Turtle Rock (Dark Room)'),
2822+
('Turtle Rock Second Section Bomb Wall', 'Turtle Rock (Second Section Bomb Wall)'),
2823+
('Turtle Rock Second Section from Bomb Wall', 'Turtle Rock (Second Section)'),
2824+
('Turtle Rock Eye Bridge Bomb Wall', 'Turtle Rock (Eye Bridge Bomb Wall)'),
2825+
('Turtle Rock Eye Bridge from Bomb Wall', 'Turtle Rock (Eye Bridge)'),
28182826
('Turtle Rock (Trinexx)', 'Turtle Rock (Trinexx)'),
28192827
('Palace of Darkness Bridge Room', 'Palace of Darkness (Center)'),
28202828
('Palace of Darkness Bonk Wall', 'Palace of Darkness (Bonk Section)'),

worlds/alttp/InvertedRegions.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,16 @@ def create_inverted_regions(world, player):
408408
['Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)']),
409409
create_dungeon_region(world, player, 'Turtle Rock (Second Section)', 'Turtle Rock',
410410
['Turtle Rock - Big Key Chest', 'Turtle Rock - Pokey 2 Key Drop'],
411-
['Turtle Rock Ledge Exit (West)', 'Turtle Rock Chain Chomp Staircase',
412-
'Turtle Rock Big Key Door']),
411+
['Turtle Rock Chain Chomp Staircase', 'Turtle Rock Big Key Door',
412+
'Turtle Rock Second Section Bomb Wall']),
413+
create_dungeon_region(world, player, 'Turtle Rock (Second Section Bomb Wall)', 'Turtle Rock', None, ['Turtle Rock Ledge Exit (West)', 'Turtle Rock Second Section from Bomb Wall']),
413414
create_dungeon_region(world, player, 'Turtle Rock (Big Chest)', 'Turtle Rock', ['Turtle Rock - Big Chest'], ['Turtle Rock (Big Chest) (North)', 'Turtle Rock Ledge Exit (East)']),
414415
create_dungeon_region(world, player, 'Turtle Rock (Crystaroller Room)', 'Turtle Rock', ['Turtle Rock - Crystaroller Room'], ['Turtle Rock Dark Room Staircase', 'Turtle Rock Big Key Door Reverse']),
415416
create_dungeon_region(world, player, 'Turtle Rock (Dark Room)', 'Turtle Rock', None, ['Turtle Rock (Dark Room) (North)', 'Turtle Rock (Dark Room) (South)']),
417+
create_dungeon_region(world, player, 'Turtle Rock (Eye Bridge Bomb Wall)', 'Turtle Rock', None, ['Turtle Rock Isolated Ledge Exit', 'Turtle Rock Eye Bridge from Bomb Wall']),
416418
create_dungeon_region(world, player, 'Turtle Rock (Eye Bridge)', 'Turtle Rock', ['Turtle Rock - Eye Bridge - Bottom Left', 'Turtle Rock - Eye Bridge - Bottom Right',
417419
'Turtle Rock - Eye Bridge - Top Left', 'Turtle Rock - Eye Bridge - Top Right'],
418-
['Turtle Rock Dark Room (South)', 'Turtle Rock (Trinexx)', 'Turtle Rock Isolated Ledge Exit']),
420+
['Turtle Rock Dark Room (South)', 'Turtle Rock (Trinexx)', 'Turtle Rock Eye Bridge Bomb Wall']),
419421
create_dungeon_region(world, player, 'Turtle Rock (Trinexx)', 'Turtle Rock', ['Turtle Rock - Boss', 'Turtle Rock - Prize']),
420422
create_dungeon_region(world, player, 'Palace of Darkness (Entrance)', 'Palace of Darkness', ['Palace of Darkness - Shooter Room'], ['Palace of Darkness Bridge Room', 'Palace of Darkness Bonk Wall', 'Palace of Darkness Exit']),
421423
create_dungeon_region(world, player, 'Palace of Darkness (Center)', 'Palace of Darkness', ['Palace of Darkness - The Arena - Bridge', 'Palace of Darkness - Stalfos Basement'],

worlds/alttp/Regions.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,15 @@ def create_regions(world, player):
336336
['Turtle Rock Entrance to Pokey Room', 'Turtle Rock Entrance Gap Reverse']),
337337
create_dungeon_region(world, player, 'Turtle Rock (Pokey Room)', 'Turtle Rock', ['Turtle Rock - Pokey 1 Key Drop'], ['Turtle Rock (Pokey Room) (North)', 'Turtle Rock (Pokey Room) (South)']),
338338
create_dungeon_region(world, player, 'Turtle Rock (Chain Chomp Room)', 'Turtle Rock', ['Turtle Rock - Chain Chomps'], ['Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)']),
339-
create_dungeon_region(world, player, 'Turtle Rock (Second Section)', 'Turtle Rock', ['Turtle Rock - Big Key Chest', 'Turtle Rock - Pokey 2 Key Drop'], ['Turtle Rock Ledge Exit (West)', 'Turtle Rock Chain Chomp Staircase', 'Turtle Rock Big Key Door']),
339+
create_dungeon_region(world, player, 'Turtle Rock (Second Section)', 'Turtle Rock', ['Turtle Rock - Big Key Chest', 'Turtle Rock - Pokey 2 Key Drop'], ['Turtle Rock Chain Chomp Staircase', 'Turtle Rock Big Key Door', 'Turtle Rock Second Section Bomb Wall']),
340+
create_dungeon_region(world, player, 'Turtle Rock (Second Section Bomb Wall)', 'Turtle Rock', None, ['Turtle Rock Ledge Exit (West)', 'Turtle Rock Second Section from Bomb Wall']),
340341
create_dungeon_region(world, player, 'Turtle Rock (Big Chest)', 'Turtle Rock', ['Turtle Rock - Big Chest'], ['Turtle Rock (Big Chest) (North)', 'Turtle Rock Ledge Exit (East)']),
341342
create_dungeon_region(world, player, 'Turtle Rock (Crystaroller Room)', 'Turtle Rock', ['Turtle Rock - Crystaroller Room'], ['Turtle Rock Dark Room Staircase', 'Turtle Rock Big Key Door Reverse']),
342343
create_dungeon_region(world, player, 'Turtle Rock (Dark Room)', 'Turtle Rock', None, ['Turtle Rock (Dark Room) (North)', 'Turtle Rock (Dark Room) (South)']),
344+
create_dungeon_region(world, player, 'Turtle Rock (Eye Bridge Bomb Wall)', 'Turtle Rock', None, ['Turtle Rock Isolated Ledge Exit', 'Turtle Rock Eye Bridge from Bomb Wall']),
343345
create_dungeon_region(world, player, 'Turtle Rock (Eye Bridge)', 'Turtle Rock', ['Turtle Rock - Eye Bridge - Bottom Left', 'Turtle Rock - Eye Bridge - Bottom Right',
344346
'Turtle Rock - Eye Bridge - Top Left', 'Turtle Rock - Eye Bridge - Top Right'],
345-
['Turtle Rock Dark Room (South)', 'Turtle Rock (Trinexx)', 'Turtle Rock Isolated Ledge Exit']),
347+
['Turtle Rock Dark Room (South)', 'Turtle Rock (Trinexx)', 'Turtle Rock Eye Bridge Bomb Wall']),
346348
create_dungeon_region(world, player, 'Turtle Rock (Trinexx)', 'Turtle Rock', ['Turtle Rock - Boss', 'Turtle Rock - Prize']),
347349
create_dungeon_region(world, player, 'Palace of Darkness (Entrance)', 'Palace of Darkness', ['Palace of Darkness - Shooter Room'], ['Palace of Darkness Bridge Room', 'Palace of Darkness Bonk Wall', 'Palace of Darkness Exit']),
348350
create_dungeon_region(world, player, 'Palace of Darkness (Center)', 'Palace of Darkness', ['Palace of Darkness - The Arena - Bridge', 'Palace of Darkness - Stalfos Basement'],

worlds/alttp/Rom.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,11 @@ def patch_rom(world: MultiWorld, rom: LocalRom, player: int, enemized: bool):
868868
exit.name not in {'Palace of Darkness Exit', 'Tower of Hera Exit', 'Swamp Palace Exit'}):
869869
# For exits that connot be reached from another, no need to apply offset fixes.
870870
rom.write_int16(0x15DB5 + 2 * offset, link_y) # same as final else
871-
elif room_id == 0x0059 and world.fix_skullwoods_exit[player]:
871+
elif room_id == 0x0059 and local_world.fix_skullwoods_exit:
872872
rom.write_int16(0x15DB5 + 2 * offset, 0x00F8)
873-
elif room_id == 0x004a and world.fix_palaceofdarkness_exit[player]:
873+
elif room_id == 0x004a and local_world.fix_palaceofdarkness_exit:
874874
rom.write_int16(0x15DB5 + 2 * offset, 0x0640)
875-
elif room_id == 0x00d6 and world.fix_trock_exit[player]:
875+
elif room_id == 0x00d6 and local_world.fix_trock_exit:
876876
rom.write_int16(0x15DB5 + 2 * offset, 0x0134)
877877
elif room_id == 0x000c and world.shuffle_ganon: # fix ganons tower exit point
878878
rom.write_int16(0x15DB5 + 2 * offset, 0x00A4)
@@ -1674,14 +1674,14 @@ def get_reveal_bytes(itemName):
16741674
rom.write_byte(0x4E3BB, 0xEB)
16751675

16761676
# fix trock doors for reverse entrances
1677-
if world.fix_trock_doors[player]:
1677+
if local_world.fix_trock_doors:
16781678
rom.write_byte(0xFED31, 0x0E) # preopen bombable exit
16791679
rom.write_byte(0xFEE41, 0x0E) # preopen bombable exit
16801680
# included unconditionally in base2current
16811681
# rom.write_byte(0xFE465, 0x1E) # remove small key door on backside of big key door
16821682
else:
1683-
rom.write_byte(0xFED31, 0x2A) # preopen bombable exit
1684-
rom.write_byte(0xFEE41, 0x2A) # preopen bombable exit
1683+
rom.write_byte(0xFED31, 0x2A) # bombable exit
1684+
rom.write_byte(0xFEE41, 0x2A) # bombable exit
16851685

16861686
if world.tile_shuffle[player]:
16871687
tile_set = TileSet.get_random_tile_set(world.per_slot_randoms[player])

worlds/alttp/Rules.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ def global_rules(world, player):
279279
(state.multiworld.can_take_damage[player] and (state.has('Pegasus Boots', player) or has_hearts(state, player, 4))))))
280280
)
281281

282+
set_rule(world.get_entrance('Hookshot Cave Bomb Wall (North)', player), lambda state: can_use_bombs(state, player))
283+
set_rule(world.get_entrance('Hookshot Cave Bomb Wall (South)', player), lambda state: can_use_bombs(state, player))
284+
282285
set_rule(world.get_location('Hookshot Cave - Top Right', player), lambda state: state.has('Hookshot', player))
283286
set_rule(world.get_location('Hookshot Cave - Top Left', player), lambda state: state.has('Hookshot', player))
284287
set_rule(world.get_location('Hookshot Cave - Bottom Right', player),
@@ -477,7 +480,6 @@ def global_rules(world, player):
477480
set_rule(world.get_location('Turtle Rock - Big Chest', player), lambda state: state.has('Big Key (Turtle Rock)', player) and (state.has('Cane of Somaria', player) or state.has('Hookshot', player)))
478481
set_rule(world.get_entrance('Turtle Rock (Big Chest) (North)', player), lambda state: state.has('Cane of Somaria', player) or state.has('Hookshot', player))
479482
set_rule(world.get_entrance('Turtle Rock Big Key Door', player), lambda state: state.has('Big Key (Turtle Rock)', player) and can_kill_most_things(state, player, 10))
480-
set_rule(world.get_entrance('Turtle Rock Ledge Exit (West)', player), lambda state: can_use_bombs(state, player) and can_kill_most_things(state, player, 10))
481483
set_rule(world.get_location('Turtle Rock - Chain Chomps', player), lambda state: can_use_bombs(state, player) or can_shoot_arrows(state, player)
482484
or has_beam_sword(state, player) or state.has_any(["Blue Boomerang", "Red Boomerang", "Hookshot", "Cane of Somaria", "Fire Rod", "Ice Rod"], player))
483485
set_rule(world.get_entrance('Turtle Rock (Dark Room) (North)', player), lambda state: state.has('Cane of Somaria', player))
@@ -487,6 +489,13 @@ def global_rules(world, player):
487489
set_rule(world.get_location('Turtle Rock - Eye Bridge - Top Left', player), lambda state: state.has('Cane of Byrna', player) or state.has('Cape', player) or state.has('Mirror Shield', player))
488490
set_rule(world.get_location('Turtle Rock - Eye Bridge - Top Right', player), lambda state: state.has('Cane of Byrna', player) or state.has('Cape', player) or state.has('Mirror Shield', player))
489491
set_rule(world.get_entrance('Turtle Rock (Trinexx)', player), lambda state: state._lttp_has_key('Small Key (Turtle Rock)', player, 6) and state.has('Big Key (Turtle Rock)', player) and state.has('Cane of Somaria', player))
492+
set_rule(world.get_entrance('Turtle Rock Second Section Bomb Wall', player), lambda state: can_kill_most_things(state, player, 10))
493+
494+
if not world.worlds[player].fix_trock_doors:
495+
add_rule(world.get_entrance('Turtle Rock Second Section Bomb Wall', player), lambda state: can_use_bombs(state, player))
496+
set_rule(world.get_entrance('Turtle Rock Second Section from Bomb Wall', player), lambda state: can_use_bombs(state, player))
497+
set_rule(world.get_entrance('Turtle Rock Eye Bridge from Bomb Wall', player), lambda state: can_use_bombs(state, player))
498+
set_rule(world.get_entrance('Turtle Rock Eye Bridge Bomb Wall', player), lambda state: can_use_bombs(state, player))
490499

491500
if world.enemy_shuffle[player]:
492501
set_rule(world.get_entrance('Palace of Darkness Bonk Wall', player), lambda state: can_bomb_or_bonk(state, player) and can_kill_most_things(state, player, 3))

worlds/alttp/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ def __init__(self, *args, **kwargs):
261261
self.dungeons = {}
262262
self.waterfall_fairy_bottle_fill = "Bottle"
263263
self.pyramid_fairy_bottle_fill = "Bottle"
264+
self.fix_trock_doors = None
265+
self.fix_skullwoods_exit = None
266+
self.fix_palaceofdarkness_exit = None
267+
self.fix_trock_exit = None
264268
super(ALTTPWorld, self).__init__(*args, **kwargs)
265269

266270
@classmethod
@@ -280,6 +284,15 @@ def generate_early(self):
280284
player = self.player
281285
multiworld = self.multiworld
282286

287+
self.fix_trock_doors = (multiworld.entrance_shuffle[player] != 'vanilla'
288+
or multiworld.mode[player] == 'inverted')
289+
self.fix_skullwoods_exit = multiworld.entrance_shuffle[player] not in ['vanilla', 'simple', 'restricted',
290+
'dungeons_simple']
291+
self.fix_palaceofdarkness_exit = multiworld.entrance_shuffle[player] not in ['dungeons_simple', 'vanilla',
292+
'simple', 'restricted']
293+
self.fix_trock_exit = multiworld.entrance_shuffle[player] not in ['vanilla', 'simple', 'restricted',
294+
'dungeons_simple']
295+
283296
# fairy bottle fills
284297
bottle_options = [
285298
"Bottle (Red Potion)", "Bottle (Green Potion)", "Bottle (Blue Potion)",

worlds/alttp/test/inverted_owg/TestDeathMountain.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ def testEastDarkWorldDeathMountain(self):
101101
["Hookshot Cave - Bottom Right", False, []],
102102
["Hookshot Cave - Bottom Right", False, [], ['Hookshot', 'Pegasus Boots']],
103103
["Hookshot Cave - Bottom Right", False, [], ['Progressive Glove', 'Pegasus Boots', 'Magic Mirror']],
104-
["Hookshot Cave - Bottom Right", True, ['Pegasus Boots']],
104+
["Hookshot Cave - Bottom Right", True, ['Pegasus Boots', 'Bomb Upgrade (50)']],
105105

106106
["Hookshot Cave - Bottom Left", False, []],
107107
["Hookshot Cave - Bottom Left", False, [], ['Hookshot']],
108108
["Hookshot Cave - Bottom Left", False, [], ['Progressive Glove', 'Pegasus Boots', 'Magic Mirror']],
109-
["Hookshot Cave - Bottom Left", True, ['Pegasus Boots', 'Hookshot']],
109+
["Hookshot Cave - Bottom Left", True, ['Pegasus Boots', 'Hookshot', 'Bomb Upgrade (50)']],
110110

111111
["Hookshot Cave - Top Left", False, []],
112112
["Hookshot Cave - Top Left", False, [], ['Hookshot']],
113113
["Hookshot Cave - Top Left", False, [], ['Progressive Glove', 'Pegasus Boots', 'Magic Mirror']],
114-
["Hookshot Cave - Top Left", True, ['Pegasus Boots', 'Hookshot']],
114+
["Hookshot Cave - Top Left", True, ['Pegasus Boots', 'Hookshot', 'Bomb Upgrade (50)']],
115115

116116
["Hookshot Cave - Top Right", False, []],
117117
["Hookshot Cave - Top Right", False, [], ['Hookshot']],
118118
["Hookshot Cave - Top Right", False, [], ['Progressive Glove', 'Pegasus Boots', 'Magic Mirror']],
119-
["Hookshot Cave - Top Right", True, ['Pegasus Boots', 'Hookshot']],
119+
["Hookshot Cave - Top Right", True, ['Pegasus Boots', 'Hookshot', 'Bomb Upgrade (50)']],
120120
])

0 commit comments

Comments
 (0)