Skip to content
Snippets Groups Projects
Verified Commit 511c1a0b authored by Adrian Paschkowski's avatar Adrian Paschkowski :thinking:
Browse files

Adjust upgrade pricing, truncate decimals

parent 88fc90fe
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ public class UpgradeData ...@@ -43,7 +43,7 @@ public class UpgradeData
// You probably shouldn't call this outside this file. // You probably shouldn't call this outside this file.
public int GetUnadjustedNextUpgradeCost() public int GetUnadjustedNextUpgradeCost()
{ {
return (int)(upgrade.baseCost * (1 + count * upgrade.costMultiplier)); return (int)(upgrade.baseCost * Mathf.Pow(1 + upgrade.costMultiplier, count));
} }
} }
......
...@@ -38,7 +38,7 @@ public class UpgradeController : MonoBehaviour ...@@ -38,7 +38,7 @@ public class UpgradeController : MonoBehaviour
multiplierTexts.Add(UpgradeTypes.MANA_COST, manaMultiplierText); multiplierTexts.Add(UpgradeTypes.MANA_COST, manaMultiplierText);
foreach (KeyValuePair<UpgradeTypes,Text> multiplierText in multiplierTexts) foreach (KeyValuePair<UpgradeTypes,Text> multiplierText in multiplierTexts)
{ {
multiplierText.Value.text = statsManager.GetTotalEffectMultiplier(multiplierText.Key).ToString(); multiplierText.Value.text = statsManager.GetTotalEffectMultiplier(multiplierText.Key).ToString("F2");
} }
} }
...@@ -66,7 +66,7 @@ public class UpgradeController : MonoBehaviour ...@@ -66,7 +66,7 @@ public class UpgradeController : MonoBehaviour
if (statsManager.BuyUpgrade(upgradeType)) if (statsManager.BuyUpgrade(upgradeType))
{ {
upgradeTexts[upgradeType].text = statsManager.GetNextUpgradeCost(upgradeType).ToString(); upgradeTexts[upgradeType].text = statsManager.GetNextUpgradeCost(upgradeType).ToString();
multiplierTexts[upgradeType].text = statsManager.GetTotalEffectMultiplier(upgradeType).ToString(); multiplierTexts[upgradeType].text = statsManager.GetTotalEffectMultiplier(upgradeType).ToString("F2");
if (upgradeType == UpgradeTypes.MANA_COST) if (upgradeType == UpgradeTypes.MANA_COST)
{ {
UpdateAllCosts(); UpdateAllCosts();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment