mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Merge pull request #8 from KevinCathcart/Dev
Update through Bomb Shop in paths
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user