Пример #1
0
        public void GetAttacked(CDouble attackPower, long millisecs)
        {
            int     value = UnityEngine.Random.Range(1, 100);
            CDouble cDouble;

            if (value <= App.State.Crits.CriticalPercent(App.State.GameSettings.TBSEyesIsMirrored))
            {
                attackPower = attackPower * App.State.Crits.CriticalDamage / 100;
                cDouble     = attackPower / 5000 * millisecs;
            }
            else
            {
                cDouble = (attackPower - this.Defense) / 5000 * millisecs;
            }
            this.DamageSec = cDouble * 33;
            if (cDouble > 0)
            {
                this.CurrentHealth -= cDouble;
            }
            if (this.CurrentHealth <= 0)
            {
                App.State.Title    = EnumName.Title(App.State.Avatar.IsFemale, this.TypeEnum);
                App.State.TitleGod = this.Name;
                if (App.State.Statistic.HighestGodDefeated < (int)this.TypeEnum)
                {
                    App.State.Statistic.HighestGodDefeated = (int)this.TypeEnum;
                }
                if (App.State.Statistic.HasStartedArtyChallenge && App.State.Statistic.HighestGodInUAC < (int)this.TypeEnum)
                {
                    App.State.Statistic.HighestGodInUAC = (int)this.TypeEnum;
                }
                this.IsDefeated = true;
                if (this.TypeEnum > God.GodType.Diana || !this.IsDefeatedForFirstTime)
                {
                    this.IsDefeatedForFirstTime = true;
                    App.State.PremiumBoni.GodPower++;
                    GuiBase.ShowToast("Your god power is increased by 1!");
                    App.State.PremiumBoni.CheckIfGPIsAdjusted();
                }
                Statistic expr_212 = App.State.Statistic;
                expr_212.TotalGodsDefeated = ++expr_212.TotalGodsDefeated;
                StoryUi.SetUnlockedStoryParts(App.State);
                Leaderboards.SubmitStat(LeaderBoardType.GodsDefeated, App.State.Statistic.TotalGodsDefeated.ToInt(), false);
                Leaderboards.SubmitStat(LeaderBoardType.HighestGodDefeated, App.State.Statistic.HighestGodDefeated.ToInt(), false);
                HeroImage.Init(true);
                if (this.TypeEnum == God.GodType.Diana)
                {
                    App.State.IsMonumentUnlocked = true;
                    GuiBase.ShowContentUnlocked("You can now build monuments.");
                }
                else if (this.TypeEnum == God.GodType.Nephthys)
                {
                    App.State.IsBuyUnlocked = true;
                    App.State.GameSettings.AutoBuyCreationsForMonuments = App.State.GameSettings.AutoBuyCreationsForMonumentsBeforeRebirth;
                    GuiBase.ShowContentUnlocked("You can now buy creations after you created at least one.");
                }
                else if (this.TypeEnum == God.GodType.Poseidon && App.CurrentPlattform == Plattform.Android && !App.State.Ext.RateDialogShown)
                {
                    App.State.Ext.RateDialogShown = true;
                    GuiBase.ShowDialog("Rate ItRtG", "If you like the game, please rate it on google play. Good ratings helps to get more players, and more players will lead to more success of the game, and more time for me to work on updates or future games.", delegate
                    {
                        App.OpenWebsite("https://play.google.com/store/apps/details?id=de.shugasu.itrtg");
                    }, delegate
                    {
                    }, "Rate it", "Cancel", true, true);
                }
                else if (this.TypeEnum == God.GodType.Freya)
                {
                    App.State.IsUpgradeUnlocked = true;
                    GuiBase.ShowContentUnlocked("You can now upgrade your monuments!");
                }
                else if (this.TypeEnum == God.GodType.Chronos && App.State.Statistic.HasStartedArtyChallenge)
                {
                    UpdateStats.SaveToServer(UpdateStats.ServerSaveType.UAChallengeSave2);
                }
                else if (this.TypeEnum == God.GodType.Tyrant_Overlord_Baal)
                {
                    if (App.State.Statistic.HasStartedDoubleRebirthChallenge)
                    {
                        App.State.Statistic.HasStartedDoubleRebirthChallenge = false;
                        if (App.State.Statistic.FastestDRCallenge <= 0 || App.State.Statistic.FastestDRCallenge > App.State.Statistic.TimeAfterDRCStarted)
                        {
                            App.State.Statistic.FastestDRCallenge = App.State.Statistic.TimeAfterDRCStarted;
                            Leaderboards.SubmitStat(LeaderBoardType.FastestDRCallenge, App.State.Statistic.FastestDRCallenge.ToInt() / 1000, false);
                        }
                        App.State.Statistic.TimeAfterDRCStarted = 0;
                        Statistic expr_493 = App.State.Statistic;
                        expr_493.DoubleRebirthChallengesFinished = ++expr_493.DoubleRebirthChallengesFinished;
                        int num = 10;
                        if (App.State.Statistic.DoubleRebirthChallengesFinished > 50)
                        {
                            num += 10;
                        }
                        App.State.PremiumBoni.GodPower += num;
                        App.State.PremiumBoni.CheckIfGPIsAdjusted();
                        App.SaveGameState();
                        GuiBase.ShowToast("Your god power is increased by " + num + " because you beat the double rebirth challenge!");
                    }
                    if (App.State.Statistic.HasStarted1kChallenge)
                    {
                        App.State.Statistic.HasStarted1kChallenge = false;
                        if (App.State.Statistic.Fastest1KCCallenge <= 0 || App.State.Statistic.Fastest1KCCallenge > App.State.Statistic.TimeAfter1KCStarted)
                        {
                            App.State.Statistic.Fastest1KCCallenge = App.State.Statistic.TimeAfter1KCStarted;
                            Leaderboards.SubmitStat(LeaderBoardType.Fastest1KCCallenge, App.State.Statistic.Fastest1KCCallenge.ToInt() / 1000, false);
                        }
                        App.State.Statistic.TimeAfter1KCStarted = 0;
                        Statistic expr_5DA = App.State.Statistic;
                        expr_5DA.OnekChallengesFinished  = ++expr_5DA.OnekChallengesFinished;
                        App.State.Clones.MaxShadowClones = App.State.Clones.AbsoluteMaximum;
                        App.State.PremiumBoni.GodPower  += 20;
                        App.State.PremiumBoni.CheckIfGPIsAdjusted();
                        App.SaveGameState();
                        GuiBase.ShowToast("Your god power is increased by " + 20 + " because you beat the 1k challenge!");
                    }
                    if (App.State.Statistic.HasStartedUltimatePetChallenge)
                    {
                        App.State.Statistic.HasStartedUltimatePetChallenge = false;
                        if (App.State.Statistic.FastestUPCallenge <= 0 || App.State.Statistic.FastestUPCallenge > App.State.Statistic.TimeAfterUPCStarted)
                        {
                            App.State.Statistic.FastestUPCallenge = App.State.Statistic.TimeAfterUPCStarted;
                            Leaderboards.SubmitStat(LeaderBoardType.FastestUPCallenge, App.State.Statistic.FastestUPCallenge.ToInt() / 1000, false);
                        }
                        App.State.Statistic.TimeAfterUPCStarted = 0;
                        Statistic expr_71F = App.State.Statistic;
                        expr_71F.UltimatePetChallengesFinished = ++expr_71F.UltimatePetChallengesFinished;
                        App.SaveGameState();
                        GuiBase.ShowToast("You have finished the ultimate pet challenge! The rewards you can get from pet campaigns are increased by 5%!");
                    }
                    if (App.State.Statistic.HasStartedNoRbChallenge)
                    {
                        App.State.Statistic.HasStartedNoRbChallenge = false;
                        if (App.State.Statistic.FastestNoRbCCallenge <= 0 || App.State.Statistic.FastestNoRbCCallenge > App.State.Statistic.TimeAfterNoRbStarted)
                        {
                            App.State.Statistic.FastestNoRbCCallenge = App.State.Statistic.TimeAfterNoRbStarted;
                            Leaderboards.SubmitStat(LeaderBoardType.FastestNRChallenge, App.State.Statistic.FastestNoRbCCallenge.ToInt() / 1000, false);
                        }
                        App.State.Statistic.TimeAfterNoRbStarted = 0;
                        Statistic expr_809 = App.State.Statistic;
                        expr_809.NoRbChallengesFinished = ++expr_809.NoRbChallengesFinished;
                        App.State.PremiumBoni.GodPower += 250;
                        App.State.PremiumBoni.CheckIfGPIsAdjusted();
                        App.SaveGameState();
                        GuiBase.ShowToast("Your god power is increased by " + 250 + " because you beat the no rebirth challenge!");
                    }
                    if (App.State.Statistic.HasStartedUltimateBaalChallenge)
                    {
                        App.State.Statistic.HasStartedUltimateBaalChallenge = false;
                        if (App.State.Statistic.FastestUBCallenge <= 0 || App.State.Statistic.FastestUBCallenge > App.State.Statistic.TimeAfterUBCStarted)
                        {
                            App.State.Statistic.FastestUBCallenge = App.State.Statistic.TimeAfterUBCStarted;
                            if (App.State.ShouldSubmitScore)
                            {
                                long num2 = 0L;
                                long.TryParse((App.State.Statistic.FastestUBCallenge.Double / 1000.0).ToString(), out num2);
                                if (num2 == 0L)
                                {
                                    num2 = App.State.Statistic.FastestUBCallenge.ToLong() / 1000L;
                                }
                                Leaderboards.SubmitStat(LeaderBoardType.FastestUBCallenge, (int)num2, false);
                            }
                        }
                        App.State.Statistic.TimeAfterUBCStarted = 0;
                        Statistic expr_983 = App.State.Statistic;
                        expr_983.UltimateBaalChallengesFinished = ++expr_983.UltimateBaalChallengesFinished;
                        if (App.State.Statistic.MinRebirthsAfterUBC == -1 || App.State.Statistic.MinRebirthsAfterUBC > App.State.Statistic.RebirthsAfterUBC)
                        {
                            App.State.Statistic.MinRebirthsAfterUBC = App.State.Statistic.RebirthsAfterUBC;
                        }
                        App.State.Statistic.RebirthsAfterUBC = 0;
                        App.State.HomePlanet.UltimateBeingsV2[0].IsAvailable = true;
                        Premium premiumBoni = App.State.PremiumBoni;
                        App.State.PremiumBoni = Premium.FromString(App.State.Statistic.PremiumStatsBeforeUBCChallenge);
                        App.State.PremiumBoni.AddPremiumAfterChallenge(premiumBoni);
                        App.State.Statistic.PremiumStatsBeforeUBCChallenge = string.Empty;
                        App.State.Clones.AbsoluteMaximum = App.State.Statistic.AbsoluteMaxClonesBeforeUBCChallenge.ToInt();
                        App.State.Clones.MaxShadowClones = App.State.Statistic.MaxClonesBeforeUBCChallenge.ToInt();
                        App.State.PremiumBoni.GodPower  += 100;
                        App.State.PremiumBoni.CheckIfGPIsAdjusted();
                        App.SaveGameState();
                        GuiBase.ShowToast("Your god power is increased by 100 because you beat the ultimate baal challenge!");
                    }
                    if (App.State.Statistic.HasStartedArtyChallenge)
                    {
                        App.State.Statistic.HasStartedArtyChallenge = false;
                        long num3 = 0L;
                        if (App.State.Statistic.FastestUACallenge <= 0 || App.State.Statistic.FastestUACallenge > App.State.Statistic.TimeAfterUACStarted)
                        {
                            App.State.Statistic.FastestUACallenge = App.State.Statistic.TimeAfterUACStarted;
                            num3 = (long)(App.State.Statistic.FastestUACallenge.Double / 1000.0);
                            if (App.State.ShouldSubmitScore)
                            {
                                if (num3 == 0L)
                                {
                                    num3 = App.State.Statistic.FastestUACallenge.ToLong() / 1000L;
                                }
                                if (num3 > 2000000L || App.State.PremiumBoni.HasPurchasedGodPowerOnce)
                                {
                                    Leaderboards.SubmitStat(LeaderBoardType.FastestUACallenge, (int)num3, false);
                                }
                            }
                        }
                        else
                        {
                            num3 = (long)(App.State.Statistic.TimeAfterUACStarted.Double / 1000.0);
                        }
                        App.State.Statistic.TimeAfterUACStarted = 0;
                        Statistic expr_C4C = App.State.Statistic;
                        expr_C4C.ArtyChallengesFinished = ++expr_C4C.ArtyChallengesFinished;
                        App.State.HomePlanet.IsCreated  = true;
                        if (App.State.HomePlanet.UpgradeLevelArtyChallenge > App.State.HomePlanet.UpgradeLevel)
                        {
                            App.State.HomePlanet.UpgradeLevel = App.State.HomePlanet.UpgradeLevelArtyChallenge;
                        }
                        if (App.State.Statistic.UniverseChallengesFinished > 0 && App.State.HomePlanet.UpgradeLevel < App.State.Statistic.UniverseChallengesFinished + 5)
                        {
                            App.State.HomePlanet.UpgradeLevel = App.State.Statistic.UniverseChallengesFinished + 5;
                        }
                        App.State.HomePlanet.UpgradeLevelArtyChallenge = 0;
                        foreach (UltimateBeing current in App.State.HomePlanet.UltimateBeings)
                        {
                            if (current.Tier <= App.State.HomePlanet.UpgradeLevel)
                            {
                                current.IsAvailable = true;
                            }
                        }
                        App.State.HomePlanet.UltimateBeingsV2[0].IsAvailable = true;
                        if (App.State.Statistic.MinRebirthsAfterUAC <= 0 || App.State.Statistic.MinRebirthsAfterUAC > App.State.Statistic.RebirthsAfterUAC)
                        {
                            App.State.Statistic.MinRebirthsAfterUAC = App.State.Statistic.RebirthsAfterUAC;
                        }
                        App.State.Statistic.RebirthsAfterUAC = 0;
                        Premium premiumBoni2 = App.State.PremiumBoni;
                        App.State.PremiumBoni = Premium.FromString(App.State.Statistic.PremiumStatsBeforeUBCChallenge);
                        App.State.PremiumBoni.AddPremiumAfterChallenge(premiumBoni2);
                        App.State.Statistic.PremiumStatsBeforeUBCChallenge = string.Empty;
                        App.State.Statistic.HighestGodInUAC = 0;
                        App.State.Clones.AbsoluteMaximum    = App.State.Statistic.AbsoluteMaxClonesBeforeUBCChallenge.ToInt();
                        App.State.Clones.MaxShadowClones    = App.State.Statistic.MaxClonesBeforeUBCChallenge.ToInt();
                        string[] array = App.State.Statistic.SkillUsageCountBeforeUAC.Split(new char[]
                        {
                            ','
                        });
                        for (int i = 0; i < array.Length; i++)
                        {
                            int num4 = 0;
                            int.TryParse(array[i], out num4);
                            if (App.State.AllSkills.Count > i)
                            {
                                App.State.AllSkills[i].Extension.UsageCount += (long)num4;
                            }
                        }
                        App.State.Statistic.SkillUsageCountBeforeUAC = string.Empty;
                        App.State.PremiumBoni.GodPower += 200;
                        App.State.PremiumBoni.CheckIfGPIsAdjusted();
                        App.SaveGameState();
                        if (num3 < 2000000L)
                        {
                            GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nHowever your time doesn't seem to be legit, you won't get the Pet Token Reward.\nIf you really beat the challenge in this time without cheating, please report to [email protected], so I can look at it.");
                        }
                        else if (App.State.Statistic.ArtyChallengesFinished == 1)
                        {
                            GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nYour god power is increased by 200, you unlocked the turtle with the 'Arty was here' sign and you received the turtle pet!");
                        }
                        else if (App.State.Statistic.ArtyChallengesFinished == 2)
                        {
                            Premium expr_1032 = App.State.PremiumBoni;
                            expr_1032.PetToken = ++expr_1032.PetToken;
                            GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nYour god power is increased by 200, and you received a pet token!");
                        }
                    }
                    App.State.PrinnyBaal.IsUnlocked = true;
                }
            }
            Log.Info("CurrentHealth: " + this.CurrentHealth);
        }
Пример #2
0
        public void UpdateDuration(long ms)
        {
            if (this.ShadowCloneCount == 0)
            {
                return;
            }
            this.CurrentDuration += ms * (long)this.ShadowCloneCount.ToInt();
            int num = this.DurationInMS(1);

            if (this.CurrentDuration > (long)num)
            {
                this.CurrentDuration = 0L;
                CDouble cDouble = 0;
                if (App.State.GameSettings.IgnoreCloneCountOn)
                {
                    cDouble = App.State.GameSettings.TrainIgnoreCount;
                }
                if (cDouble > this.ShadowCloneCount)
                {
                    cDouble = this.ShadowCloneCount;
                }
                bool flag  = true;
                int  value = App.State.GameSettings.StopClonesAtSkills;
                bool flag2 = App.State.GameSettings.IsStopAtOnSkills;
                if (this is Training)
                {
                    value = App.State.GameSettings.StopClonesAtTrainings;
                    flag2 = App.State.GameSettings.IsStopAtOnTrainings;
                }
                if (this.ShadowCloneCount > cDouble && this.Level >= value && flag2)
                {
                    flag = false;
                    CDouble cDouble2 = this.ShadowCloneCount;
                    if (!App.State.GameSettings.UseStopAt)
                    {
                        if (this.checkNext() || !App.State.PremiumBoni.ImprovedNextAt)
                        {
                            cDouble2 -= cDouble;
                            this.RemoveCloneCount(cDouble2);
                            if (this is Training)
                            {
                                Training training = App.State.AllTrainings.FirstOrDefault((Training x) => x.EnumValue == this.EnumValue + 1);
                                if (training != null && training.IsAvailable)
                                {
                                    training.AddCloneCount(cDouble2);
                                }
                            }
                            else if (this is Skill)
                            {
                                Skill skill = App.State.AllSkills.FirstOrDefault((Skill x) => x.EnumValue == this.EnumValue + 1);
                                if (skill != null && skill.IsAvailable)
                                {
                                    skill.AddCloneCount(cDouble2);
                                }
                            }
                        }
                        else
                        {
                            flag = true;
                        }
                    }
                    else
                    {
                        cDouble2 -= cDouble;
                        this.RemoveCloneCount(cDouble2);
                    }
                }
                if (flag)
                {
                    this.Level = ++this.Level;
                    if (this is Training)
                    {
                        App.State.PhysicalPowerBase += this.PowerGain;
                        Statistic expr_255 = App.State.Statistic;
                        expr_255.TotalTrainingLevels = ++expr_255.TotalTrainingLevels;
                    }
                    else if (this is Skill)
                    {
                        App.State.MysticPowerBase += this.PowerGain;
                        Statistic expr_29A = App.State.Statistic;
                        expr_29A.TotalSkillLevels = ++expr_29A.TotalSkillLevels;
                    }
                }
            }
        }
