Added Smith/Purple Chest pathing
This commit is contained in:
@@ -1584,18 +1584,28 @@ class Entrance(object):
|
||||
self.temp_path = []
|
||||
|
||||
def can_reach(self, state):
|
||||
if self.name == 'Pyramid Crack':
|
||||
world = self.parent_region.world if self.parent_region else None
|
||||
big_bomb_location = world.get_location('Big Bomb', self.player)
|
||||
if big_bomb_location.can_reach(state) and self.can_reach_thru(state, big_bomb_location.parent_region, True, True) and self.access_rule(state):
|
||||
if not self in state.path:
|
||||
path = state.path.get(big_bomb_location.parent_region, (big_bomb_location.parent_region.name, None))
|
||||
path = ('Big Bomb Shop Exit', ('Pick Up Big Bomb', path))
|
||||
while len(self.temp_path):
|
||||
exit = self.temp_path.pop(0)
|
||||
path = (exit.name, (exit.parent_region.name, path))
|
||||
path = ('Detonate Big Bomb', (self.parent_region.name, path))
|
||||
state.path[self] = (self.name, path)
|
||||
# Destination Pickup OW Only No Ledges Can S&Q
|
||||
multi_step_locations = { 'Pyramid Crack': ('Big Bomb', True, True, False),
|
||||
'Missing Smith': ('Frog', True, False, True),
|
||||
'Middle Aged Man': ('Dark Blacksmith Ruins', True, False, True) }
|
||||
|
||||
if self.name in multi_step_locations:
|
||||
if self not in state.path:
|
||||
world = self.parent_region.world if self.parent_region else None
|
||||
step_location = world.get_location(multi_step_locations[self.name][0], self.player)
|
||||
if step_location.can_reach(state) and self.can_reach_thru(state, step_location.parent_region, multi_step_locations[self.name][1], multi_step_locations[self.name][2], multi_step_locations[self.name][3]) and self.access_rule(state):
|
||||
if not self in state.path:
|
||||
path = state.path.get(step_location.parent_region, (step_location.parent_region.name, None))
|
||||
item_name = step_location.item.name if step_location.item else 'Pick Up Item'
|
||||
path = (f'{step_location.parent_region.name} Exit', (item_name, path))
|
||||
while len(self.temp_path):
|
||||
exit = self.temp_path.pop(0)
|
||||
path = (exit.name, (exit.parent_region.name, path))
|
||||
item_name = self.connected_region.locations[0].item.name if self.connected_region.locations[0].item else 'Deliver Item'
|
||||
path = (item_name, (self.parent_region.name, path))
|
||||
state.path[self] = (self.name, path)
|
||||
return True
|
||||
else:
|
||||
return True
|
||||
else:
|
||||
if self.parent_region.can_reach(state) and self.access_rule(state):
|
||||
|
||||
@@ -2184,6 +2184,7 @@ mandatory_connections = [('Links House S&Q', 'Links House'),
|
||||
('Fairy Ascension Cave Climb', 'Fairy Ascension Cave (Top)'),
|
||||
('Fairy Ascension Cave Pots', 'Fairy Ascension Cave (Bottom)'),
|
||||
('Fairy Ascension Cave Drop', 'Fairy Ascension Cave (Drop)'),
|
||||
('Missing Smith', 'Missing Smith'),
|
||||
('Superbunny Cave Climb', 'Superbunny Cave (Top)'),
|
||||
('Hookshot Cave Front to Middle', 'Hookshot Cave (Middle)'),
|
||||
('Hookshot Cave Middle to Front', 'Hookshot Cave (Front)'),
|
||||
|
||||
@@ -214,6 +214,9 @@ def generate_itempool(world, player):
|
||||
world.push_item(world.get_location('Dark Blacksmith Ruins', player), ItemFactory('Pick Up Purple Chest', player), False)
|
||||
world.get_location('Dark Blacksmith Ruins', player).event = True
|
||||
world.get_location('Dark Blacksmith Ruins', player).locked = True
|
||||
world.push_item(world.get_location('Middle Aged Man', player), ItemFactory('Deliver Purple Chest', player), False)
|
||||
world.get_location('Middle Aged Man', player).event = True
|
||||
world.get_location('Middle Aged Man', player).locked = True
|
||||
world.push_item(world.get_location('Frog', player), ItemFactory('Get Frog', player), False)
|
||||
world.get_location('Frog', player).event = True
|
||||
world.get_location('Frog', player).locked = True
|
||||
|
||||
1
Items.py
1
Items.py
@@ -176,6 +176,7 @@ item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narche
|
||||
'Get Frog': (True, False, 'Event', 999, None, None, None, None, None, None, None, None),
|
||||
'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),
|
||||
'Deliver 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),
|
||||
|
||||
@@ -820,6 +820,7 @@ OWTileRegions = bidict({
|
||||
'Ice Cave Area': 0x37,
|
||||
|
||||
'Desert Pass Area': 0x3a,
|
||||
'Middle Aged Man': 0x3a,
|
||||
'Desert Pass Southeast': 0x3a,
|
||||
'Desert Pass Ledge': 0x3a,
|
||||
|
||||
@@ -1575,6 +1576,7 @@ OWExitTypes = {
|
||||
'Desert Pass Rocks (North)',
|
||||
'Desert Pass Rocks (South)',
|
||||
'Desert Pass Ladder (North)',
|
||||
'Middle Aged Man',
|
||||
'Octoballoon Pier',
|
||||
'Skull Woods Bush Rock (East)',
|
||||
'Skull Woods Bush Rock (West)',
|
||||
|
||||
@@ -902,6 +902,7 @@ mandatory_connections = [# Intra-tile OW Connections
|
||||
('Desert Pass Ledge Drop', 'Desert Pass Area'),
|
||||
('Desert Pass Rocks (North)', 'Desert Pass Southeast'), #glove
|
||||
('Desert Pass Rocks (South)', 'Desert Pass Area'), #glove
|
||||
('Middle Aged Man', 'Middle Aged Man'),
|
||||
('Octoballoon Water Drop', 'Octoballoon Water'), #flippers
|
||||
('Octoballoon Waterfall Water Drop', 'Octoballoon Water'), #flippers
|
||||
('Octoballoon Pier', 'Octoballoon Area'),
|
||||
|
||||
@@ -111,7 +111,8 @@ def create_regions(world, player):
|
||||
create_lw_region(player, 'Lake Hylia Island', ['Lake Hylia Island'], ['Lake Hylia Island Water Drop']),
|
||||
create_lw_region(player, 'Lake Hylia Water', None, ['Lake Hylia Central Island Pier', 'Lake Hylia Island Pier', 'Lake Hylia West Pier', 'Lake Hylia East Pier', 'Lake Hylia NC', 'Lake Hylia EC', 'Lake Hylia Whirlpool'], Terrain.Water),
|
||||
create_lw_region(player, 'Ice Cave Area', None, ['Ice Rod Cave', 'Good Bee Cave', '20 Rupee Cave', 'Shopping Mall Mirror Spot', 'Ice Cave SE', 'Ice Cave SW']),
|
||||
create_lw_region(player, 'Desert Pass Area', ['Purple Chest'], ['Desert Pass Ladder (South)', 'Desert Fairy', '50 Rupee Cave', 'Swamp Nook Mirror Spot', 'Desert Pass WS', 'Desert Pass EC', 'Desert Pass Rocks (North)']),
|
||||
create_lw_region(player, 'Desert Pass Area', None, ['Desert Pass Ladder (South)', 'Middle Aged Man', 'Desert Fairy', '50 Rupee Cave', 'Swamp Nook Mirror Spot', 'Desert Pass WS', 'Desert Pass EC', 'Desert Pass Rocks (North)']),
|
||||
create_lw_region(player, 'Middle Aged Man', ['Purple Chest'], None),
|
||||
create_lw_region(player, 'Desert Pass Southeast', None, ['Desert Pass Rocks (South)', 'Swamp Nook Southeast Mirror Spot', 'Desert Pass ES']),
|
||||
create_lw_region(player, 'Desert Pass Ledge', None, ['Desert Pass Ladder (North)', 'Desert Pass Ledge Drop', 'Swamp Nook Pegs Mirror Spot', 'Desert Pass WC']),
|
||||
create_lw_region(player, 'Dam Area', ['Sunken Treasure'], ['Dam', 'Swamp Mirror Spot', 'Dam WC', 'Dam WS', 'Dam NC', 'Dam EC']),
|
||||
@@ -269,7 +270,8 @@ def create_regions(world, player):
|
||||
create_cave_region(player, 'Tavern (Front)', 'the tavern'),
|
||||
create_cave_region(player, 'Hyrule Castle Secret Entrance', 'a drop\'s exit', ['Link\'s Uncle', 'Secret Passage'], ['Hyrule Castle Secret Entrance Exit']),
|
||||
create_cave_region(player, 'Sahasrahlas Hut', 'Sahasrahla', ['Sahasrahla\'s Hut - Left', 'Sahasrahla\'s Hut - Middle', 'Sahasrahla\'s Hut - Right', 'Sahasrahla']),
|
||||
create_cave_region(player, 'Blacksmiths Hut', 'the smith', ['Blacksmith', 'Missing Smith']),
|
||||
create_cave_region(player, 'Blacksmiths Hut', 'the smith', ['Blacksmith'], ['Missing Smith']),
|
||||
create_cave_region(player, 'Missing Smith', None, ['Missing Smith']),
|
||||
create_cave_region(player, 'Bat Cave (right)', 'a drop\'s exit', ['Magic Bat'], ['Bat Cave Door']),
|
||||
create_cave_region(player, 'Bat Cave (left)', 'a drop\'s exit', None, ['Bat Cave Exit']),
|
||||
create_cave_region(player, 'Two Brothers House', 'a connector', None, ['Two Brothers House Exit (East)', 'Two Brothers House Exit (West)']),
|
||||
@@ -1491,6 +1493,7 @@ location_table = {'Mushroom': (0x180013, 0x186338, False, 'in the woods'),
|
||||
'Dark Blacksmith Ruins': (None, None, False, None),
|
||||
'Big Bomb': (None, None, False, None),
|
||||
'Pyramid Crack': (None, None, False, None),
|
||||
'Middle Aged Man': (None, None, False, None),
|
||||
'Trench 1 Switch': (None, None, False, None),
|
||||
'Trench 2 Switch': (None, None, False, None),
|
||||
'Swamp Drain': (None, None, False, None),
|
||||
|
||||
7
Rules.py
7
Rules.py
@@ -58,9 +58,6 @@ 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]))
|
||||
|
||||
# big bomb rules
|
||||
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))
|
||||
|
||||
# if swamp and dam have not been moved we require mirror for swamp palace
|
||||
if not world.swamp_patch_required[player]:
|
||||
@@ -187,8 +184,10 @@ def global_rules(world, player):
|
||||
|
||||
set_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', 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_entrance('Middle Aged Man', player), lambda state: state.has('Pick Up Purple Chest', player)) # Can S&Q with chest
|
||||
set_rule(world.get_location('Purple Chest', player), lambda state: state.has('Deliver Purple Chest', player)) # Can S&Q with chest
|
||||
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 Crack', player), lambda state: state.has('Pick Up Big Bomb', 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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user