Merge pull request #8 from KevinCathcart/Dev

Update through Bomb Shop in paths
This commit is contained in:
AmazingAmpharos
2018-01-06 18:58:19 -06:00
committed by GitHub
4 changed files with 91 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
import copy
import logging
import json
from itertools import zip_longest
from collections import OrderedDict
@@ -368,6 +367,19 @@ class CollectionState(object):
def bottle_count(self):
return len([pritem for pritem in self.prog_items if pritem.startswith('Bottle')])
def has_hearts(self, count):
# Warning: This oncly considers items that are marked as advancement items
return self.heart_count() >= count
def heart_count(self):
# Warning: This oncly considers items that are marked as advancement items
return (
self.item_count('Boss Heart Container')
+ self.item_count('Sanctuary Heart Container')
+ self.item_count('Piece of Heart') // 4
+ 3 # starting hearts
)
def can_lift_heavy_rocks(self):
return self.has('Titans Mitts')
@@ -756,11 +768,9 @@ class Spoiler(object):
outfile.write('\n\nPaths:\n\n')
path_listings = []
for location, paths in self.paths.items():
for location, path in self.paths.items():
path_lines = []
pathsiter = iter(paths)
pathpairs = zip_longest(pathsiter, pathsiter)
for region, exit in pathpairs:
for region, exit in path:
if exit is not None:
path_lines.append("{} -> {}".format(region, exit))
else: