mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
SM: failing generation fixes (#1726)
- fixed wrong condition in Collect to assign lastAP - fixed possible infinite loop in generating output when many SM worlds are present - fixed new VARIA code that changed a list used for every SM worlds and would throw if many SM worlds uses Aea rando and not AreaLayout
This commit is contained in:
@@ -362,7 +362,8 @@ class AccessGraph(object):
|
||||
|
||||
# test access from an access point to another, given an optional item
|
||||
def canAccess(self, smbm, srcAccessPointName, destAccessPointName, maxDiff, item=None):
|
||||
if item is not None:
|
||||
addAndRemoveItem = item is not None and (smbm.isCountItem(item) or not smbm.haveItem(item))
|
||||
if addAndRemoveItem:
|
||||
smbm.addItem(item)
|
||||
#print("canAccess: item: {}, src: {}, dest: {}".format(item, srcAccessPointName, destAccessPointName))
|
||||
destAccessPoint = self.accessPoints[destAccessPointName]
|
||||
@@ -371,7 +372,7 @@ class AccessGraph(object):
|
||||
can = destAccessPoint in availAccessPoints
|
||||
# if not can:
|
||||
# self.log.debug("canAccess KO: avail = {}".format([ap.Name for ap in availAccessPoints.keys()]))
|
||||
if item is not None:
|
||||
if addAndRemoveItem:
|
||||
smbm.removeItem(item)
|
||||
#print("canAccess: {}".format(can))
|
||||
return can
|
||||
|
||||
@@ -59,9 +59,12 @@ class Location:
|
||||
|
||||
def evalPostAvailable(self, smbm):
|
||||
if self.difficulty.bool == True and self.PostAvailable is not None:
|
||||
smbm.addItem(self.itemName)
|
||||
addAndRemoveItem = smbm.isCountItem(self.itemName) or not smbm.haveItem(self.itemName)
|
||||
if addAndRemoveItem:
|
||||
smbm.addItem(self.itemName)
|
||||
postAvailable = self.PostAvailable(smbm)
|
||||
smbm.removeItem(self.itemName)
|
||||
if addAndRemoveItem:
|
||||
smbm.removeItem(self.itemName)
|
||||
|
||||
self.difficulty = self.difficulty & postAvailable
|
||||
if self.locDifficulty is not None:
|
||||
|
||||
@@ -91,9 +91,12 @@ class SMBoolManager(object):
|
||||
return itemsDict
|
||||
|
||||
def withItem(self, item, func):
|
||||
self.addItem(item)
|
||||
addAndRemoveItem = self.isCountItem(item) or not self.haveItem(item)
|
||||
if addAndRemoveItem:
|
||||
self.addItem(item)
|
||||
ret = func(self)
|
||||
self.removeItem(item)
|
||||
if addAndRemoveItem:
|
||||
self.removeItem(item)
|
||||
return ret
|
||||
|
||||
def resetItems(self):
|
||||
|
||||
@@ -279,11 +279,12 @@ class RomPatcher:
|
||||
|
||||
# apply area patches
|
||||
if self.settings["area"] == True:
|
||||
areaPatches = list(RomPatcher.IPSPatches['Area'])
|
||||
if not self.settings["areaLayout"]:
|
||||
for p in ['area_rando_layout.ips', 'Sponge_Bath_Blinking_Door', 'east_ocean.ips', 'aqueduct_bomb_blocks.ips']:
|
||||
RomPatcher.IPSPatches['Area'].remove(p)
|
||||
RomPatcher.IPSPatches['Area'].append('area_rando_layout_base.ips')
|
||||
for patchName in RomPatcher.IPSPatches['Area']:
|
||||
areaPatches.remove(p)
|
||||
areaPatches.append('area_rando_layout_base.ips')
|
||||
for patchName in areaPatches:
|
||||
self.applyIPSPatch(patchName)
|
||||
else:
|
||||
self.applyIPSPatch('area_ids_alt.ips')
|
||||
|
||||
@@ -740,7 +740,7 @@ class Objectives(object):
|
||||
if c not in char2tile:
|
||||
continue
|
||||
romFile.writeWord(0x3800 + char2tile[c])
|
||||
|
||||
Synonyms.alreadyUsed = []
|
||||
# write goal completed positions y in sprites OAM
|
||||
baseY = 0x40
|
||||
addr = Addresses.getOne('objectivesSpritesOAM')
|
||||
|
||||
Reference in New Issue
Block a user