Пример #3
0
        internal string Fight(GameState gameState, int bpAtk, int bpDef, int powersurge, CDouble shadowCloneCount, bool crystalFactoryAttack = false)
        {
            gameState.HomePlanet.BaalPower -= bpAtk + bpDef;
            int           num           = gameState.ClonesPlanetMod + bpAtk * 50 + powersurge;
            int           num2          = gameState.ClonesPlanetMod + bpDef * 50 + powersurge;
            StringBuilder stringBuilder = new StringBuilder();
            int           num3          = 1;
            int           num4          = 0;

            if (crystalFactoryAttack)
            {
                this.crystalFightBuilder = new StringBuilder();
                CultureInfo currentCulture = CultureInfo.CurrentCulture;
                this.crystalFightBuilder.Append(DateTime.Now.ToString(currentCulture) + "\n");
                if (shadowCloneCount == 0)
                {
                    this.crystalFightBuilder.Append(this.Name + " attacked your crystal factory and you lost the fight!");
                }
            }
            while (gameState.CurrentHealth > 0 && shadowCloneCount > 0 && this.HPPercent > 0.0)
            {
                int num5 = 7000;
                if (this.Tier == 2)
                {
                    num5 = 16000;
                }
                else if (this.Tier == 3)
                {
                    num5 = 25000;
                }
                else if (this.Tier == 4)
                {
                    num5 = 40000;
                }
                else if (this.Tier == 5)
                {
                    num5 = 60000;
                }
                int    num6  = this.skillOrder[(num3 - 1) % 10];
                string value = this.SkillName1;
                if (num6 == 3)
                {
                    num5 *= 4;
                    value = this.SkillName3;
                }
                else if (num6 == 2)
                {
                    num5 *= 2;
                    value = this.SkillName2;
                }
                long num7 = (long)UnityEngine.Random.Range((int)((double)num5 * 0.9), (int)((double)num5 * 1.1));
                if (crystalFactoryAttack && gameState.PremiumBoni.CrystalBonusDefender > 0)
                {
                    num7 = (num7 * (100 - gameState.PremiumBoni.CrystalBonusDefender) / 100).ToLong();
                }
                int num8 = (int)((double)(num7 / 4000L) - shadowCloneCount.Double / 40000.0);
                if (num8 < 0)
                {
                    num8 = 0;
                }
                num7 = num7 * 100L / (long)num2;
                if (num7 >= shadowCloneCount)
                {
                    num7 = (long)shadowCloneCount.ToInt();
                    num8 = 100;
                }
                if (crystalFactoryAttack)
                {
                    gameState.Ext.Factory.DefenderClones -= num7;
                }
                else
                {
                    gameState.CurrentHealth -= gameState.MaxHealth / 100 * num8;
                    gameState.HomePlanet.ShadowCloneCount -= num7;
                }
                shadowCloneCount -= (int)num7;
                num4             += (int)num7;
                shadowCloneCount.Round();
                gameState.Clones.RemoveUsedShadowClones((int)num7);
                gameState.Clones.Count                    -= (int)num7;
                gameState.Clones.TotalClonesKilled        += (int)num7;
                gameState.Statistic.TotalShadowClonesDied += num7;
                stringBuilder.Append(num3).Append(". ").Append(this.Name).Append(" uses ").Append(value).Append(", kills ").Append(num7).Append(" Shadow Clones and deals ").Append(num8).Append(" % damage to your hp.\n");
                if (gameState.CurrentHealth == 0 || shadowCloneCount <= 0)
                {
                    stringBuilder.Append("You lost the fight!");
                    this.crystalFightBuilder.Append(this.Name + " attacked your crystal factory and your defender clones lost the fight!");
                }
                else
                {
                    double num9 = shadowCloneCount.Double / 20000.0 / (double)this.Tier + 1.0;
                    if (shadowCloneCount <= 100000)
                    {
                        num9 *= 2.0;
                    }
                    else if (shadowCloneCount <= 150000)
                    {
                        num9 *= 1.8;
                    }
                    else if (shadowCloneCount <= 200000)
                    {
                        num9 *= 1.6;
                    }
                    else if (shadowCloneCount <= 250000)
                    {
                        num9 *= 1.4;
                    }
                    else if (shadowCloneCount <= 300000)
                    {
                        num9 *= 1.2;
                    }
                    num9 = num9 * (double)num / 100.0;
                    string str = "Shadow Clones Power Charge";
                    if (num6 != 1)
                    {
                        num9 *= 1.5;
                        str   = "Ultimate Shadow Clone Blast";
                    }
                    stringBuilder.Append("You used " + str + " and dealt ").Append((int)num9).Append(" % damage to ").Append(this.Name).Append("\n");
                    if (num9 > this.HPPercent)
                    {
                        num9 = this.HPPercent;
                    }
                    this.HPPercent -= num9;
                    if (this.HPPercent <= 0.0)
                    {
                        Statistic expr_585 = gameState.Statistic;
                        expr_585.UBsDefeated = ++expr_585.UBsDefeated;
                        gameState.HomePlanet.UBMultiplier += this.NextMultiplier;
                        this.TimesDefeated++;
                        gameState.HomePlanet.RecalculateMultiplier();
                        CDouble cDouble = 100000;
                        foreach (Fight current in gameState.AllFights)
                        {
                            if (current.IsAvailable)
                            {
                                cDouble *= 2;
                            }
                        }
                        if (gameState.Generator != null && gameState.Generator.IsBuilt)
                        {
                            cDouble += gameState.Generator.DivinitySec * 3600;
                        }
                        cDouble          = cDouble * this.Tier / 2;
                        gameState.Money += cDouble;
                        this.crystalFightBuilder.Append(string.Concat(new object[]
                        {
                            this.Name,
                            " attacked your defender clones and you won the fight!\nYou lost a total of ",
                            num4,
                            " clones and gained "
                        })).Append(cDouble.ToGuiText(true)).Append(" Divinity, your Planet Stat Multiplier increased by ").Append(this.NextMultiplier.ToGuiText(true)).Append(" %");
                        stringBuilder.Append("You won the fight!\nYou gained ").Append(cDouble.ToGuiText(true)).Append(" Divinity, your Planet Stat Multiplier increased by ").Append(this.NextMultiplier.ToGuiText(true)).Append(" %");
                        bool flag = false;
                        if (this.TimesDefeated % 5 == 0 && this.Tier == 1)
                        {
                            flag = true;
                        }
                        else if ((this.TimesDefeated % 5 == 0 && this.Tier == 2) || (this.TimesDefeated % 5 == 3 && this.Tier == 2))
                        {
                            flag = true;
                        }
                        else if (this.TimesDefeated % 5 != 0 && this.Tier == 3 && this.TimesDefeated % 5 != 3 && this.Tier == 3)
                        {
                            flag = true;
                        }
                        else if (this.TimesDefeated % 5 != 3 && this.Tier == 4)
                        {
                            flag = true;
                        }
                        else if (this.Tier == 5)
                        {
                            flag = true;
                        }
                        Log.Info(string.Concat(new object[]
                        {
                            "times defeated: ",
                            this.TimesDefeated,
                            ", drop GP = ",
                            flag
                        }));
                        if (flag)
                        {
                            gameState.PremiumBoni.GodPower++;
                            gameState.HomePlanet.TotalGainedGodPower++;
                            gameState.PremiumBoni.CheckIfGPIsAdjusted();
                            stringBuilder.Append(" and got 1 God Power!");
                            this.crystalFightBuilder.Append("\nYou received 1 God Power.");
                        }
                        if (gameState.IsCrystalFactoryAvailable)
                        {
                            CDouble cDouble2 = this.Tier * 100;
                            gameState.Ext.Factory.Energy += cDouble2;
                            stringBuilder.Append("\nYour crystal factory received " + cDouble2.GuiText + " energy!");
                            this.crystalFightBuilder.Append("\nYour crystal factory received " + cDouble2.GuiText + " energy!");
                        }
                        gameState.HomePlanet.InitUBMultipliers();
                    }
                }
                num3++;
            }
            if (!crystalFactoryAttack)
            {
                return(stringBuilder.ToString());
            }
            return(this.crystalFightBuilder.ToString());
        }
