Пример #1
0
 def __init__(self, startAP, areaGraph, restrictions):
     self.startAP = startAP
     self.areaGraph = areaGraph
     self.restrictions = restrictions
     self.settings = restrictions.settings
     self.smbm = SMBoolManager()
     self.log = utils.log.get('MiniSolver')
Пример #2
0
 def checkLimitObjectives(beatableBosses):
     # check that there's enough bosses/minibosses for limit objectives
     from logic.smboolmanager import SMBoolManager
     smbm = SMBoolManager()
     smbm.addItems(beatableBosses)
     for goal in Objectives.activeGoals:
         if not goal.isLimit():
             continue
         if not goal.canClearGoal(smbm):
             return False
     return True
    def __init__(self,
                 majorsSplit,
                 startLocation,
                 areaGraph,
                 locations,
                 vcr=None):
        self.interactive = False
        self.checkDuplicateMajor = False
        self.vcr = vcr
        # for compatibility with some common methods of the interactive solver
        self.mode = 'standard'

        self.log = utils.log.get('Solver')

        # default conf
        self.setConf(easy, 'all', [], False)

        self.firstLogFile = None

        self.extStatsFilename = None
        self.extStatsStep = None

        self.type = 'rando'
        self.output = Out.factory(self.type, self)
        self.outputFileName = None

        self.locations = locations

        self.smbm = SMBoolManager()

        # preset already loaded by rando
        self.presetFileName = None

        self.pickup = Pickup(Conf.itemsPickup)

        self.comeBack = ComeBack(self)

        # load ROM info, patches are already loaded by the rando. get the graph from the rando too
        self.majorsSplit = majorsSplit
        self.startLocation = startLocation
        self.startArea = getAccessPoint(startLocation).Start['solveArea']
        self.areaGraph = areaGraph

        self.objectives = Objectives()

        # store at each step how many locations are available
        self.nbAvailLocs = []

        # limit to a few seconds to avoid cases with a lot of rewinds which could last for minutes
        self.runtimeLimit_s = 5
        self.startTime = time.process_time()
    def initialize(self, mode, rom, presetFileName, magic, debug, fill,
                   startAP, trackerRace):
        # load rom and preset, return first state
        self.debug = debug
        self.mode = mode
        if self.mode != "seedless":
            self.seed = os.path.basename(os.path.splitext(rom)[0]) + '.sfc'
        else:
            self.seed = "seedless"

        self.smbm = SMBoolManager()

        self.presetFileName = presetFileName
        self.loadPreset(self.presetFileName)

        self.loadRom(rom, interactive=True, magic=magic, startAP=startAP)
        # in plando/tracker always consider that we're doing full
        self.majorsSplit = 'Full'

        # hide doors
        if self.doorsRando and mode == 'standard':
            DoorsManager.initTracker()

        self.clearItems()

        # in debug mode don't load plando locs/transitions
        if self.mode == 'plando' and self.debug == False:
            if fill == True:
                # load the source seed transitions and items/locations
                self.curGraphTransitions = self.bossTransitions + self.areaTransitions + self.escapeTransition
                self.areaGraph = AccessGraph(accessPoints,
                                             self.curGraphTransitions)
                self.fillPlandoLocs()
            else:
                if self.areaRando == True or self.bossRando == True:
                    plandoTrans = self.loadPlandoTransitions()
                    if len(plandoTrans) > 0:
                        self.curGraphTransitions = plandoTrans
                    self.areaGraph = AccessGraph(accessPoints,
                                                 self.curGraphTransitions)

                self.loadPlandoLocs()

        # compute new available locations
        self.computeLocationsDifficulty(self.majorLocations)

        if trackerRace == True:
            self.mode = 'seedless'

        self.dumpState()
 def __copy__(self):
     locs = copy.copy(self.unusedLocations)
     # we don't copy restriction state on purpose: it depends on
     # outside context we don't want to bring to the copy
     ret = ItemLocContainer(SMBoolManager(),
                            self.itemPoolBackup[:] if self.itemPoolBackup != None else self.itemPool[:],
                            locs)
     ret.currentItems = self.currentItems[:]
     ret.unrestrictedItems = copy.copy(self.unrestrictedItems)
     ret.itemLocations = [ ItemLocation(
         il.Item,
         copy.copy(il.Location)
     ) for il in self.itemLocations ]
     ret.sm.addItems([item.Type for item in ret.currentItems])
     return ret
    def tryRemainingLocs(self):
        # use preset which knows every techniques to test the remaining locs to
        # find which technique could allow to continue the seed
        locations = self.majorLocations if self.majorsSplit == 'Full' else self.majorLocations + self.minorLocations

        # instanciate a new smbool manager to reset the cache
        self.smbm = SMBoolManager()
        presetFileName = os.path.expanduser('~/RandomMetroidSolver/standard_presets/solution.json')
        presetLoader = PresetLoader.factory(presetFileName)
        presetLoader.load()
        self.smbm.createKnowsFunctions()

        self.areaGraph.getAvailableLocations(locations, self.smbm, infinity, self.lastAP)

        return [loc for loc in locations if loc.difficulty.bool == True]
