Exemple #1
0
    private void Upgrade()
    {
        /*  Example where:
         *
         *  caseOne = 2;
         *  caseTwo = 4;
         *  caseThree = 8;
         *  caseFour = 15;
         *  caseFive = 25;
         *  firstStage = 25;
         *  nextUnlock = 35;
         *  add = 10;
         *  max = 225;
         *
         *  This implies the Upgrade Sequence:
         *  2 > 4 > 8 > 15 > 25 > 35 > 45 > 55 > 65..
         *  After 25 (firstStage), +10 is added subsequently henceforth until 225.
         *  However, below 25 is a non linear addition.
         */

        if (multiplier <= firstStage)
        {
            if (multiplier == caseOne && !UpgradeData.GetUpgradesUnlocked(0))
            {
                UpgradeData.SetUpgradesUnlocked(0, true);
            }
            else if (multiplier == caseTwo && !UpgradeData.GetUpgradesUnlocked(1))
            {
                UpgradeData.SetUpgradesUnlocked(1, true);
            }
            else if (multiplier == caseThree && !UpgradeData.GetUpgradesUnlocked(2))
            {
                UpgradeData.SetUpgradesUnlocked(2, true);
            }
            else if (multiplier == caseFour && !UpgradeData.GetUpgradesUnlocked(3))
            {
                UpgradeData.SetUpgradesUnlocked(3, true);
            }
            else if (multiplier == caseFive && !UpgradeData.GetUpgradesUnlocked(4))
            {
                UpgradeData.SetUpgradesUnlocked(4, true);
            }
        }
        else if (multiplier >= nextUnlock && nextUnlock <= max)
        {
            if (!UpgradeData.GetUpgradesUnlocked(5 + unlockNumber))
            {
                UpgradeData.SetUpgradesUnlocked(5 + unlockNumber, true);

                unlockNumber++;
                nextUnlock += add;
            }
        }
    }