Ejemplo n.º 1
0
    private void Start()
    {
        Globals.currState = GameState.Base;

        if (Globals.campaign == null)
        {
            GenerateDemoCampaign dcm = new GenerateDemoCampaign();
            Globals.campaign = dcm.campaign;
        }



        currWorldMap = Globals.campaign.worldMapDictionary[Globals.campaign.currentWorldMap];
        icons        = new List <GameObject>();

        PrintBoard();
        PrintPlayer();

        InitInputState();
        InitIcons();

        Debug.Log("Loaded: " + Globals.campaign);


        worldMapUIManager.InitWorldMap();
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        GenerateDemoCampaign de = new GenerateDemoCampaign();

        s                += "Debug" + "\n";
        debug.text        = s;
        currentCampaign   = SaveLoadManager.LoadFile(FilePath.CampaignFolder + default_campaign_name) as Campaign;
        currentCampaign   = de.campaign;
        inputStateMachine = new InputFSM(new BlockUserInputState());
    }
Ejemplo n.º 3
0
    public void GenerateDefaultCampaign()
    {
        GenerateDemoCampaign demo = new GenerateDemoCampaign();

        campaign = demo.campaign;
        StressTest(stresstestLevel);


        //  GenerateDemoDayCampaign d = new GenerateDemoDayCampaign();
        //  campaign = d.campaign;
        //  StressTest(stresstestLevel);



        Debug.Log("Generate campaigns");
    }
Ejemplo n.º 4
0
    private void Start()
    {
        // Toggle on to test, idk i kinda forgot why i did this //
        //                                                      //

        if (test)
        {
            GenerateDemoCampaign c = new GenerateDemoCampaign();

            cs = c.campaign.GetCutsceneCopy("test_cutscene");
            Globals.campaign = c.campaign;
        }
        else
        {
            cs = Globals.cutsceneData.currentScene;
        }

        Globals.campaign.AddCutsceneToWatchList(cs);

        InitCutscene(cs);
    }
Ejemplo n.º 5
0
    void Start()
    {
        _instance = this;

        //Just a testing thing
        if (Globals.campaign == null)
        {
            Debug.Log("DEPENDICIES INJECTED");

            GenerateDemoCampaign dcm = new GenerateDemoCampaign();
            Globals.campaign = dcm.campaign;

            campaign = dcm.campaign;
            party    = campaign.currentparty;

            currentMission         = campaign.GetMissionData("test_mission_00");
            currentMission.started = false;
            SavedFileMission state = new SavedFileMission(campaign, currentMission);
            FilePath.CurrentSaveFilePath = SaveLoadManager.GenerateSaveStateFilePath(state.campaign.GetFileName());
            SaveLoadManager.AutoSaveCampaignProgress(state);
        }
        else
        {
            campaign = Globals.campaign;
            party    = campaign.currentparty;
        }


        //Actual initialization starts here
        Globals.currState = GameState.Combat;


        SavedFileMission file = SaveLoadManager.LoadFile(FilePath.CurrentSaveFilePath) as SavedFileMission;

        currentMission = file.currentMission;

        currMap = Globals.campaign.GetMapDataContainer().mapDB.GetCopy(currentMission.mapName);

        if (currentMission.started)
        {
            for (int x = 0; x < currMap.sizeX; x++)
            {
                for (int y = 0; y < currMap.sizeY; y++)
                {
                    currMap.tileBoard[x, y] = file.TileTypeStates[x, y].GetKey();
                }
            }
        }

        inputFSM = new InputFSM(new BlockUserInputState());
        atlas    = Resources.Load <SpriteAtlas>(FilePath.TileSetAtlas);

        GenerateBoard();

        //we are loading a mission
        if (currentMission.started)
        {
            StartBattleFromLoad();

            for (int x = 0; x < currMap.sizeX; x++)
            {
                for (int y = 0; y < currMap.sizeY; y++)
                {
                    pathfinding.tiles[x, y].tileGO.ChangeTileType(file.TileTypeStates[x, y]);

                    foreach (TileEffect effect in file.TileEffectStates[x, y])
                    {
                        if (effect is AuraTileEffect)
                        {
                            //pathfinding.tiles[x, y].AddTileEffect(effect.Copy() as AuraTileEffect);
                        }
                        else
                        {
                            pathfinding.tiles[x, y].AddTileEffect(effect.Copy() as TileEffect);
                        }
                    }
                }
            }

            turnManager.globalTurnSpeed = file.currentTurnSpeed;
        }
        else // we starting a new mission
        {
            Globals.cutsceneData = null;
            InitBattledata();

            //ui.TurnOffInfoPanels();
            currentMission.started = true;
        }
    }