コード例 #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));
    }
コード例 #2
0
ファイル: Blueprint.cs プロジェクト: cesarrac/TheyRise-game
 public Blueprint_Upgrade(UpgradeStatType up_one, UpgradeStatType up_two, UpgradeStatType up_three)
 {
     upgradeOne = up_one;
     upgradeTwo = up_two;
     upgradeThree = up_three;
     totalUpgrades = 3;
 }
コード例 #3
0
ファイル: Blueprint.cs プロジェクト: cesarrac/TheyRise-game
 public Blueprint_Upgrade(UpgradeStatType up_one, UpgradeStatType up_two)
 {
     upgradeOne = up_one;
     upgradeTwo = up_two;
     totalUpgrades = 2;
 }
コード例 #4
0
ファイル: Blueprint.cs プロジェクト: cesarrac/TheyRise-game
 public Blueprint_Upgrade(UpgradeStatType up_one)
 {
     upgradeOne = up_one;
     totalUpgrades = 1;
 }
コード例 #5
0
    private IEnumerator WaitForTemporaryBoost(float lifetime, Dictionary <UpgradeStatType, float> dictionnary, UpgradeStatType type, float value)
    {
        yield return(new WaitForSeconds(lifetime));

        dictionnary[type] -= value;
    }
コード例 #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));
    }
コード例 #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));
    }
コード例 #8
0
 public void AddPercentagePermanentUpgrade(UpgradeStatType type, float value)
 {
     percentagePermanentUpgrades[type] = percentagePermanentUpgrades.ContainsKey(type) ? percentagePermanentUpgrades[type] + value : value;
 }
コード例 #9
0
 public void AddFlatPermanentUpgrade(UpgradeStatType type, float value)
 {
     flatPermanentUpgrades[type] = flatPermanentUpgrades.ContainsKey(type) ? flatPermanentUpgrades[type] + value : value;
 }