From a6a9989fcfef251f989a0ef87f73a6d3b103f121 Mon Sep 17 00:00:00 2001 From: lordlou <87331798+lordlou@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:15:19 -0500 Subject: [PATCH] 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 --- worlds/sm/__init__.py | 4 +++- worlds/sm/variaRandomizer/randomizer.py | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/worlds/sm/__init__.py b/worlds/sm/__init__.py index 6abcbfbe..fe8a4870 100644 --- a/worlds/sm/__init__.py +++ b/worlds/sm/__init__.py @@ -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 diff --git a/worlds/sm/variaRandomizer/randomizer.py b/worlds/sm/variaRandomizer/randomizer.py index a95764df..0da2b2d0 100644 --- a/worlds/sm/variaRandomizer/randomizer.py +++ b/worlds/sm/variaRandomizer/randomizer.py @@ -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")