Пример #7
0
 def __init__(self, graphSettings, locations, services):
     self.sm = SMBoolManager()
     self.settings = services.settings
     self.graphSettings = graphSettings
     self.startAP = graphSettings.startAP
     self.superFun = self.settings.getSuperFun()
     self.container = None
     self.services = services
     self.restrictions = services.restrictions
     self.areaGraph = services.areaGraph
     self.allLocations = locations
     self.locations = self.areaGraph.getAccessibleLocations(
         locations, self.startAP)
     #        print("nLocs Setup: "+str(len(self.locations)))
     self.itemManager = self.settings.getItemManager(
         self.sm, len(self.locations))
     self.forbiddenItems = []
     self.restrictedLocs = []
     self.lastRestricted = []
     self.bossesLocs = sorted(
         ['Draygon', 'Kraid', 'Ridley', 'Phantoon', 'Mother Brain'])
     self.suits = ['Varia', 'Gravity']
     # organized by priority
     self.movementItems = [
         'SpaceJump', 'HiJump', 'SpeedBooster', 'Bomb', 'Grapple',
         'SpringBall'
     ]
     # organized by priority
     self.combatItems = ['ScrewAttack', 'Plasma', 'Wave', 'Spazer']
     # OMG
     self.bossChecks = {
         'Kraid': self.sm.enoughStuffsKraid,
         'Phantoon': self.sm.enoughStuffsPhantoon,
         'Draygon': self.sm.enoughStuffsDraygon,
         'Ridley': self.sm.enoughStuffsRidley,
         'Mother Brain': self.sm.enoughStuffsMotherbrain
     }
     self.okay = lambda: SMBool(True, 0)
     exclude = self.settings.getExcludeItems(self.locations)
     # we have to use item manager only once, otherwise pool will change
     self.itemManager.createItemPool(exclude)
     self.basePool = self.itemManager.getItemPool()[:]
     self.log = utils.log.get('RandoSetup')
     if len(locations) != len(self.locations):
         self.log.debug("inaccessible locations :" + getLocListStr(
             [loc for loc in locations if loc not in self.locations]))
Пример #8
0
    def computeHellruns(self, hellRuns):
        sm = SMBoolManager()
        for hellRun in ['Ice', 'MainUpperNorfair']:
            hellRuns[hellRun] = {}

            for (actualHellRun,
                 params) in Settings.hellRunsTable[hellRun].items():
                hellRuns[hellRun][actualHellRun] = {}
                for (key,
                     difficulties) in Settings.hellRunPresets[hellRun].items():
                    if key == 'Solution':
                        continue
                    Settings.hellRuns[hellRun] = difficulties
                    hellRuns[hellRun][actualHellRun][key] = {
                        easy: -1,
                        medium: -1,
                        hard: -1,
                        harder: -1,
                        hardcore: -1,
                        mania: -1
                    }
                    if difficulties == None:
                        continue

                    sm.resetItems()
                    for etank in range(19):
                        ret = sm.canHellRun(**params)

                        if ret.bool == True:
                            nEtank = 0
                            for item in ret.items:
                                if item.find('ETank') != -1:
                                    nEtank = int(item[0:item.find('-ETank')])
                                    break
                            hellRuns[hellRun][actualHellRun][key][
                                ret.difficulty] = nEtank

                        sm.addItem('ETank')

        hellRun = 'LowerNorfair'
        hellRuns[hellRun] = {}
        hellRuns[hellRun]["NoScrew"] = self.computeLNHellRun(sm, False)
        hellRuns[hellRun]["Screw"] = self.computeLNHellRun(sm, True)
    def __init__(self, rom, presetFileName, difficultyTarget, pickupStrategy, itemsForbidden=[], type='console',
                 firstItemsLog=None, extStatsFilename=None, extStatsStep=None, displayGeneratedPath=False,
                 outputFileName=None, magic=None, checkDuplicateMajor=False, vcr=False, plot=None):
        self.interactive = False
        self.checkDuplicateMajor = checkDuplicateMajor
        if vcr == True:
            from utils.vcr import VCR
            self.vcr = VCR(rom, 'solver')
        else:
            self.vcr = None
        # for compatibility with some common methods of the interactive solver
        self.mode = 'standard'

        self.log = utils.log.get('Solver')

        self.setConf(difficultyTarget, pickupStrategy, itemsForbidden, displayGeneratedPath)

        self.firstLogFile = None
        if firstItemsLog is not None:
            self.firstLogFile = open(firstItemsLog, 'w')
            self.firstLogFile.write('Item;Location;Area\n')

        self.extStatsFilename = extStatsFilename
        self.extStatsStep = extStatsStep
        self.plot = plot

        # can be called from command line (console) or from web site (web)
        self.type = type
        self.output = Out.factory(self.type, self)
        self.outputFileName = outputFileName

        self.locations = graphLocations

        self.smbm = SMBoolManager()

        self.presetFileName = presetFileName
        self.loadPreset(self.presetFileName)

        self.loadRom(rom, magic=magic)

        self.pickup = Pickup(Conf.itemsPickup)

        self.comeBack = ComeBack(self)
