SM: 0.4.2 percent goals fix (#2183)

fixed percent items goals that can fail generation (reported here https://discord.com/channels/731205301247803413/1147318124383850516/1147318124383850516 and here https://discord.com/channels/731205301247803413/1138137515505750108/1138137515505750108)
This commit is contained in:
lordlou
2023-09-19 19:26:42 -04:00
committed by GitHub
parent 6e02a4ca3c
commit 0012584e51
2 changed files with 8 additions and 6 deletions

View File

@@ -150,7 +150,6 @@ class GraphBuilder(object):
# update item% objectives
accessibleItems = [il.Item for il in allItemLocs if ilCheck(il)]
majorUpgrades = [item.Type for item in accessibleItems if item.BeamBits != 0 or item.ItemBits != 0]
sm.objectives.setItemPercentFuncs(len(accessibleItems), majorUpgrades)
if split == "Scavenger":
# update escape access for scav with last scav loc
lastScavItemLoc = progItemLocs[-1]
@@ -163,6 +162,7 @@ class GraphBuilder(object):
if ilCheck(itemLoc) and (split.startswith("Full") or itemLoc.Location.isClass(split)):
availLocsByArea[itemLoc.Location.GraphArea].append(itemLoc.Location.Name)
self.log.debug("escapeTrigger. availLocsByArea="+str(availLocsByArea))
sm.objectives.setItemPercentFuncs(len(accessibleItems), majorUpgrades, container)
sm.objectives.setAreaFuncs({area:lambda sm,ap:SMBool(len(container.getLocs(lambda loc: loc.Name in availLocsByArea[area]))==0) for area in availLocsByArea})
self.log.debug("escapeTrigger. collect locs until G4 access")
# collect all item/locations up until we can pass G4 (the escape triggers)