Added Smith/Purple Chest pathing
This commit is contained in:
@@ -1615,19 +1615,19 @@ class Entrance(object):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def can_reach_thru(self, state, start_region, ignore_underworld=False, ignore_ledges=False):
|
def can_reach_thru(self, state, start_region, ignore_underworld=False, ignore_ledges=False, allow_save_quit=False):
|
||||||
def explore_region(region, path = []):
|
def explore_region(region, path = []):
|
||||||
nonlocal found
|
nonlocal found
|
||||||
if region not in explored_regions or len(explored_regions[region]) > len(path):
|
if region not in explored_regions or len(explored_regions[region]) > len(path):
|
||||||
explored_regions[region] = path
|
explored_regions[region] = path
|
||||||
for exit in region.exits:
|
for exit in region.exits:
|
||||||
if exit.connected_region and (not ignore_ledges or exit.spot_type != 'Ledge') \
|
if exit.connected_region and (not ignore_ledges or exit.spot_type != 'Ledge') \
|
||||||
and (not ignore_underworld or exit.connected_region.type not in [RegionType.Cave, RegionType.Dungeon]) \
|
and exit.connected_region.name not in ['Dig Game Area'] \
|
||||||
and exit.access_rule(state):
|
and exit.access_rule(state):
|
||||||
if exit.connected_region == self.parent_region:
|
if exit.connected_region == self.parent_region:
|
||||||
found = True
|
found = True
|
||||||
explored_regions[self.parent_region] = path + [exit]
|
explored_regions[self.parent_region] = path + [exit]
|
||||||
else:
|
elif not ignore_underworld or region.type == exit.connected_region.type or exit.connected_region.type not in [RegionType.Cave, RegionType.Dungeon]:
|
||||||
explore_region(exit.connected_region, path + [exit])
|
explore_region(exit.connected_region, path + [exit])
|
||||||
|
|
||||||
found = False
|
found = False
|
||||||
@@ -1635,6 +1635,12 @@ class Entrance(object):
|
|||||||
explore_region(start_region.entrances[0].parent_region)
|
explore_region(start_region.entrances[0].parent_region)
|
||||||
if found:
|
if found:
|
||||||
self.temp_path = explored_regions[self.parent_region]
|
self.temp_path = explored_regions[self.parent_region]
|
||||||
|
elif allow_save_quit:
|
||||||
|
world = self.parent_region.world if self.parent_region else None
|
||||||
|
exit = world.get_entrance('Links House S&Q', self.player)
|
||||||
|
explore_region(exit.connected_region, [exit])
|
||||||
|
if found:
|
||||||
|
self.temp_path = explored_regions[self.parent_region]
|
||||||
|
|
||||||
#TODO: Implement residual mirror portal placing for the previous leg, to be used for the final destination
|
#TODO: Implement residual mirror portal placing for the previous leg, to be used for the final destination
|
||||||
|
|
||||||
|
|||||||
2
Rules.py
2
Rules.py
@@ -191,7 +191,7 @@ def global_rules(world, player):
|
|||||||
set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Detonate 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))
|
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
|
set_rule(world.get_location('Missing Smith', player), lambda state: state.has('Get Frog', player))
|
||||||
set_rule(world.get_location('Blacksmith', player), lambda state: state.has('Return Smith', player))
|
set_rule(world.get_location('Blacksmith', player), lambda state: state.has('Return Smith', player))
|
||||||
set_rule(world.get_location('Magic Bat', player), lambda state: state.has('Magic Powder', player))
|
set_rule(world.get_location('Magic Bat', player), lambda state: state.has('Magic Powder', player))
|
||||||
set_rule(world.get_location('Sick Kid', player), lambda state: state.has_bottle(player))
|
set_rule(world.get_location('Sick Kid', player), lambda state: state.has_bottle(player))
|
||||||
|
|||||||
Reference in New Issue
Block a user