Пример #10
0
    def __init__(self, majorsSplit, startAP, areaGraph, locations):
        self.interactive = False
        self.checkDuplicateMajor = False
        self.vcr = None
        # for compatibility with some common methods of the interactive solver
        self.mode = 'standard'

        self.log = utils.log.get('Solver')

        # default conf
        self.setConf(easy, 'all', [], False)

        self.firstLogFile = None

        self.extStatsFilename = None
        self.extStatsStep = None
        self.plot = None

        self.type = 'rando'
        self.output = Out.factory(self.type, self)
        self.outputFileName = None

        self.locations = locations

        self.smbm = SMBoolManager()

        # preset already loaded by rando
        self.presetFileName = None

        self.pickup = Pickup(Conf.itemsPickup)

        self.comeBack = ComeBack(self)

        # load ROM info, patches are already loaded by the rando. get the graph from the rando too
        self.majorsSplit = majorsSplit
        self.startAP = startAP
        self.startArea = getAccessPoint(startAP).Start['solveArea']
        self.areaGraph = areaGraph

        # store at each step how many locations are available
        self.nbAvailLocs = []
Пример #11
0
    def computeHardRooms(self, hardRooms):
        # add gravity patch (as we add it by default in the randomizer)
        RomPatches.ActivePatches.append(RomPatches.NoGravityEnvProtection)

        sm = SMBoolManager()

        # xray
        xray = {}
        xray['Suitless'] = self.computeXray(sm, False)
        xray['Varia'] = self.computeXray(sm, True)
        hardRooms['X-Ray'] = xray

        # gauntlet
        gauntlet = {}
        gauntlet['SuitlessBomb'] = self.computeGauntlet(sm, 'Bomb', False)
        gauntlet['SuitlessPowerBomb'] = self.computeGauntlet(
            sm, 'PowerBomb', False)
        gauntlet['VariaBomb'] = self.computeGauntlet(sm, 'Bomb', True)
        gauntlet['VariaPowerBomb'] = self.computeGauntlet(
            sm, 'PowerBomb', True)
        hardRooms['Gauntlet'] = gauntlet

        return hardRooms
