Пример #1
0
 def toSolver(self, solver):
     solver.majorsSplit = self.state["majorsSplit"]
     solver.masterMajorsSplit = self.state["masterMajorsSplit"]
     solver.areaRando = self.state["areaRando"]
     solver.bossRando = self.state["bossRando"]
     solver.escapeRando = self.state["escapeRando"]
     solver.escapeTimer = self.state["escapeTimer"]
     RomPatches.ActivePatches = self.state["patches"]
     solver.startLocation = self.state["startLocation"]
     solver.startArea = self.state["startArea"]
     self.setLocsData(solver.locations)
     solver.areaTransitions = self.state["areaTransitions"]
     solver.bossTransitions = self.state["bossTransitions"]
     solver.escapeTransition = self.state["escapeTransition"]
     solver.curGraphTransitions = self.state["curGraphTransitions"]
     solver.hasMixedTransitions = self.state["hasMixedTransitions"]
     # preset
     solver.presetFileName = self.state["presetFileName"]
     # items collected / locs visited / bosses killed
     solver.collectedItems = self.state["collectedItems"]
     (solver.visitedLocations, solver.majorLocations) = self.setLocations(
         self.state["visitedLocations"], self.state["availableLocations"],
         solver.locations)
     solver.lastAP = self.state["lastAP"]
     solver.mode = self.state["mode"]
     solver.seed = self.state["seed"]
     solver.hasNothing = self.state["hasNothing"]
     DoorsManager.unserialize(self.state["doors"])
     solver.doorsRando = self.state["doorsRando"]
     solver.plandoScavengerOrder = self.state["plandoScavengerOrder"]
     solver.tourian = self.state["tourian"]
     solver.objectives.setState(self.state["objectives"])
     solver.majorUpgrades = self.state["majorUpgrades"]
     solver.splitLocsByArea = self.state["splitLocsByArea"]
Пример #2
0
                ctrlDict[k] = b
                i += 1
            else:
                raise ValueError("Invalid button name : " + str(b))

    plandoSettings = None
    if args.plandoRando is not None:
        forceArg('progressionSpeed', 'speedrun', "'Progression Speed' forced to speedrun")
        progSpeed = 'speedrun'
        forceArg('majorsSplit', 'Full', "'Majors Split' forced to Full")
        forceArg('morphPlacement', 'normal', "'Morph Placement' forced to normal")
        forceArg('progressionDifficulty', 'normal', "'Progression difficulty' forced to normal")
        progDiff = 'normal'
        args.plandoRando = json.loads(args.plandoRando)
        RomPatches.ActivePatches = args.plandoRando["patches"]
        DoorsManager.unserialize(args.plandoRando["doors"])
        plandoSettings = {"locsItems": args.plandoRando['locsItems'], "forbiddenItems": args.plandoRando['forbiddenItems']}
    randoSettings = RandoSettings(maxDifficulty, progSpeed, progDiff, qty,
                                  restrictions, args.superFun, args.runtimeLimit_s,
                                  plandoSettings, minDifficulty)

    # print some parameters for jm's stats
    if args.jm == True:
        print("startLocation:{}".format(args.startLocation))
        print("progressionSpeed:{}".format(progSpeed))
        print("majorsSplit:{}".format(args.majorsSplit))
        print("morphPlacement:{}".format(args.morphPlacement))
        print("gravity:{}".format(gravityBehaviour))
        print("maxDifficulty:{}".format(maxDifficulty))

    dotFile = None