Пример #4
0
 public new void UpdateDuration(long ms)
 {
     if (this.Upgrade.UpdateDuration(ms))
     {
         this.AddUpgradeLevel();
     }
     if (App.State == null || this.ShadowCloneCount == 0)
     {
         return;
     }
     if (this.Level >= this.StopAt && this.StopAt != 0)
     {
         CDouble shadowCloneCount = this.ShadowCloneCount;
         App.State.Clones.RemoveUsedShadowClones(shadowCloneCount);
         this.ShadowCloneCount = 0;
         if (this.Upgrade.StopAt > 0 && this.Upgrade.IsAvailable)
         {
             this.Upgrade.AddCloneCount(shadowCloneCount);
         }
         else
         {
             Monument monument = App.State.AllMonuments.FirstOrDefault((Monument x) => x.TypeEnum == this.TypeEnum + 1);
             if (monument != null && monument.StopAt > 0)
             {
                 monument.AddCloneCount(shadowCloneCount);
             }
         }
         return;
     }
     if (!this.IsPaid)
     {
         bool          flag          = false;
         StringBuilder stringBuilder = new StringBuilder("You still need:\n");
         using (List <CreationCost> .Enumerator enumerator = this.RequiredCreations(this.Level).GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 CreationCost cost     = enumerator.Current;
                 Creation     creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                 cost.CountNeeded.Round();
                 creation.count.Round();
                 if (cost.CountNeeded > creation.Count)
                 {
                     if (App.State.IsBuyUnlocked && App.State.GameSettings.AutoBuyCreationsForMonuments && creation.CanBuy)
                     {
                         CDouble cDouble   = cost.CountNeeded - creation.Count;
                         CDouble rightSide = cDouble * creation.BuyCost * (120 - App.State.PremiumBoni.AutoBuyCostReduction) / 100;
                         if (App.State.Money >= rightSide)
                         {
                             App.State.Money -= rightSide;
                             creation.count  += cDouble;
                             App.State.Statistic.TotalMoneySpent += rightSide;
                         }
                         else
                         {
                             flag = true;
                             stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n");
                         }
                     }
                     else
                     {
                         flag = true;
                         stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n");
                     }
                 }
             }
         }
         if (flag)
         {
             stringBuilder.Append("to build ").Append(this.Name).ToString();
             if (!App.State.GameSettings.StickyClones)
             {
                 GuiBase.ShowToast(stringBuilder.ToString());
                 App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount);
                 this.ShadowCloneCount = 0;
             }
             else
             {
                 this.MissingItems = "\n\n" + stringBuilder.ToString();
             }
             return;
         }
         using (List <CreationCost> .Enumerator enumerator2 = this.RequiredCreations(this.Level).GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 CreationCost cost      = enumerator2.Current;
                 Creation     creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                 creation2.Count -= cost.CountNeeded;
             }
         }
         this.IsPaid = true;
     }
     this.MissingItems     = string.Empty;
     this.CurrentDuration += (ms * (long)this.ShadowCloneCount.ToInt() * (long)App.State.PremiumBoni.MonumentBuildTimeDivider * (100 + App.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100).ToLong();
     if (this.CurrentDuration > this.DurationInMS(1))
     {
         this.CurrentDuration = 0L;
         this.Level           = ++this.Level;
         this.IsPaid          = false;
         Statistic expr_4D4 = App.State.Statistic;
         expr_4D4.MonumentsCreated = ++expr_4D4.MonumentsCreated;
         Leaderboards.SubmitStat(LeaderBoardType.Monuments, App.State.Statistic.MonumentsCreated.ToInt(), false);
         if (this.TypeEnum == Monument.MonumentType.temple_of_god && this.Level == 1)
         {
             GuiBase.ShowContentUnlocked("You can now build a divinity generator!");
         }
         this.AddStatBoni();
         if (App.State.GameSettings.StopMonumentBuilding)
         {
             App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount);
             this.ShadowCloneCount = 0;
         }
         if (this.TypeEnum == Monument.MonumentType.temple_of_god)
         {
             App.State.Generator.IsAvailable = true;
         }
     }
 }