Пример #12
0
    def iterate(self, stateJson, scope, action, params):
        self.debug = params["debug"]
        self.smbm = SMBoolManager()

        state = SolverState()
        state.fromJson(stateJson)
        state.toSolver(self)

        self.loadPreset(self.presetFileName)

        # add already collected items to smbm
        self.smbm.addItems(self.collectedItems)

        if scope == 'item':
            if action == 'clear':
                self.clearItems(True)
            else:
                if action == 'add':
                    if self.mode in ['plando', 'seedless', 'race', 'debug']:
                        if params['loc'] != None:
                            if self.mode == 'plando':
                                self.setItemAt(params['loc'], params['item'],
                                               params['hide'])
                            else:
                                itemName = params.get('item', 'Nothing')
                                if itemName is None:
                                    itemName = 'Nothing'
                                self.setItemAt(params['loc'], itemName, False)
                        else:
                            self.increaseItem(params['item'])
                    else:
                        # pickup item at locName
                        self.pickItemAt(params['loc'])
                elif action == 'remove':
                    if 'loc' in params:
                        self.removeItemAt(params['loc'])
                    elif 'count' in params:
                        # remove last collected item
                        self.cancelLastItems(params['count'])
                    else:
                        self.decreaseItem(params['item'])
                elif action == 'replace':
                    self.replaceItemAt(params['loc'], params['item'],
                                       params['hide'])
                elif action == 'toggle':
                    self.toggleItem(params['item'])
        elif scope == 'area':
            if action == 'clear':
                self.clearTransitions()
            else:
                if action == 'add':
                    startPoint = params['startPoint']
                    endPoint = params['endPoint']
                    self.addTransition(self.transWeb2Internal[startPoint],
                                       self.transWeb2Internal[endPoint])
                elif action == 'remove':
                    if 'startPoint' in params:
                        self.cancelTransition(
                            self.transWeb2Internal[params['startPoint']])
                    else:
                        # remove last transition
                        self.cancelLastTransition()
        elif scope == 'door':
            if action == 'replace':
                doorName = params['doorName']
                newColor = params['newColor']
                DoorsManager.setColor(doorName, newColor)
            elif action == 'toggle':
                doorName = params['doorName']
                DoorsManager.switchVisibility(doorName)

        self.areaGraph = AccessGraph(Logic.accessPoints,
                                     self.curGraphTransitions)

        if scope == 'common':
            if action == 'save':
                return self.savePlando(params['lock'], params['escapeTimer'])
            elif action == 'randomize':
                self.randoPlando(params)

        # if last loc added was a sequence break, recompute its difficulty,
        # as it may be available with the newly placed item.
        if len(self.visitedLocations) > 0:
            lastVisited = self.visitedLocations[-1]
            if lastVisited.difficulty.difficulty == -1:
                self.visitedLocations.remove(lastVisited)
                self.majorLocations.append(lastVisited)
            else:
                lastVisited = None
        else:
            lastVisited = None

        # compute new available locations
        self.clearLocs(self.majorLocations)
        self.computeLocationsDifficulty(self.majorLocations)

        # put back last visited location
        if lastVisited != None:
            self.majorLocations.remove(lastVisited)
            self.visitedLocations.append(lastVisited)
            if lastVisited.difficulty == False:
                # if the loc is still sequence break, put it back as sequence break
                lastVisited.difficulty = SMBool(True, -1)

        # return them
        self.dumpState()
Пример #13
0
    def loadRom(self, rom, interactive=False, magic=None, startLocation=None):
        self.scavengerOrder = []
        self.plandoScavengerOrder = []
        # startLocation param is only use for seedless
        if rom == None:
            # TODO::add a --logic parameter for seedless
            Logic.factory('vanilla')
            self.romFileName = 'seedless'
            self.majorsSplit = 'Full'
            self.masterMajorsSplit = 'Full'
            self.areaRando = True
            self.bossRando = True
            self.escapeRando = False
            self.escapeTimer = "03:00"
            self.startLocation = startLocation
            RomPatches.setDefaultPatches(startLocation)
            self.startArea = getAccessPoint(startLocation).Start['solveArea']
            # in seedless load all the vanilla transitions
            self.areaTransitions = vanillaTransitions[:]
            self.bossTransitions = vanillaBossesTransitions[:]
            self.escapeTransition = [vanillaEscapeTransitions[0]]
            # in seedless we allow mixing of area and boss transitions
            self.hasMixedTransitions = True
            self.curGraphTransitions = self.bossTransitions + self.areaTransitions + self.escapeTransition
            self.locations = Logic.locations
            for loc in self.locations:
                loc.itemName = 'Nothing'
            # set doors related to default patches
            DoorsManager.setDoorsColor()
            self.doorsRando = False
            self.hasNothing = False
            self.objectives.setVanilla()
            self.tourian = 'Vanilla'
        else:
            self.romFileName = rom
            self.romLoader = RomLoader.factory(rom, magic)
            Logic.factory(self.romLoader.readLogic())
            self.locations = Logic.locations
            (self.majorsSplit,
             self.masterMajorsSplit) = self.romLoader.assignItems(
                 self.locations)
            (self.startLocation, self.startArea,
             startPatches) = self.romLoader.getStartAP()
            if not GraphUtils.isStandardStart(
                    self.startLocation) and self.majorsSplit != 'Full':
                # update major/chozo locs in non standard start
                self.romLoader.updateSplitLocs(self.majorsSplit,
                                               self.locations)
            (self.areaRando, self.bossRando, self.escapeRando, hasObjectives,
             self.tourian) = self.romLoader.loadPatches()
            RomPatches.ActivePatches += startPatches
            self.escapeTimer = self.romLoader.getEscapeTimer()
            self.doorsRando = self.romLoader.loadDoorsColor()
            self.hasNothing = self.checkLocsForNothing()
            if self.majorsSplit == 'Scavenger':
                self.scavengerOrder = self.romLoader.loadScavengerOrder(
                    self.locations)
            if hasObjectives:
                self.romLoader.loadObjectives(self.objectives)
            else:
                if self.majorsSplit == "Scavenger":
                    self.objectives.setScavengerHunt()
                    self.objectives.tourianRequired = not self.romLoader.hasPatch(
                        'Escape_Trigger')
                else:
                    self.objectives.setVanilla()
            self.majorUpgrades = self.romLoader.loadMajorUpgrades()
            self.splitLocsByArea = self.romLoader.getSplitLocsByArea(
                self.locations)
            self.objectives.setSolverMode(self)

            if interactive == False:
                print(
                    "ROM {} majors: {} area: {} boss: {} escape: {} patches: {} activePatches: {}"
                    .format(rom, self.majorsSplit, self.areaRando,
                            self.bossRando, self.escapeRando,
                            sorted(self.romLoader.getPatches()),
                            sorted(RomPatches.ActivePatches)))
            else:
                print(
                    "majors: {} area: {} boss: {} escape: {} activepatches: {}"
                    .format(self.majorsSplit, self.areaRando,
                            self.bossRando, self.escapeRando,
                            sorted(RomPatches.ActivePatches)))

            (self.areaTransitions, self.bossTransitions, self.escapeTransition,
             self.hasMixedTransitions) = self.romLoader.getTransitions(
                 self.tourian)
            if interactive == True and self.debug == False:
                # in interactive area mode we build the graph as we play along
                if self.areaRando == True and self.bossRando == True:
                    self.curGraphTransitions = []
                elif self.areaRando == True:
                    self.curGraphTransitions = self.bossTransitions[:]
                elif self.bossRando == True:
                    self.curGraphTransitions = self.areaTransitions[:]
                else:
                    self.curGraphTransitions = self.bossTransitions + self.areaTransitions
                if self.escapeRando == False:
                    self.curGraphTransitions += self.escapeTransition
            else:
                self.curGraphTransitions = self.bossTransitions + self.areaTransitions + self.escapeTransition

        self.smbm = SMBoolManager()
        self.buildGraph()

        # store at each step how many locations are available
        self.nbAvailLocs = []

        if self.log.getEffectiveLevel() == logging.DEBUG:
            self.log.debug("Display items at locations:")
            for loc in self.locations:
                self.log.debug('{:>50}: {:>16}'.format(loc.Name, loc.itemName))
 def transferCollected(self, dest):
     dest.currentItems = self.currentItems[:]
     dest.sm = SMBoolManager()
     dest.sm.addItems([item.Type for item in dest.currentItems])
     dest.itemLocations = copy.copy(self.itemLocations)
     dest.unrestrictedItems = copy.copy(self.unrestrictedItems)
Пример #15
0
from utils.utils import randGaussBounds
from rando.Items import ItemManager
from logic.smboolmanager import SMBoolManager
import random
import utils.log

fun = [
    'HiJump', 'SpeedBooster', 'Plasma', 'ScrewAttack', 'Wave', 'Spazer',
    'SpringBall'
]

