Exemplo n.º 1
0
    public float GetFinalStat(UpgradeStatType type, float baseStat)
    {
        float flatPermanentValue       = flatPermanentUpgrades.ContainsKey(type) ? flatPermanentUpgrades[type] : 0;
        float percentagePermanentValue = percentagePermanentUpgrades.ContainsKey(type) ? percentagePermanentUpgrades[type] : 0;
        float flatTemporaryValue       = flatTemporaryUpgrades.ContainsKey(type) ? flatTemporaryUpgrades[type] : 0;
        float percentageTemporaryValue = percentageTemporaryUpgrades.ContainsKey(type) ? percentageTemporaryUpgrades[type] : 0;

        return((baseStat + flatPermanentValue + flatTemporaryValue) * (1 - percentagePermanentValue / 100) * (1 - percentageTemporaryValue / 100));
    }
Exemplo n.º 2
0
 public Blueprint_Upgrade(UpgradeStatType up_one, UpgradeStatType up_two, UpgradeStatType up_three)
 {
     upgradeOne = up_one;
     upgradeTwo = up_two;
     upgradeThree = up_three;
     totalUpgrades = 3;
 }
Exemplo n.º 3
0
 public Blueprint_Upgrade(UpgradeStatType up_one, UpgradeStatType up_two)
 {
     upgradeOne = up_one;
     upgradeTwo = up_two;
     totalUpgrades = 2;
 }
Exemplo n.º 4
0
 public Blueprint_Upgrade(UpgradeStatType up_one)
 {
     upgradeOne = up_one;
     totalUpgrades = 1;
 }
Exemplo n.º 5
0
    private IEnumerator WaitForTemporaryBoost(float lifetime, Dictionary <UpgradeStatType, float> dictionnary, UpgradeStatType type, float value)
    {
        yield return(new WaitForSeconds(lifetime));

        dictionnary[type] -= value;
    }
Exemplo n.º 6
0
    public void AddPercentageTemporarytUpgrade(UpgradeStatType type, float value, float lifetime)
    {
        percentageTemporaryUpgrades[type] = percentageTemporaryUpgrades.ContainsKey(type) ? percentageTemporaryUpgrades[type] + value : value;

        StartCoroutine(WaitForTemporaryBoost(lifetime, percentageTemporaryUpgrades, type, value));
    }
Exemplo n.º 7
0
    public void AddFlatTemporaryUpgrade(UpgradeStatType type, float value, float lifetime)
    {
        flatTemporaryUpgrades[type] = flatTemporaryUpgrades.ContainsKey(type) ? flatTemporaryUpgrades[type] + value : value;

        StartCoroutine(WaitForTemporaryBoost(lifetime, flatTemporaryUpgrades, type, value));
    }
Exemplo n.º 8
0
 public void AddPercentagePermanentUpgrade(UpgradeStatType type, float value)
 {
     percentagePermanentUpgrades[type] = percentagePermanentUpgrades.ContainsKey(type) ? percentagePermanentUpgrades[type] + value : value;
 }
Exemplo n.º 9
0
 public void AddFlatPermanentUpgrade(UpgradeStatType type, float value)
 {
     flatPermanentUpgrades[type] = flatPermanentUpgrades.ContainsKey(type) ? flatPermanentUpgrades[type] + value : value;
 }