Пример #5
0
        internal static Statistic FromString(string base64String)
        {
            if (string.IsNullOrEmpty(base64String))
            {
                Log.Error("Statistic.FromString with empty value!");
                return(new Statistic());
            }
            string[]  parts     = Conv.StringPartsFromBase64(base64String, "Statistic");
            Statistic statistic = new Statistic();

            statistic.TimePlayed               = Conv.getLongFromParts(parts, "a");
            statistic.TimeOffline              = Conv.getLongFromParts(parts, "b");
            statistic.TotalTrainingLevels      = new CDouble(Conv.getStringFromParts(parts, "c"));
            statistic.TotalSkillLevels         = new CDouble(Conv.getStringFromParts(parts, "d"));
            statistic.TotalEnemiesDefeated     = new CDouble(Conv.getStringFromParts(parts, "e"));
            statistic.TotalCreations           = new CDouble(Conv.getStringFromParts(parts, "f"));
            statistic.TotalShadowClonesCreated = new CDouble(Conv.getStringFromParts(parts, "g"));
            statistic.TotalShadowClonesDied    = new CDouble(Conv.getStringFromParts(parts, "h"));
            statistic.TotalGodsDefeated        = new CDouble(Conv.getStringFromParts(parts, "i"));
            statistic.TotalMoneySpent          = new CDouble(Conv.getStringFromParts(parts, "j"));
            statistic.TotalRebirths            = Conv.getCDoubleFromParts(parts, "k", false);
            statistic.MonumentsCreated         = Conv.getCDoubleFromParts(parts, "l", false);
            statistic.TotalAchievements        = Conv.getCDoubleFromParts(parts, "m", false);
            statistic.HighestGodDefeated       = Conv.getCDoubleFromParts(parts, "n", false);
            statistic.TotalUpgrades            = Conv.getCDoubleFromParts(parts, "o", false);
            statistic.MostDefeatedShadowClones = Conv.getCDoubleFromParts(parts, "p", false);
            statistic.TimePlayedSinceRebirth   = Conv.getLongFromParts(parts, "q");
            statistic.TBSScore        = Conv.getCDoubleFromParts(parts, "r", false);
            statistic.UBsDefeated     = Conv.getCDoubleFromParts(parts, "s", false);
            statistic.GodlyShootScore = Conv.getCDoubleFromParts(parts, "t", false);
            statistic.TotalPowersurge = Conv.getCDoubleFromParts(parts, "u", false);
            statistic.HasStartedDoubleRebirthChallenge = Conv.getStringFromParts(parts, "v").ToLower().Equals("true");
            statistic.DoubleRebirthChallengesFinished  = Conv.getCDoubleFromParts(parts, "w", false);
            statistic.TimeAfterDRCStarted                 = Conv.getCDoubleFromParts(parts, "x", false);
            statistic.FastestDRCallenge                   = Conv.getCDoubleFromParts(parts, "y", false);
            statistic.HasStartedUltimateBaalChallenge     = Conv.getStringFromParts(parts, "z").ToLower().Equals("true");
            statistic.UltimateBaalChallengesFinished      = Conv.getCDoubleFromParts(parts, "A", false);
            statistic.TimeAfterUBCStarted                 = Conv.getCDoubleFromParts(parts, "B", false);
            statistic.FastestUBCallenge                   = Conv.getCDoubleFromParts(parts, "C", false);
            statistic.PremiumStatsBeforeUBCChallenge      = Conv.getStringFromParts(parts, "D");
            statistic.AbsoluteMaxClonesBeforeUBCChallenge = Conv.getCDoubleFromParts(parts, "E", false);
            statistic.MaxClonesBeforeUBCChallenge         = Conv.getCDoubleFromParts(parts, "F", false);
            statistic.HasStartedUniverseChallenge         = Conv.getStringFromParts(parts, "G").ToLower().Equals("true");
            statistic.UniverseChallengesFinished          = Conv.getCDoubleFromParts(parts, "H", false);
            statistic.TimeAfterUUCStarted                 = Conv.getCDoubleFromParts(parts, "I", false);
            statistic.FastestUUCallenge                   = Conv.getCDoubleFromParts(parts, "J", false);
            statistic.HasStartedArtyChallenge             = Conv.getStringFromParts(parts, "K").ToLower().Equals("true");
            statistic.ArtyChallengesFinished              = Conv.getCDoubleFromParts(parts, "L", false);
            statistic.TimeAfterUACStarted                 = Conv.getCDoubleFromParts(parts, "M", false);
            statistic.FastestUACallenge                   = Conv.getCDoubleFromParts(parts, "N", false);
            statistic.RebirthsAfterUAC         = Conv.getCDoubleFromParts(parts, "O", false);
            statistic.SkillUsageCountBeforeUAC = Conv.getStringFromParts(parts, "P");
            statistic.RebirthsAfterUBC         = Conv.getCDoubleFromParts(parts, "Q", false);
            statistic.HighestGodInUAC          = Conv.getCDoubleFromParts(parts, "R", false);
            statistic.MinRebirthsAfterUAC      = Conv.getCDoubleFromParts(parts, "S", false);
            statistic.MinRebirthsAfterUBC      = Conv.getCDoubleFromParts(parts, "T", false);
            statistic.CountRebirthsInUBC       = Conv.getStringFromParts(parts, "U").ToLower().Equals("true");
            statistic.RandomDividerLastRebirth = Conv.getCDoubleFromParts(parts, "W", false);
            string stringFromParts = Conv.getStringFromParts(parts, "X");

            string[] array = stringFromParts.Split(new char[]
            {
                '&'
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string text = array2[i];
                if (!string.IsNullOrEmpty(text))
                {
                    statistic.Last5RebirthTimes.Add(new CDouble(text));
                }
            }
            statistic.HasStartedAchievementChallenge = Conv.getStringFromParts(parts, NS.n1.Nr()).ToLower().Equals("true");
            statistic.AchievementChallengesFinished  = Conv.getCDoubleFromParts(parts, NS.n2.Nr(), false);
            statistic.HasStarted1kChallenge          = Conv.getStringFromParts(parts, NS.n3.Nr()).ToLower().Equals("true");
            statistic.OnekChallengesFinished         = Conv.getCDoubleFromParts(parts, NS.n4.Nr(), false);
            statistic.TimeAfter1KCStarted            = Conv.getCDoubleFromParts(parts, NS.n6.Nr(), false);
            statistic.Fastest1KCCallenge             = Conv.getCDoubleFromParts(parts, NS.n7.Nr(), false);
            statistic.CreatorBeaten       = Conv.getStringFromParts(parts, NS.n8.Nr()).ToLower().Equals("true");
            statistic.GodlyShootScoreBoss = Conv.getCDoubleFromParts(parts, NS.n9.Nr(), false);
            stringFromParts = Conv.getStringFromParts(parts, NS.n10.Nr());
            array           = stringFromParts.Split(new char[]
            {
                '&'
            });
            string[] array3 = array;
            for (int j = 0; j < array3.Length; j++)
            {
                string value = array3[j];
                if (!string.IsNullOrEmpty(value))
                {
                    statistic.ReachedAndroidAchievements.Add((SteamAndroidAchievement)Conv.StringToInt(value));
                }
            }
            statistic.GPFromBlackHole                = Conv.getCDoubleFromParts(parts, NS.n11.Nr(), false);
            statistic.GPFromBlackHoleUpgrade         = Conv.getCDoubleFromParts(parts, NS.n12.Nr(), false);
            statistic.AfkyClonesKilled               = Conv.getCDoubleFromParts(parts, NS.n13.Nr(), false);
            statistic.BlackHoleGPTimer               = Conv.getCDoubleFromParts(parts, NS.n14.Nr(), false);
            statistic.AfkyGodPower                   = Conv.getCDoubleFromParts(parts, NS.n15.Nr(), false);
            statistic.HasStartedNoRbChallenge        = Conv.getStringFromParts(parts, NS.n16.Nr()).ToLower().Equals("true");
            statistic.NoRbChallengesFinished         = Conv.getCDoubleFromParts(parts, NS.n17.Nr(), false);
            statistic.TimeAfterNoRbStarted           = Conv.getCDoubleFromParts(parts, NS.n18.Nr(), false);
            statistic.FastestNoRbCCallenge           = Conv.getCDoubleFromParts(parts, NS.n19.Nr(), false);
            statistic.HasReceivedPresent             = Conv.getStringFromParts(parts, NS.n20.Nr()).ToLower().Equals("true");
            statistic.GodDefeatedBeforeRebirth       = Conv.getStringFromParts(parts, NS.n21.Nr());
            statistic.TimeUntilNextChocolate         = Conv.getLongFromParts(parts, NS.n22.Nr());
            statistic.PresentCount                   = Conv.getCDoubleFromParts(parts, NS.n23.Nr(), false);
            statistic.HasStartedBlackHoleChallenge   = Conv.getStringFromParts(parts, NS.n24.Nr()).ToLower().Equals("true");
            statistic.BlackHoleChallengesFinished    = Conv.getCDoubleFromParts(parts, NS.n25.Nr(), false);
            statistic.TimeAfterBHCStarted            = Conv.getCDoubleFromParts(parts, NS.n26.Nr(), false);
            statistic.FastestBHCallenge              = Conv.getCDoubleFromParts(parts, NS.n27.Nr(), false);
            statistic.HasStartedUltimatePetChallenge = Conv.getStringFromParts(parts, NS.n28.Nr()).ToLower().Equals("true");
            statistic.UltimatePetChallengesFinished  = Conv.getCDoubleFromParts(parts, NS.n29.Nr(), false);
            statistic.TimeAfterUPCStarted            = Conv.getCDoubleFromParts(parts, NS.n30.Nr(), false);
            statistic.FastestUPCallenge              = Conv.getCDoubleFromParts(parts, NS.n31.Nr(), false);
            return(statistic);
        }