Ejemplo n.º 1
0
    private void UpdateText()
    {
        var prestigeBonus = GameController.Instance.GetPrestigeCrystals() *
                            GameController.Instance.GetPrestigeCrystalsMultiplier();

        var productivity = _upgradeValues.Productivity * UpgradesController.CalculateMultiplier(Upgrade);

        productivity += productivity * prestigeBonus;

        if (Upgrade.Equals(Upgrade.Upgrade1))
        {
            var strength = GameController.Instance.GetStrength();

            UpgradeDescription.text =
                "Increases <b>DMG</b> by <b>" + MoneyConverter.ConvertNumber(productivity) + "</b>.";
            ActualProductivity.text = "Current <b>DMG</b> is <b>" + MoneyConverter.ConvertNumber(strength) + "</b>.";

            if (!UpgradesController.Instance.UpgradesDictionary.ContainsKey(Upgrade))
            {
                return;
            }

            NextMultiplier.text =
                "x" + UpgradesController.GetClosestMultiplier(Upgrade);
        }
        else if (Upgrade.Equals(Upgrade.Upgrade2))
        {
            UpgradeDescription.text = "Shortens auto mining interval by <b>" + _upgradeValues.Productivity + "s</b>.";
            ActualProductivity.text =
                "Current mining interval is <b>" + GameController.Instance.GetMiningSpeed() + "s</b>.";
            NextMultiplier.text = "";
        }
        else
        {
            var autoStrength = UpgradesController.CalculateUpgradeProductivity(Upgrade);
            autoStrength += autoStrength * prestigeBonus;

            UpgradeDescription.text =
                "Increases <b>DPS</b> by <b>" + MoneyConverter.ConvertNumber(productivity) + "</b>.";
            ActualProductivity.text =
                "Current <b>DPS</b> is <b>" + MoneyConverter.ConvertNumber(autoStrength) + "</b>.";

            if (!UpgradesController.Instance.UpgradesDictionary.ContainsKey(Upgrade))
            {
                return;
            }

            NextMultiplier.text =
                "x" + UpgradesController.GetClosestMultiplier(Upgrade);
        }
    }