if __name__ == "__main__":
    #    log.init(True) # debug mode
    utils.log.init(False)
    logger = utils.log.get('ItemsTest')
    sm = SMBoolManager()
    with open("itemStats.csv", "w") as csvOut:
        csvOut.write(
            "nLocs;energyQty;minorQty;nFun;strictMinors;MissProb;SuperProb;PowerProb;split;nItems;nTanks;nTanksTotal;nMinors;nMissiles;nSupers;nPowers;MissAccuracy;SuperAccuracy;PowerAccuracy;AmmoAccuracy\n"
        )
        for i in range(10000):
            logger.debug('SEED ' + str(i))
            if (i + 1) % 100 == 0:
                print(i + 1)
            isVanilla = random.random() < 0.5
            strictMinors = bool(random.getrandbits(1))
            minQty = 100
            energyQty = 'vanilla'
            forbidden = []
            if not isVanilla:
                minQty = random.randint(1, 99)
    def loadRom(self, rom, interactive=False, magic=None, startAP=None):
        # startAP param is only use for seedless
        if rom == None:
            # TODO::add a --logic parameter for seedless
            Logic.factory('varia')
            self.romFileName = 'seedless'
            self.majorsSplit = 'Full'
            self.areaRando = True
            self.bossRando = True
            self.escapeRando = False
            self.escapeTimer = "03:00"
            self.startAP = startAP
            RomPatches.setDefaultPatches(startAP)
            self.startArea = getAccessPoint(startAP).Start['solveArea']
            # in seedless load all the vanilla transitions
            self.areaTransitions = vanillaTransitions[:]
            self.bossTransitions = vanillaBossesTransitions[:]
            self.escapeTransition = [vanillaEscapeTransitions[0]]
            # in seedless we allow mixing of area and boss transitions
            self.hasMixedTransitions = True
            self.curGraphTransitions = self.bossTransitions + self.areaTransitions + self.escapeTransition
            self.locations = Logic.locations
            for loc in self.locations:
                loc.itemName = 'Nothing'
            # set doors related to default patches
            DoorsManager.setDoorsColor()
            self.doorsRando = False
        else:
            self.romFileName = rom
            self.romLoader = RomLoader.factory(rom, magic)
            Logic.factory(self.romLoader.readLogic())
            self.romLoader.readNothingId()
            self.locations = Logic.locations
            self.majorsSplit = self.romLoader.assignItems(self.locations)
            (self.startAP, self.startArea,
             startPatches) = self.romLoader.getStartAP()
            (self.areaRando, self.bossRando,
             self.escapeRando) = self.romLoader.loadPatches()
            RomPatches.ActivePatches += startPatches
            self.escapeTimer = self.romLoader.getEscapeTimer()
            self.doorsRando = self.romLoader.loadDoorsColor()

            if interactive == False:
                print(
                    "ROM {} majors: {} area: {} boss: {} escape: {} patches: {} activePatches: {}"
                    .format(rom, self.majorsSplit, self.areaRando,
                            self.bossRando, self.escapeRando,
                            sorted(self.romLoader.getPatches()),
                            sorted(RomPatches.ActivePatches)))
            else:
                print(
                    "majors: {} area: {} boss: {} escape: {} activepatches: {}"
                    .format(self.majorsSplit, self.areaRando,
                            self.bossRando, self.escapeRando,
                            sorted(RomPatches.ActivePatches)))

            (self.areaTransitions, self.bossTransitions, self.escapeTransition,
             self.hasMixedTransitions) = self.romLoader.getTransitions()
            if interactive == True and self.debug == False:
                # in interactive area mode we build the graph as we play along
                if self.areaRando == True and self.bossRando == True:
                    self.curGraphTransitions = []
                elif self.areaRando == True:
                    self.curGraphTransitions = self.bossTransitions[:]
                elif self.bossRando == True:
                    self.curGraphTransitions = self.areaTransitions[:]
                else:
                    self.curGraphTransitions = self.bossTransitions + self.areaTransitions
                if self.escapeRando == False:
                    self.curGraphTransitions += self.escapeTransition
            else:
                self.curGraphTransitions = self.bossTransitions + self.areaTransitions + self.escapeTransition

        self.smbm = SMBoolManager()
        self.areaGraph = AccessGraph(Logic.accessPoints,
                                     self.curGraphTransitions)

        # store at each step how many locations are available
        self.nbAvailLocs = []

        if self.log.getEffectiveLevel() == logging.DEBUG:
            self.log.debug("Display items at locations:")
            for loc in self.locations:
                self.log.debug('{:>50}: {:>16}'.format(loc.Name, loc.itemName))
Пример #17
0
 def transferCollected(self, dest):
     dest.currentItems = self.currentItems[:]
     dest.sm = SMBoolManager(self.sm.player, self.sm.maxDiff, self.sm.onlyBossLeft)
     dest.sm.addItems([item.Type for item in dest.currentItems])
     dest.itemLocations = copy.copy(self.itemLocations)
     dest.unrestrictedItems = copy.copy(self.unrestrictedItems)