Пример #1
0
    public void CalculateStrength()
    {
        _strength = (UpgradesController.Instance.UpgradesDictionary[Upgrade.Upgrade1] + 1) *
                    UpgradesController.CalculateMultiplier(Upgrade.Upgrade1);
        _strength += _strength * _prestigeCrystals * _prestigeCrystalsMultiplier;

        UpdateMiningPowerText();
    }
Пример #2
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);
        }
    }
Пример #3
0
    public void CalculateAutoStrength()
    {
        double autoStrength = 0;

        foreach (var upgrade in UpgradesController.Instance.UpgradesDictionary.Keys)
        {
            if (!upgrade.Equals(Upgrade.Upgrade1) && !upgrade.Equals(Upgrade.Upgrade2))
            {
                if (UpgradesConsts.GetUpgradeValues(upgrade) != null)
                {
                    autoStrength += UpgradesConsts.GetUpgradeValues(upgrade).Productivity *
                                    UpgradesController.Instance.UpgradesDictionary[upgrade] *
                                    UpgradesController.CalculateMultiplier(upgrade);
                }
            }
        }

        autoStrength += autoStrength * _prestigeCrystals * _prestigeCrystalsMultiplier;

        _autoStrength = autoStrength;

        UpdateMiningPowerText();
    }