Exemple #1
0
        internal static MonumentUpgrade FromString(string base64String)
        {
            if (string.IsNullOrEmpty(base64String))
            {
                Log.Error("MonumentUpgrade.FromString with empty value!");
                return(null);
            }
            string[]        parts           = Conv.StringPartsFromBase64(base64String, "MonumentUpgrade");
            MonumentUpgrade monumentUpgrade = new MonumentUpgrade();

            monumentUpgrade.EnumValue        = Conv.getIntFromParts(parts, "a");
            monumentUpgrade.Level            = new CDouble(Conv.getStringFromParts(parts, "b"));
            monumentUpgrade.ShadowCloneCount = Conv.getCDoubleFromParts(parts, "c", false);
            monumentUpgrade.CurrentDuration  = Conv.getLongFromParts(parts, "d");
            monumentUpgrade.IsPaid           = Conv.getStringFromParts(parts, "e").ToLower().Equals("true");
            monumentUpgrade.StopAt           = Conv.getIntFromParts(parts, "f");
            monumentUpgrade.StopAtString     = monumentUpgrade.StopAt.ToString();
            monumentUpgrade.Init((Monument.MonumentType)monumentUpgrade.EnumValue);
            return(monumentUpgrade);
        }
Exemple #2
0
        internal void AddUpgradeLevel()
        {
            CDouble         physicalPower = this.Upgrade.PhysicalPower;
            CDouble         mysticPower   = this.Upgrade.MysticPower;
            CDouble         battlePower   = this.Upgrade.BattlePower;
            CDouble         creatingPower = this.Upgrade.CreatingPower;
            MonumentUpgrade expr_36       = this.Upgrade;

            expr_36.Level = ++expr_36.Level;
            Statistic expr_50 = App.State.Statistic;

            expr_50.TotalUpgrades = ++expr_50.TotalUpgrades;
            if (this.PhysicalPowerBase > 0)
            {
                CDouble cDouble = (this.Upgrade.PhysicalPower - physicalPower) * this.Level * this.PhysicalPowerBase;
                App.State.Multiplier.MonumentMultiPhysical += cDouble;
                Log.Info("difPhysical: " + cDouble.ToGuiText(true));
            }
            if (this.MysticPowerBase > 0)
            {
                CDouble cDouble2 = (this.Upgrade.MysticPower - mysticPower) * this.Level * this.MysticPowerBase;
                App.State.Multiplier.MonumentMultiMystic += cDouble2;
                Log.Info("difMystic: " + cDouble2.ToGuiText(true));
            }
            if (this.BattlePowerBase > 0)
            {
                CDouble cDouble3 = (this.Upgrade.BattlePower - battlePower) * this.Level * this.BattlePowerBase;
                App.State.Multiplier.MonumentMultiBattle += cDouble3;
                Log.Info("difBattle: " + cDouble3.ToGuiText(true));
            }
            if (this.CreatingPowerBase > 0)
            {
                CDouble cDouble4 = (this.Upgrade.CreatingPower - creatingPower) * this.Level * this.CreatingPowerBase;
                App.State.Multiplier.MonumentMultiCreating += cDouble4;
                Log.Info("difCreating: " + cDouble4.ToGuiText(true));
            }
            App.State.Multiplier.RecalculateMonumentMultis(App.State);
            App.State.UpdateAllInfoTexts();
        }