@@ -511,16 +511,18 @@ def updateItemPercentEscapeAccess(self, collectedLocsAccessPoints):
511
511
def setScavengerHuntFunc (self , scavClearFunc ):
512
512
self .goals ["finish scavenger hunt" ].clearFunc = scavClearFunc
513
513
514
- def setItemPercentFuncs (self , totalItemsCount = None , allUpgradeTypes = None ):
515
- def getPctFunc (pct , totalItemsCount ):
514
+ def setItemPercentFuncs (self , totalItemsCount = None , allUpgradeTypes = None , container = None ):
515
+ def getPctFunc (total_needed , container ):
516
516
def f (sm , ap ):
517
- nonlocal pct , totalItemsCount
518
- return sm .hasItemsPercent (pct , totalItemsCount )
517
+ nonlocal total_needed , container
518
+ locs_checked = len (container .getUsedLocs (lambda loc : True ))
519
+ return SMBool (locs_checked >= total_needed )
519
520
return f
520
521
522
+ # AP: now based on location checks instead of local item
521
523
for pct in [25 ,50 ,75 ,100 ]:
522
524
goal = 'collect %d%% items' % pct
523
- self .goals [goal ].clearFunc = getPctFunc (pct , totalItemsCount )
525
+ self .goals [goal ].clearFunc = getPctFunc (totalItemsCount * pct / 100 , container )
524
526
if allUpgradeTypes is not None :
525
527
self .goals ["collect all upgrades" ].clearFunc = lambda sm , ap : sm .haveItems (allUpgradeTypes )
526
528
0 commit comments