Example #1
0
    public void ClearAllSaveData()
    {
        var currentBot = new botStruct();

        for (int i = 0; i < 4; i++)
        {
            if (i == 0)
            {
                currentBot = leadBot;
            }
            else if (i == 1)
            {
                currentBot = blueBot;
            }
            else if (i == 2)
            {
                currentBot = greenBot;
            }
            else if (i == 3)
            {
                currentBot = orangeBot;
            }

            currentBot.points      = 10;
            currentBot.level       = 1;
            currentBot.exp         = 0;
            currentBot.strength    = 0;
            currentBot.electronics = 0;
            currentBot.agility     = 0;
            currentBot.combat      = 0;
            currentBot.scanning    = 0;
            currentBot.efficiency  = 0;
            currentBot.heavyHitter = 0;
            currentBot.retention   = 0;
            currentBot.defender    = 0;
            currentBot.objMaster   = 0;
            currentBot.regenerator = 0;
            currentBot.lucky       = 0;
            currentBot.teamPlayer  = 0;
            currentBot.informant   = 0;
            currentBot.spec        = "No Specialization";


            if (i == 0)
            {
                leadBot = currentBot;
            }
            else if (i == 1)
            {
                blueBot = currentBot;
            }
            else if (i == 2)
            {
                greenBot = currentBot;
            }
            else if (i == 3)
            {
                orangeBot = currentBot;
            }
        }
    }
Example #2
0
    public void StatsUpdate(int botID, HUBStats.statsGroup botStats) //when called, using the integer value to identify what bot is being acted on and update the stats for that bot
    {
        botStruct tempStruct = new botStruct();

        //Before setting the stats for the targeted bot struct, set the new temporary structure equal to the one that is being changed
        if (botID == 0)
        {
            tempStruct = leadBot;
        }
        else if (botID == 1)
        {
            tempStruct = blueBot;
        }
        else if (botID == 2)
        {
            tempStruct = greenBot;
        }
        else if (botID == 3)
        {
            tempStruct = orangeBot;
        }

        tempStruct.points      = botStats.pointsAvailable;
        tempStruct.level       = botStats.playerLevel;
        tempStruct.exp         = botStats.playerEXP;
        tempStruct.strength    = botStats.strength;
        tempStruct.electronics = botStats.electronics;
        tempStruct.agility     = botStats.agility;
        tempStruct.combat      = botStats.combat;
        tempStruct.scanning    = botStats.scanning;
        tempStruct.efficiency  = botStats.efficiency;
        tempStruct.heavyHitter = botStats.heavyHitter;
        tempStruct.retention   = botStats.retention;
        tempStruct.defender    = botStats.defender;
        tempStruct.objMaster   = botStats.objMaster;
        tempStruct.regenerator = botStats.regenerator;
        tempStruct.lucky       = botStats.lucky;
        tempStruct.teamPlayer  = botStats.teamPlayer;
        tempStruct.informant   = botStats.informant;
        tempStruct.spec        = botStats.specialization.text.ToString();
        tempStruct.perk1       = botStats.perk1;
        tempStruct.perk2       = botStats.perk2;
        tempStruct.perk3       = botStats.perk3;
        tempStruct.perk4       = botStats.perk4;
        tempStruct.perk5       = botStats.perk5;
        tempStruct.perk6       = botStats.perk6;
        if (tempStruct.perk1 != null)
        {
            tempStruct.perk1.gameObject.transform.SetParent(gameObject.transform);
        }
        if (tempStruct.perk2 != null)
        {
            tempStruct.perk2.gameObject.transform.SetParent(gameObject.transform);
        }
        if (tempStruct.perk3 != null)
        {
            tempStruct.perk3.gameObject.transform.SetParent(gameObject.transform);
        }
        if (tempStruct.perk4 != null)
        {
            tempStruct.perk4.gameObject.transform.SetParent(gameObject.transform);
        }
        if (tempStruct.perk5 != null)
        {
            tempStruct.perk5.gameObject.transform.SetParent(gameObject.transform);
        }
        if (tempStruct.perk6 != null)
        {
            tempStruct.perk6.gameObject.transform.SetParent(gameObject.transform);
        }

        //after setting the stats for the temporary bot struct, update the actual bot struct by setting it equal to this temporary one
        if (botID == 0)
        {
            leadBot = tempStruct;
        }
        else if (botID == 1)
        {
            blueBot = tempStruct;
        }
        else if (botID == 2)
        {
            greenBot = tempStruct;
        }
        else if (botID == 3)
        {
            orangeBot = tempStruct;
        }
    }
Example #3
0
    public void LoadDataFromFile(string fileName)
    {
        PlayerData data = SaveSystem.LoadData(fileName);

        var currentBot  = new botStruct();
        var currentData = new PlayerData.botData();

        for (int i = 0; i < 4; i++)
        {
            if (i == 0)
            {
                currentBot  = leadBot;
                currentData = data.leadBot;
            }
            else if (i == 1)
            {
                currentBot  = blueBot;
                currentData = data.blueBot;
            }
            else if (i == 2)
            {
                currentBot  = greenBot;
                currentData = data.greenBot;
            }
            else if (i == 3)
            {
                currentBot  = orangeBot;
                currentData = data.orangeBot;
            }

            currentBot.points      = currentData.points;
            currentBot.level       = currentData.level;
            currentBot.exp         = currentData.exp;
            currentBot.strength    = currentData.strength;
            currentBot.electronics = currentData.electronics;
            currentBot.agility     = currentData.agility;
            currentBot.combat      = currentData.combat;
            currentBot.scanning    = currentData.scanning;
            currentBot.efficiency  = currentData.efficiency;
            currentBot.heavyHitter = currentData.heavyHitter;
            currentBot.retention   = currentData.retention;
            currentBot.defender    = currentData.defender;
            currentBot.objMaster   = currentData.objMaster;
            currentBot.regenerator = currentData.regenerator;
            currentBot.lucky       = currentData.lucky;
            currentBot.teamPlayer  = currentData.teamPlayer;
            currentBot.informant   = currentData.informant;
            currentBot.spec        = currentData.spec;


            if (i == 0)
            {
                leadBot = currentBot;
            }
            else if (i == 1)
            {
                blueBot = currentBot;
            }
            else if (i == 2)
            {
                greenBot = currentBot;
            }
            else if (i == 3)
            {
                orangeBot = currentBot;
            }
        }
    }