Example #1
0
 public void SaveGameButton()
 {
     SaveLoadModule.SaveGame(GameManager.SAVESLOT);
     GameManager.EXPLORE.CloseOverlays();
 }
Example #2
0
    public void InitializeGame()
    {
        SELECTED_CHARACTER = -1;

        DEBUGSTUFF();

        //INSTANTIATE INVENTORY
        for (int _i = 0; _i < GameManager.PARTYSIZE; _i++)
        {
            if (GameManager.PARTY.PC[_i].eq_Head != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_Head);
            }
            if (GameManager.PARTY.PC[_i].eq_Neck != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_Neck);
            }
            if (GameManager.PARTY.PC[_i].eq_LeftFinger != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_LeftFinger);
            }
            if (GameManager.PARTY.PC[_i].eq_RightFinger != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_RightFinger);
            }
            if (GameManager.PARTY.PC[_i].eq_LeftHand != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_LeftHand);
            }
            if (GameManager.PARTY.PC[_i].eq_RightHand != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_RightHand);
            }
            if (GameManager.PARTY.PC[_i].eq_Torso != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_Torso);
            }
            if (GameManager.PARTY.PC[_i].eq_Legs != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_Legs);
            }
            if (GameManager.PARTY.PC[_i].eq_Feet != null)
            {
                Object.Instantiate(GameManager.PARTY.PC[_i].eq_Feet);
            }
        }


        //MORE DEBUG
        PARTY.PC[0].eq_RightHand        = Instantiate(ref_item);
        PARTY.PC[1].eq_RightHand        = Instantiate(ref_item);
        PARTY.PC[1].eq_RightHand.itm_ID = true;


        for (int _i = 0; _i < PARTY.bagInventory.Length; _i++)
        {
            if (PARTY.bagInventory[_i] != null)
            {
                PARTY.bagInventory[_i] = Instantiate(PARTY.bagInventory[_i]);
            }
        }
        //TO DO: Chests and Floor Loot

        //Initial save. this should only run if there is no save for the game already
        if (!SaveLoadModule.DoesSaveExist(SAVESLOT))
        {
            //SET party to full health and mana
            PARTY.PC[0].pc_HP = PARTY.PC[0].pc_Max_HP; PARTY.PC[0].pc_MP = PARTY.PC[0].pc_Max_MP; PARTY.PC[0].pc_XP = 0;
            PARTY.PC[1].pc_HP = PARTY.PC[1].pc_Max_HP; PARTY.PC[1].pc_MP = PARTY.PC[1].pc_Max_MP; PARTY.PC[1].pc_XP = 0;
            PARTY.PC[2].pc_HP = PARTY.PC[2].pc_Max_HP; PARTY.PC[2].pc_MP = PARTY.PC[2].pc_Max_MP; PARTY.PC[2].pc_XP = 0;
            PARTY.PC[3].pc_HP = PARTY.PC[3].pc_Max_HP; PARTY.PC[3].pc_MP = PARTY.PC[3].pc_Max_MP; PARTY.PC[3].pc_XP = 0;

            //Set party wealth to 1,000
            PARTY.wealth = 1000;

            //Spin up blank savegame
            SaveLoadModule.NewSaveGame(SAVESLOT);
        }
        else //otherwise, load the save game
        {
            SaveLoadModule.LoadGame(SAVESLOT);
            StartCoroutine(_LoadSceneThenLoadGame(UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex));
        }



        BuildMiniMapMaster();

        EXPLORE.UpdateUI();
    }
Example #3
0
 public void LoadGameButton()
 {
     SaveLoadModule.LoadGame(GameManager.SAVESLOT);
     GameManager.GAME.LoadSceneThenLoadGame(SaveLoadModule.save_slot[GameManager.SAVESLOT].currentDungeonLevel);
     GameManager.EXPLORE.CloseOverlays();
 }