Add support for starhunt and treasurehunt goals. Add timed difficulties.

This commit is contained in:
LLCoolDave
2017-06-04 14:44:23 +02:00
parent 4ed2a5b510
commit a20eaae13f
4 changed files with 93 additions and 57 deletions

View File

@@ -124,6 +124,7 @@ class World(object):
prog_locations = [location for location in self.get_locations() if location.item is not None and location.item.advancement]
state = CollectionState(self)
treasure_pieces_collected = 0
while prog_locations:
sphere = []
# build up spheres of collection radius. Everything in each sphere is independent from each other in dependencies and only depends on lower spheres
@@ -131,6 +132,10 @@ class World(object):
if state.can_reach(location):
if location.item.name == 'Triforce':
return True
elif location.item.name in ['Triforce Piece', 'Power Star']:
treasure_pieces_collected += 1
if self.goal in ['starhunt', 'triforcehunt'] and treasure_pieces_collected >= self.treasure_hunt_count:
return True
sphere.append(location)
if not sphere: