Example #1
0
    static SaveFile BuildSave()
    {
        PreSave?.Invoke();
        SaveFile save = new SaveFile
        {
            version                  = Migrations.version,
            gameTime                 = GameTime.save,
            currency                 = CurrencySystem.instance.save,
            conveyor                 = ConveyorSystem.instance.save,
            machine                  = MachineSystem.instance.save,
            tileSelection            = TileSelectionManager.instance.save,
            overviewCameraController = OverviewCameraController.instance.save,
            analytics                = Analytics.instance.save,
        };

        BackgroundMusic.instance.GetSave(out save.backgroundMusic);
        InterfaceSelectionManager.instance.GetSave(out save.interfaceSelection);
        MachineGroupAchievements.instance.GetSave(out save.machineGroupAchievements);
        MachineUnlockSystem.instance.GetSave(out save.machineUnlocks);
        ProgressionStore.instance.GetSave(out save.progressionSystem);
        SpacePlatform.GetSave(out save.spacePlatforms);
        PostSave?.Invoke();

        return(save);
    }
Example #2
0
    public static SpacePlatform Create(Bounds3Int[] bounds, Color color)
    {
        SpacePlatform spacePlatform = new SpacePlatform();

        spacePlatform.save.bounds = bounds;
        spacePlatform.save.color  = color;
        spacePlatform.Initialize();
        return(spacePlatform);
    }
Example #3
0
    public static void InitializeFreePlay()
    {
        InitializeCommon();
        CurrencySystem.instance.SetItemsCostMoney(true);
        ProgressionSystem.instance.ApplyStartingProgressions();

        Bounds3Int[] bounds = new[] { new Bounds3Int(new Vector3Int(-6, 0, -8), new Vector3Int(5, 0, 7)) };
        SpacePlatform.Create(bounds, Color.white);
    }
Example #4
0
    public static void InitializeSandbox()
    {
        InitializeCommon();
        CurrencySystem.instance.SetItemsCostMoney(false);
        MachineUnlockSystem.instance.UnlockAll();

        Bounds3Int[] bounds = new[] { new Bounds3Int(new Vector3Int(-10, 0, -10), new Vector3Int(9, 0, 9)) };
        SpacePlatform.Create(bounds, Color.white);
    }
Example #5
0
 static void InitializeRooms()
 {
     for (int i = 1; i <= 50; ++i)
     {
         Color           floorColor = new Color(Random.Range(128f, 255f), Random.Range(128f, 255f), Random.Range(128f, 255f));
         AddonParameters parameters = new AddonParameters
         {
             minArea          = GameVars.GetPlatformArea(i),
             primarySizeMin   = GameVars.GetSpacePlatformMinSize(i) + 2,
             primarySizeMax   = GameVars.GetSpacePlatformMaxSize(i) + 2,
             secondarySizeMin = GameVars.GetSpacePlatformMinSize(i),
             secondarySizeMax = GameVars.GetSpacePlatformMaxSize(i)
         };
         Bounds3Int[] bounds = AddonGen.GenerateAddon(parameters);
         SpacePlatform.Create(bounds, floorColor);
     }
 }
Example #6
0
    void BeginGoal(GoalInfo goalInfo)
    {
        if (efficiencyQuest != null)
        {
            efficiencyQuest.Delete();
        }

        for (int i = 0, len = goalInfo.machinesUnlockedAtStart.Length; i < len; ++i)
        {
            MachineUnlockSystem.instance.Unlock(goalInfo.machinesUnlockedAtStart[i]);
        }

        if (goalInfo.restrictLand)
        {
            foreach (LandParcel restrict in LandSystem.instance.landParcelSet)
            {
                if (restrict.flags == LandParcelFlags.Valid)
                {
                    restrict.flags = LandParcelFlags.Restricted;
                }
            }
        }

        if (goalInfo.createAddon)
        {
            Bounds3Int[]  spacePlatformBounds = AddonGen.Addon(goalInfo.addon);
            SpacePlatform spacePlatform       = new SpacePlatform();
            spacePlatform.save.bounds = spacePlatformBounds;
            spacePlatform.Initialize();
            OverviewCameraController.instance.MoveTo(spacePlatform.visual.floors[0].transform.position);
        }

        efficiencyQuest = new EfficiencyQuest
        {
            goalInfo = goalInfo
        };
        efficiencyQuest.Initialize();
    }