From b251df440a460a4b6bbfa7cd7d8f82f9c1b5261f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 4 Nov 2021 21:34:31 -0500 Subject: [PATCH] Added pseudo items/locations in prep for Big Bomb logic --- ItemList.py | 6 ++++++ Items.py | 2 ++ Regions.py | 6 ++++-- Rules.py | 16 +++++++--------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ItemList.py b/ItemList.py index 817eb72a..b22b5cae 100644 --- a/ItemList.py +++ b/ItemList.py @@ -223,6 +223,12 @@ def generate_itempool(world, player): world.push_item(world.get_location('Floodgate', player), ItemFactory('Open Floodgate', player), False) world.get_location('Floodgate', player).event = True world.get_location('Floodgate', player).locked = True + world.push_item(world.get_location('Big Bomb', player), ItemFactory('Pick Up Big Bomb', player), False) + world.get_location('Big Bomb', player).event = True + world.get_location('Big Bomb', player).locked = True + world.push_item(world.get_location('Pyramid Crack', player), ItemFactory('Detonate Big Bomb', player), False) + world.get_location('Pyramid Crack', player).event = True + world.get_location('Pyramid Crack', player).locked = True world.push_item(world.get_location('Trench 1 Switch', player), ItemFactory('Trench 1 Filled', player), False) world.get_location('Trench 1 Switch', player).event = True world.get_location('Trench 1 Switch', player).locked = True diff --git a/Items.py b/Items.py index 808a0740..d78170e9 100644 --- a/Items.py +++ b/Items.py @@ -177,6 +177,8 @@ item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narche 'Return Smith': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Pick Up Purple Chest': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Open Floodgate': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), + 'Pick Up Big Bomb': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), + 'Detonate Big Bomb': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Trench 1 Filled': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Trench 2 Filled': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Drained Swamp': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), diff --git a/Regions.py b/Regions.py index 26b3aeb7..2c3cb99f 100644 --- a/Regions.py +++ b/Regions.py @@ -163,7 +163,7 @@ def create_regions(world, player): create_dw_region(player, 'Dark Grassy Lawn', None, ['Grassy Lawn Pegs', 'Dark World Shop', 'Kakariko Grass Mirror Spot']), create_dw_region(player, 'Shield Shop Area', None, ['Shield Shop Fence (Outer) Ledge Drop', 'Forgotton Forest Mirror Spot', 'Shield Shop NW', 'Shield Shop NE']), create_dw_region(player, 'Shield Shop Fence', None, ['Shield Shop Fence (Inner) Ledge Drop', 'Red Shield Shop', 'Forgotton Forest Fence Mirror Spot']), - create_dw_region(player, 'Pyramid Area', ['Pyramid'], ['Pyramid Fairy', 'Pyramid Hole', 'HC Ledge Mirror Spot', 'HC Courtyard Mirror Spot', 'HC Area Mirror Spot', 'HC East Entry Mirror Spot', 'Pyramid ES']), + create_dw_region(player, 'Pyramid Area', ['Pyramid', 'Pyramid Crack'], ['Pyramid Fairy', 'Pyramid Hole', 'HC Ledge Mirror Spot', 'HC Courtyard Mirror Spot', 'HC Area Mirror Spot', 'HC East Entry Mirror Spot', 'Pyramid ES']), create_dw_region(player, 'Pyramid Exit Ledge', None, ['Pyramid Exit Ledge Drop', 'HC Courtyard Left Mirror Spot', 'Pyramid Entrance']), create_dw_region(player, 'Pyramid Pass', None, ['Post Aga Inverted Teleporter', 'HC Area South Mirror Spot', 'Pyramid SW', 'Pyramid SE']), create_dw_region(player, 'Broken Bridge Area', None, ['Broken Bridge Hammer Rock (South)', 'Broken Bridge Water Drop', 'Wooden Bridge Mirror Spot', 'Broken Bridge SW']), @@ -321,7 +321,7 @@ def create_regions(world, player): create_cave_region(player, 'Dark World Hammer Peg Cave', 'a cave with an item', ['Peg Cave']), create_cave_region(player, 'Archery Game', 'a game of skill'), create_cave_region(player, 'Bonk Fairy (Dark)', 'a fairy fountain'), - create_cave_region(player, 'Big Bomb Shop', 'the bomb shop'), + create_cave_region(player, 'Big Bomb Shop', 'the bomb shop', ['Big Bomb']), create_cave_region(player, 'Dark Lake Hylia Healer Fairy', 'a fairy fountain'), create_cave_region(player, 'East Dark World Hint', 'a storyteller'), create_cave_region(player, 'Hype Cave', 'a bounty of five items', ['Hype Cave - Top', 'Hype Cave - Middle Right', 'Hype Cave - Middle Left', @@ -1488,6 +1488,8 @@ location_table = {'Mushroom': (0x180013, 0x186338, False, 'in the woods'), 'Frog': (None, None, False, None), 'Missing Smith': (None, None, False, None), 'Dark Blacksmith Ruins': (None, None, False, None), + 'Big Bomb': (None, None, False, None), + 'Pyramid Crack': (None, None, False, None), 'Trench 1 Switch': (None, None, False, None), 'Trench 2 Switch': (None, None, False, None), 'Swamp Drain': (None, None, False, None), diff --git a/Rules.py b/Rules.py index 695104d1..81359f13 100644 --- a/Rules.py +++ b/Rules.py @@ -58,14 +58,7 @@ def set_rules(world, player): elif world.goal[player] == 'triforcehunt': add_rule(world.get_location('Murahdahla', player), lambda state: state.item_count('Triforce Piece', player) + state.item_count('Power Star', player) >= int(state.world.treasure_hunt_count[player])) - if world.mode[player] != 'inverted': - set_big_bomb_rules(world, player) - if world.logic[player] == 'owglitches' and world.shuffle[player] not in ('insanity', 'insanity_legacy'): - path_to_hc = mirrorless_path_to_location(world, 'West Death Mountain (Bottom)', 'Hyrule Castle Area', player) - path_to_courtyard = mirrorless_path_to_castle_courtyard(world, player) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.world.get_entrance('Dark Death Mountain Offset Mirror', player).can_reach(state) and all(rule(state) for rule in path_to_courtyard) and all(rule(state) for rule in path_to_hc), 'or') - else: - set_inverted_big_bomb_rules(world, player) + set_big_bomb_rules(world, player) # if swamp and dam have not been moved we require mirror for swamp palace if not world.swamp_patch_required[player]: @@ -194,6 +187,8 @@ def global_rules(world, player): set_rule(world.get_location('Dark Blacksmith Ruins', player), lambda state: state.has('Return Smith', player)) set_rule(world.get_location('Purple Chest', player), lambda state: state.has('Pick Up Purple Chest', player)) # Can S&Q with chest set_rule(world.get_location('Ether Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_beam_sword(player)) + set_rule(world.get_location('Big Bomb', player), lambda state: state.has('Crystal 5', player) and state.has('Crystal 6', player)) + set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Detonate Big Bomb', player)) set_rule(world.get_location('Master Sword Pedestal', player), lambda state: state.has('Red Pendant', player) and state.has('Blue Pendant', player) and state.has('Green Pendant', player)) set_rule(world.get_location('Missing Smith', player), lambda state: state.has('Get Frog', player) and state.can_reach('Blacksmiths Hut', 'Region', player)) # Can't S&Q with smith @@ -1647,6 +1642,8 @@ 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: + set_rule(world.get_location('Pyramid Crack', player), lambda state: state.has('Pick Up Big Bomb', player)) + bombshop_entrance = world.get_region('Big Bomb Shop', player).entrances[0] Normal_LW_entrances = ['Blinds Hideout', 'Bonk Fairy (Light)', @@ -1877,6 +1874,7 @@ def set_big_bomb_rules(world, player): add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.has('Flippers', player) or state.can_flute(player))) #TODO: Fix red bomb rules, artifically adding a bunch of rules to help reduce unbeatable seeds in OW shuffle + set_rule(world.get_location('Pyramid Crack', player), lambda state: state.has('Pick Up Big Bomb', player)) set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: False) #add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Pyramid Area', 'Region', player)) #add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_lift_heavy_rocks(player) and state.has('Flippers', player) and state.can_flute(player) and state.has('Hammer', player) and state.has('Hookshot', player) and state.has_Pearl(player) and state.has_Mirror(player))) @@ -2088,7 +2086,7 @@ def set_bunny_rules(world, player, inverted): 'Checkerboard Cave', 'Potion Shop', 'Spectacle Rock Cave', 'Pyramid', 'Hype Cave - Generous Guy', 'Peg Cave', 'Bumper Cave Ledge', 'Dark Blacksmith Ruins', 'Spectacle Rock', 'Bombos Tablet', 'Ether Tablet', 'Purple Chest', 'Blacksmith', - 'Missing Smith', 'Master Sword Pedestal', 'Bottle Merchant', 'Sunken Treasure', 'Desert Ledge', + 'Missing Smith', 'Pyramid Crack', 'Big Bomb', 'Master Sword Pedestal', 'Bottle Merchant', 'Sunken Treasure', 'Desert Ledge', 'Kakariko Shop - Left', 'Kakariko Shop - Middle', 'Kakariko Shop - Right', 'Lake Hylia Shop - Left', 'Lake Hylia Shop - Middle', 'Lake Hylia Shop - Right', 'Potion Shop - Left', 'Potion Shop - Middle', 'Potion Shop - Right',