SM small improvements (#190)

* added a fallback default starting location instead of failing generation if an invalid one was chosen

* added Nothing and NoEnergy as hint blacklist

added missing NoEnergy as local items and removed it from progression
This commit is contained in:
lordlou 2022-01-05 14:15:19 -05:00 committed by GitHub
parent 0c3b5439e9
commit a6a9989fcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -44,6 +44,7 @@ class SMWorld(World):
itemManager: ItemManager
locations = {}
hint_blacklist = {'Nothing', 'NoEnergy'}
Logic.factory('vanilla')
@ -85,6 +86,7 @@ class SMWorld(World):
# keeps Nothing items local so no player will ever pickup Nothing
# doing so reduces contribution of this world to the Multiworld the more Nothing there is though
self.world.local_items[self.player].value.add('Nothing')
self.world.local_items[self.player].value.add('NoEnergy')
if (self.variaRando.args.morphPlacement == "early"):
self.world.local_items[self.player].value.add('Morph')
@ -126,7 +128,7 @@ class SMWorld(World):
weaponCount[2] += 1
else:
isAdvancement = False
elif item.Type == 'Nothing':
elif item.Category == 'Nothing':
isAdvancement = False
itemClass = ItemManager.Items[item.Type].Class

View File

@ -16,6 +16,7 @@ from utils.doorsmanager import DoorsManager
from logic.logic import Logic
import utils.log
from worlds.sm.Options import StartLocation
# we need to know the logic before doing anything else
def getLogic():
@ -498,10 +499,12 @@ class VariaRandomizer:
sys.exit(-1)
args.startLocation = random.choice(possibleStartAPs)
elif args.startLocation not in possibleStartAPs:
optErrMsgs.append('Invalid start location: {}. {}'.format(args.startLocation, reasons[args.startLocation]))
optErrMsgs.append('Possible start locations with these settings: {}'.format(possibleStartAPs))
dumpErrorMsgs(args.output, optErrMsgs)
sys.exit(-1)
args.startLocation = 'Landing Site'
world.start_location[player] = StartLocation(StartLocation.default)
#optErrMsgs.append('Invalid start location: {}. {}'.format(args.startLocation, reasons[args.startLocation]))
#optErrMsgs.append('Possible start locations with these settings: {}'.format(possibleStartAPs))
#dumpErrorMsgs(args.output, optErrMsgs)
#sys.exit(-1)
ap = getAccessPoint(args.startLocation)
if 'forcedEarlyMorph' in ap.Start and ap.Start['forcedEarlyMorph'] == True:
forceArg('morphPlacement', 'early', "'Morph Placement' forced to early for custom start location")