public bool GetHit()
 {
     this.CurrentHP = --this.CurrentHP;
     return(this.CurrentHP <= 0);
 }
Exemplo n.º 2
0
        //[DebuggerHidden]
        //private IEnumerator Calculate(long timeOfflineSec)
        //{
        //    OfflineCalc.<Calculate>c__Iterator0 <Calculate>c__Iterator = new OfflineCalc.<Calculate>c__Iterator0();
        //    <Calculate>c__Iterator.timeOfflineSec = timeOfflineSec;
        //    <Calculate>c__Iterator.$this = this;
        //    return <Calculate>c__Iterator;
        //}

        private void CalcDivGained(StringBuilder infoBuilder, long timeMS)
        {
            bool    flag    = false;
            CDouble cDouble = new CDouble();

            foreach (Fight current in this.State.AllFights)
            {
                if (current.ShadowCloneCount > 0)
                {
                    int     value    = current.ShadowCloneCount.ToInt();
                    CDouble leftSide = (this.State.CloneAttack + 10) * value;
                    CDouble cDouble2 = 30 * (leftSide - current.Defense) / 5000 + 1;
                    if (cDouble2 > 0)
                    {
                        double num;
                        if (cDouble2 >= current.MaxHealth)
                        {
                            num = 33.33333333;
                        }
                        else
                        {
                            double num2 = (double)(current.MaxHealth * 64 / cDouble2).ToInt() / 64.0;
                            double num3 = num2 * 30.0 / 1000.0;
                            num = 1.0 / num3;
                        }
                        long value2 = (long)((double)(timeMS / 1000L) * num);
                        current.Level += value2;
                        this.State.BattlePowerBase += current.PowerGain * value2;
                        this.State.Statistic.TotalEnemiesDefeated += value2;
                        infoBuilder.Append("- defeated ").Append(value2).Append(" x ").Append(current.Name).Append("\n");
                        cDouble += current.MoneyGain * value2;
                        flag     = true;
                    }
                }
            }
            if (flag)
            {
                this.State.Money += cDouble;
                infoBuilder.Append("\n- divinity gained: ").Append(cDouble.ToGuiText(true)).Append(" \n");
            }
            if (this.State.Generator.FilledCapacity > 0)
            {
                CDouble  cDouble3   = this.State.Generator.ConvertSec * timeMS / 1000;
                CDouble  rightSide  = 0;
                CDouble  rightSide2 = timeMS * (long)this.State.ClonesDifGenMod / 20L;
                CDouble  cDouble4   = this.State.Generator.ShadowCloneCount * rightSide2;
                Creation creation   = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Stone);
                if (cDouble4 > creation.Count)
                {
                    cDouble4 = creation.Count;
                }
                CDouble cDouble5  = cDouble4 * creation.BuyCost;
                CDouble leftSide2 = 0;
                if (cDouble5 >= cDouble3)
                {
                    leftSide2 = cDouble5 - cDouble3;
                    cDouble5  = cDouble3;
                    cDouble4 -= leftSide2 / creation.BuyCost;
                }
                else
                {
                    rightSide = cDouble3 - cDouble5;
                }
                creation.Count -= cDouble4;
                if (this.State.Generator.FilledCapacity >= rightSide)
                {
                    this.State.Generator.FilledCapacity -= rightSide;
                }
                else
                {
                    rightSide = this.State.Generator.FilledCapacity;
                    this.State.Generator.FilledCapacity = 0;
                }
                cDouble3 = cDouble5 + rightSide;
                CDouble cDouble6 = cDouble3 * this.State.Generator.DivinityEachCapacity;
                if (leftSide2 > 0)
                {
                    int     num4      = this.State.Generator.ShadowCloneCount.ToInt() - this.State.Generator.GetBreakEvenWorker(creation.BuyCost);
                    CDouble leftSide3 = num4 / 5000;
                    cDouble6 = cDouble6 * (leftSide3 + 100) / 100;
                }
                string value3 = string.Empty;
                if (cDouble4 > 0)
                {
                    value3 = " and used up " + cDouble4.ToGuiText(true) + " stones.";
                }
                infoBuilder.Append("- generated divinity: ").Append(cDouble6.ToGuiText(true)).Append(value3).Append(" \n\n");
                this.State.Money += cDouble6;
            }
        }
Exemplo n.º 3
0
        private static void addSpendPointsButton(ref int marginTop, KredOffersUi.Reward reward, string text, CDouble pointCost, string description = "")
        {
            GUI.Label(new Rect(GuiBase.Width(305f), GuiBase.Height((float)(marginTop + 5)), GuiBase.Width(400f), GuiBase.Height(30f)), new GUIContent(text, description));
            App.State.Ext.AdPoints.Round();
            if (GUI.Button(new Rect(GuiBase.Width(725f), GuiBase.Height((float)marginTop), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Buy for " + pointCost.ToInt())))
            {
                if (App.State.Ext.AdPoints >= pointCost)
                {
                    switch (reward)
                    {
                    case KredOffersUi.Reward.physical:
                        App.State.Multiplier.DrawMultiPhysical = App.State.Multiplier.DrawMultiPhysical * 1.1;
                        GuiBase.ShowToast("Your Physical was increased by 10%!");
                        break;

                    case KredOffersUi.Reward.mystic:
                        App.State.Multiplier.DrawMultiMystic = App.State.Multiplier.DrawMultiMystic * 1.1;
                        GuiBase.ShowToast("Your Mystic was increased by 10%!");
                        break;

                    case KredOffersUi.Reward.battle:
                        App.State.Multiplier.DrawMultiBattle = App.State.Multiplier.DrawMultiBattle * 1.1;
                        GuiBase.ShowToast("Your Battle was increased by 10%!");
                        break;

                    case KredOffersUi.Reward.creating:
                        App.State.Multiplier.DrawMultiCreating = App.State.Multiplier.DrawMultiCreating * 1.1;
                        GuiBase.ShowToast("Your Creating was increased by 10%!");
                        break;

                    case KredOffersUi.Reward.all:
                        App.State.Multiplier.DrawMultiPhysical = App.State.Multiplier.DrawMultiPhysical * 1.1;
                        App.State.Multiplier.DrawMultiMystic   = App.State.Multiplier.DrawMultiMystic * 1.1;
                        App.State.Multiplier.DrawMultiCreating = App.State.Multiplier.DrawMultiCreating * 1.1;
                        App.State.Multiplier.DrawMultiBattle   = App.State.Multiplier.DrawMultiBattle * 1.1;
                        GuiBase.ShowToast("All 4 stats were increased by 10%!");
                        break;

                    case KredOffersUi.Reward.div1:
                    {
                        CDouble cDouble = App.State.DivinityGainSec(true) * 1200;
                        App.State.Money += cDouble;
                        GuiBase.ShowToast("You received " + cDouble.GuiText + " divinity!");
                        break;
                    }

                    case KredOffersUi.Reward.div2:
                    {
                        CDouble cDouble = App.State.DivinityGainSec(true) * 1200 * 2.5;
                        App.State.Money += cDouble;
                        GuiBase.ShowToast("You received " + cDouble.GuiText + " divinity!");
                        break;
                    }

                    case KredOffersUi.Reward.creatingSpeed:
                        App.State.CreatingSpeedBoniDuration += 600000L;
                        GuiBase.ShowToast("Your creating speed is increased to 300% for another 10 minutes!");
                        break;

                    case KredOffersUi.Reward.puny:
                    {
                        State2 expr_3A8 = App.State.Ext;
                        expr_3A8.PunyFood = ++expr_3A8.PunyFood;
                        GuiBase.ShowToast("You received one Puny Food!");
                        break;
                    }

                    case KredOffersUi.Reward.strong:
                    {
                        State2 expr_3D1 = App.State.Ext;
                        expr_3D1.StrongFood = ++expr_3D1.StrongFood;
                        GuiBase.ShowToast("You received one Strong Food!");
                        break;
                    }

                    case KredOffersUi.Reward.mighty:
                    {
                        State2 expr_3FA = App.State.Ext;
                        expr_3FA.MightyFood = ++expr_3FA.MightyFood;
                        GuiBase.ShowToast("You received one Mighty Food!");
                        break;
                    }

                    case KredOffersUi.Reward.lucky:
                    {
                        Premium expr_423 = App.State.PremiumBoni;
                        expr_423.LuckyDraws = ++expr_423.LuckyDraws;
                        GuiBase.ShowToast("You received one Lucky Draw!");
                        break;
                    }
                    }
                    App.State.Ext.AdPoints -= pointCost;
                }
                else
                {
                    GuiBase.ShowToast("You don't have enough Ad points!");
                }
            }
            marginTop += 30;
        }
        protected void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
        {
            DivinityGenerator generator = App.State.Generator;

            if (!App.State.Generator.IsBuilt)
            {
                labelStyle.fontSize  = GuiBase.FontSize(16);
                labelStyle.alignment = TextAnchor.UpperCenter;
                GuiBase.CreateProgressBar(marginTop, generator.getPercent(), generator.Name, generator.Description + generator.MissingItems, GuiBase.progressBg, GuiBase.progressFgBlue);
                labelStyle.fontSize = GuiBase.FontSize(18);
                GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + generator.Level, labelStyle);
                GUI.Label(new Rect(GuiBase.Width(330f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + generator.ShadowCloneCount, labelStyle);
                if (GUI.Button(new Rect(GuiBase.Width(470f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
                {
                    generator.AddCloneCount((int)this.ClonesToAdd);
                }
                if (GUI.Button(new Rect(GuiBase.Width(540f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
                {
                    generator.RemoveCloneCount((int)this.ClonesToAdd);
                }
            }
            else if (!DivinityGeneratorUi.AddIsOpen)
            {
                labelStyle.alignment = TextAnchor.UpperCenter;
                marginTop           += 170;
                labelStyle.fontSize  = GuiBase.FontSize(18);
                labelStyle.fontStyle = FontStyle.Bold;
                GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), "Upgrade");
                GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Level", labelStyle);
                GUI.Label(new Rect(GuiBase.Width(280f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Stop At", labelStyle);
                GUI.Label(new Rect(GuiBase.Width(370f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Clones", labelStyle);
                marginTop           += 45;
                labelStyle.fontStyle = FontStyle.Normal;
                foreach (GeneratorUpgrade current in generator.Upgrades)
                {
                    labelStyle.fontSize = GuiBase.FontSize(16);
                    GuiBase.CreateProgressBar(marginTop, current.getPercent(), current.Name, current.Description + current.MissingItems, GuiBase.progressBg, GuiBase.progressFgGreen);
                    labelStyle.fontSize = GuiBase.FontSize(18);
                    GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + current.Level.CommaFormatted, labelStyle);
                    GUI.Label(new Rect(GuiBase.Width(370f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + current.ShadowCloneCount.CommaFormatted, labelStyle);
                    if (App.CurrentPlattform == Plattform.Android)
                    {
                        GeneratorUpgrade up        = current;
                        GUIStyle         textField = Gui.ChosenSkin.textField;
                        if (GUI.Button(new Rect(GuiBase.Width(305f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), up.StopAt + string.Empty, textField))
                        {
                            base.ShowNumberInput("Stop at for " + up.Name + " " + up.Name, up.StopAt, 2147483647, delegate(CDouble x)
                            {
                                up.StopAt = x.ToInt();
                            });
                        }
                    }
                    else
                    {
                        string s = GUI.TextField(new Rect(GuiBase.Width(305f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.StopAt.ToString());
                        int.TryParse(s, out current.StopAt);
                        if (current.StopAt < 0)
                        {
                            current.StopAt = 0;
                        }
                    }
                    if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
                    {
                        current.AddCloneCount((int)this.ClonesToAdd);
                    }
                    if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
                    {
                        current.RemoveCloneCount((int)this.ClonesToAdd);
                    }
                    marginTop += 35;
                }
            }
            else
            {
                for (int i = 1; i < App.State.AllCreations.Count; i++)
                {
                    Creation creation = App.State.AllCreations[i];
                    labelStyle.fontSize = GuiBase.FontSize(16);
                    GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(160f), GuiBase.Height(30f)), new GUIContent(creation.Name, "Capacity for one: " + creation.BuyCost.ToGuiText(true)), labelStyle);
                    GUI.Label(new Rect(GuiBase.Width(180f), GuiBase.Height((float)marginTop), GuiBase.Width(160f), GuiBase.Height(30f)), creation.Count.ToGuiText(true), labelStyle);
                    CDouble cDouble = App.State.GameSettings.DivGenCreatiosToAdd;
                    if (cDouble == 0)
                    {
                        cDouble = 10000;
                    }
                    if (cDouble > creation.Count)
                    {
                        cDouble = creation.Count;
                    }
                    CDouble cDouble2 = cDouble * creation.BuyCost;
                    if (cDouble2 > App.State.Generator.FreeCapacity)
                    {
                        cDouble       = App.State.Generator.FreeCapacity / creation.BuyCost;
                        cDouble.Value = Math.Floor(cDouble.Value);
                        cDouble2      = cDouble * creation.BuyCost;
                    }
                    GUI.Label(new Rect(GuiBase.Width(325f), GuiBase.Height((float)marginTop), GuiBase.Width(160f), GuiBase.Height(30f)), cDouble2.ToGuiText(true), labelStyle);
                    GUIStyle style = GUI.skin.GetStyle("Button");
                    style.fontSize = GuiBase.FontSize(16);
                    if (GUI.Button(new Rect(GuiBase.Width(480f), GuiBase.Height((float)marginTop), GuiBase.Width(130f), GuiBase.Height(30f)), cDouble.ToGuiText(true)) && cDouble > 0)
                    {
                        App.State.Generator.FilledCapacity += cDouble2;
                        creation.Count -= cDouble;
                    }
                    marginTop += 35;
                }
            }
        }
        private void show()
        {
            GUIStyle style = GUI.skin.GetStyle("Label");

            style.alignment = TextAnchor.UpperLeft;
            style.fontSize  = GuiBase.FontSize(16);
            GUI.BeginGroup(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)));
            GUI.Box(new Rect(GuiBase.Width(0f), GuiBase.Height(0f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            this.scrollPosition = GuiBase.TouchScrollView(new Rect(GuiBase.Width(0f), GuiBase.Height(15f), GuiBase.Width(640f), GuiBase.Height(460f)), this.scrollPosition, new Rect(0f, GuiBase.Height(15f), GuiBase.Width(620f), GuiBase.Height((float)this.scrollHeight)));
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height(10f), GuiBase.Width(600f), GuiBase.Height(50f)), new GUIContent("Some stats of your game. All multis will apply when rebirthing and can't be higher than your god multiplier."));
            style.fontStyle = FontStyle.Normal;
            int num = 70;

            if (UpdateStats.TimeLeftForEvent > 0L)
            {
                num = this.AddLine(num, "Time left until next chocolate", Conv.MsToGuiText(App.State.Statistic.TimeUntilNextChocolate, true), "This event will end in: " + Conv.MsToGuiText(UpdateStats.TimeLeftForEvent, false), 30);
            }
            num  = this.AddLine(num, "Time played since rebirth", Conv.MsToGuiText(App.State.Statistic.TimePlayedSinceRebirth, true), "You need 1 hour to reach 100% rebirth multiplier. After that every 30 minutes played will increase your total rebirth multiplier by 1%. This time will count both offline and online time.", 30);
            num  = this.AddLine(num, "Time online", Conv.MsToGuiText(App.State.Statistic.TimePlayed, true) + this.Multiboni(App.State.Statistic.MultiTimePlayed), "The total time the game was open. Every 10 minutes will increase your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Time offline", Conv.MsToGuiText(App.State.Statistic.TimeOffline, false) + this.Multiboni(App.State.Statistic.MultiTimeOffline), "The time you were offline after you started to play this game. Every 40 minutes will increase your statistic multi by 1. To prevent cheating, the time only works if you are online before you close the game.", 30);
            num += 20;
            num  = this.AddLine(num, "Rebirths", App.State.Statistic.TotalRebirths.Serialize() + this.Multiboni(App.State.Statistic.MultiTotalRebirths), "The number of times you pushed the Rebirth button. Each rebirth increases your statistic multi by 1000.", 30);
            num  = this.AddLine(num, "Training levels", App.State.Statistic.TotalTrainingLevels.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalTrainingLevels), "The total number of levels you gained by trainings. Every 10,000 levels increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Skill levels", App.State.Statistic.TotalSkillLevels.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalSkillLevels), "The total number of levels you gained by learning skills. Every 10,000 levels increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Enemies defeated", App.State.Statistic.TotalEnemiesDefeated.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalEnemiesDefeated), "The total number of enemies you defeated. Every 200,000 enemies you defeat increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Creations", App.State.Statistic.TotalCreations.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalCreations), "The total number of things you created. Every 1000 creations increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Shadow clones created", App.State.Statistic.TotalShadowClonesCreated.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalShadowClonesCreated), "All the shadow clones you created. Every 1000 clones created reduces their attack divider by 1 (after rebirth, min divider 50).  Every 2000 increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Shadow clones died", App.State.Statistic.TotalShadowClonesDied.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalShadowClonesDied), "All shadow clones who died fighting enemies. Every 500 clones who died reduces their defense and hp divider by 1 (after rebirth, min divider 50).  Every 500 increases your statistic multi by 1.", 30);
            num += 20;
            num  = this.AddLine(num, "Achievements", App.State.Statistic.TotalAchievements.GuiText + this.Multiboni(App.State.Statistic.MultiTotalAchievements), "The total number of achievements you got. Each achievement will increase your statistic multi by 5.", 30);
            num  = this.AddLine(num, "Gods defeated", App.State.Statistic.TotalGodsDefeated.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalGodsDefeated), "The total number of gods you defeated. Each defeated god increases your statistic multi by 50.", 30);
            num  = this.AddLine(num, "Divinity used", App.State.Statistic.TotalMoneySpent.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalMoneySpent), "The total divinity you traded in for creations. The more you trade in, the higher your statistic multi.", 30);
            num  = this.AddLine(num, "Upgrades", App.State.Statistic.TotalUpgrades.GuiText + this.Multiboni(App.State.Statistic.MultiTotalUpgrades), "The number of times you did upgrade a monument. Each upgrade increases your statistic multi by 5. Upgrading is available after defeating Freya.", 30);
            string str = string.Empty;

            if (App.State.Statistic.HighestGodDefeated > 28)
            {
                if (App.State.Statistic.HighestGodDefeated == 29)
                {
                    str = "P. Baal";
                }
                else
                {
                    str = "P. Baal v " + (App.State.Statistic.HighestGodDefeated - 28);
                }
            }
            else
            {
                str = EnumName.Name((God.GodType)App.State.Statistic.HighestGodDefeated.ToInt());
            }
            string str2 = string.Empty;

            if (!string.IsNullOrEmpty(App.State.Statistic.GodDefeatedBeforeRebirth))
            {
                str2 = "\nOn your last rebirth, you defeated " + App.State.Statistic.GodDefeatedBeforeRebirth;
            }
            num  = this.AddLine(num, "Strongest god defeated", str + this.Multiboni(App.State.Statistic.MultiHighestGodDefeated), "The strongest god you have defeated. Each higher tier increases your statistic multi by 50 (5000 after Baal)." + str2, 30);
            num += 20;
            num  = this.AddLine(num, "Ultimate Beings defeated", App.State.Statistic.UBsDefeated + this.Multiboni(App.State.Statistic.MultiUBsDefeated), "How many Ultimate Beings you have defeated. Each one increases your statistic multi by 40.", 30);
            num  = this.AddLine(num, "Total Powersurge levels", App.State.Statistic.TotalPowersurge.ToGuiText(true) + this.Multiboni(App.State.Statistic.MultiTotalPowersurge), "How many times you upgraded a level in Powersurge. Each level increases your statistic multi by 1.", 30);
            num  = this.AddLine(num, "Most shadow clones defeated", App.State.Statistic.MostDefeatedShadowClones + this.Multiboni(App.State.Statistic.MultiMostClonesDefeated), "The most shadow clones you have defeated in one special fight. Increases your statistic multi by 500 x defeated count x defeated count.", 30);
            num  = this.AddLine(num, "TBS Score", App.State.Statistic.TBSScore + this.Multiboni(App.State.Statistic.MultiTBSScore), "Your score in the TBS - Game. Increases your statistic multi by 100 x score.", 30);
            if (App.CurrentPlattform != Plattform.Android)
            {
                num = this.AddLine(num, "Highscore Godly Shoot", App.State.Statistic.GodlyShootScore.ToInt() + this.Multiboni(App.State.Statistic.MultiGodlyShootScore), "The highest score you reached in 'Godly Shoot'. Each one increases your statistic multi by 500.", 30);
                num = this.AddLine(num, "Highscore Godly Shoot Boss", App.State.Statistic.GodlyShootScoreBoss.ToInt() + this.Multiboni(App.State.Statistic.MultiGodlyShootScoreBoss), "The highest score you reached in 'Godly Shoot' in Boss mode. Each one increases your statistic multi by 250.", 30);
            }
            num  = this.AddLine(num, "AFK Clones killed", App.State.Statistic.AfkyClonesKilled.GuiText + this.Multiboni(App.State.Statistic.MultiAfkyClonesKilled), "The total number of clones your afky God has killed. Increases your statistic multi by 1 every 1000. Capped at 25 million.", 30);
            num  = this.AddLine(num, "Highest Afky God Power", App.State.Statistic.AfkyGodPower.GuiText + this.Multiboni(App.State.Statistic.MultiAfkyGodPower), "The highest Power your Afky God ever had. Increases your statistic multi by 1 every 10. Capped at 25 million.", 30);
            num += 20;
            CDouble cDouble = App.State.PremiumBoni.TotalMight;

            num = this.AddLine(num, "Total Might gained", cDouble.GuiText + this.Multiboni(App.State.Statistic.MultiTotalMight), "How many times you upgraded a level in the Might-Tab. Each one increases your statistic multi by 10.", 30);
            CDouble cDouble2 = App.State.PremiumBoni.TotalGodPowerSpent;

            num  = this.AddLine(num, "Total God Power spent", cDouble2.GuiText + this.Multiboni(App.State.Statistic.MultiTotalGPsUsed), "How many God Power you have spent. Each one increases your statistic multi by 20.\nGP spent for permanent upgrades: " + App.State.PremiumBoni.PermanentGPSpent, 30);
            num  = this.AddLine(num, "Total Pet Growth", App.State.Statistic.TotalPetGrowth.GuiText + this.Multiboni(App.State.Statistic.MultiPetGrowth), "The total combined growth of all the pets you own.", 30);
            num += 20;
            num  = this.AddLine(num, "All Achievements Challenges", App.State.Statistic.AchievementChallengesFinished + this.Multiboni(App.State.Statistic.MultiAchievementChallenge), "How often you finished an All Achievements Challenge. You will receive 750,000 statistic multi and your achievements will increase your multipliers by 1% more for each one. \nIt will also reduce the levels for trainings and fights you need to reach an achievement by 1% (Maxed at 50%).", 30);
            num  = this.AddLine(num, "Double Rebirth Challenges", App.State.Statistic.DoubleRebirthChallengesFinished + this.Multiboni(App.State.Statistic.MultiDBChallenge), "How often you have defeated Baal after a Double Rebirth Challenge. You will receive 500,000 statistic multi and your might will level up one time (up to a max of 50) for each one.", 30);
            string right = Conv.MsToGuiText(App.State.Statistic.FastestDRCallenge.ToLong(), true);

            if (App.State.Statistic.FastestDRCallenge <= 0)
            {
                right = "No challenge finished.";
            }
            string str3 = string.Empty;

            if (App.State.Statistic.HasStartedDoubleRebirthChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfterDRCStarted.ToLong(), true);
            }
            num = this.AddLine(num, "Fastest DRC", right, "The fastest time you completed a 'Double Rebirth Challenge'" + str3, 30);
            num = this.AddLine(num, "1K Challenges", App.State.Statistic.OnekChallengesFinished + this.Multiboni(App.State.Statistic.Multi1KChallenge), "How often you have defeated Baal in a 1K Challenge. You will receive 1.5 million statistic multi and your clones will level up might 5% faster for each one. (level 40 is max)", 30);
            string right2 = Conv.MsToGuiText(App.State.Statistic.Fastest1KCCallenge.ToLong(), true);

            if (App.State.Statistic.Fastest1KCCallenge <= 0)
            {
                right2 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStarted1kChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfter1KCStarted.ToLong(), true);
            }
            num = this.AddLine(num, "Fastest 1KC", right2, "The fastest time you completed a '1K Challenge'" + str3, 30);
            num = this.AddLine(num, "No Rebirth Challenges", App.State.Statistic.NoRbChallengesFinished + this.Multiboni(App.State.Statistic.MultiNoRbChallenge), "How often you have defeated Baal in a No Rebirth Challenge. You will receive 10 million statistic multi and you can fight Ultimate Beings 1% faster. (20% is max)", 30);
            string right3 = Conv.MsToGuiText(App.State.Statistic.FastestNoRbCCallenge.ToLong(), true);

            if (App.State.Statistic.FastestNoRbCCallenge <= 0)
            {
                right3 = "No challenge finished.";
            }
            if (App.State.Statistic.HasStartedNoRbChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfterNoRbStarted.ToLong(), true);
            }
            num  = this.AddLine(num, "Fastest No Rebirth Challenge", right3, "The fastest time you completed a 'No Rebirth Challenge'" + str3, 30);
            num += 20;
            num  = this.AddLine(num, "Ultimate Universe Challenges", App.State.Statistic.UniverseChallengesFinished + this.Multiboni(App.State.Statistic.MultiUUChallenge), "How often you finished an 'Ultimate Universe Challenge'. Your Planet level will increase by 1 for each finished Challenge (level 50 is max).", 30);
            string right4 = Conv.MsToGuiText(App.State.Statistic.FastestUUCallenge.ToLong(), true);

            if (App.State.Statistic.FastestUUCallenge <= 0)
            {
                right4 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStartedUniverseChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfterUUCStarted.ToLong(), true);
            }
            num = this.AddLine(num, "Fastest UUC", right4, "The fastest time you completed an 'Ultimate Universe Challenge'" + str3, 30);
            num = this.AddLine(num, "Ultimate Pet Challenges", App.State.Statistic.UltimatePetChallengesFinished + this.Multiboni(App.State.Statistic.MultiUPChallenge), "How often you beat Baal with your pets. You will receive 2 million statistic multi and receive 5% more rewards from pet campaigns (maxed at 20).", 30);
            string right5 = Conv.MsToGuiText(App.State.Statistic.FastestUPCallenge.ToLong(), true);

            if (App.State.Statistic.FastestUPCallenge <= 0)
            {
                right5 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStartedUltimatePetChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfterUPCStarted.ToLong(), true);
            }
            num = this.AddLine(num, "Fastest UPC", right5, "The fastest time you completed an 'Ultimate Pet Challenge'" + str3, 30);
            num = this.AddLine(num, "Black Holes Challenges", App.State.Statistic.BlackHoleChallengesFinished + this.Multiboni(App.State.Statistic.MultiBHChallenge), "How often you have finished the challenge. You will receive 750,000 statistic multi.\nFor each challenge finished, blackholes are 2% cheaper to build and each blackhole up to the number of BHCs completed provides an additional 5% chance for 1 GP each hour.\nCan't go higher than 200% for 2 additional GP each hour.", 30);
            string right6 = Conv.MsToGuiText(App.State.Statistic.FastestBHCallenge.ToLong(), true);

            if (App.State.Statistic.FastestBHCallenge <= 0)
            {
                right6 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStartedBlackHoleChallenge)
            {
                str3 = "\nTime since you started the challenge: " + Conv.MsToGuiText(App.State.Statistic.TimeAfterBHCStarted.ToLong(), true);
            }
            num  = this.AddLine(num, "Fastest BHC", right6, "The fastest time you completed a 'Black Hole Challenge'" + str3, 30);
            num += 20;
            num  = this.AddLine(num, "Ultimate Baal Challenges", App.State.Statistic.UltimateBaalChallengesFinished + this.Multiboni(App.State.Statistic.MultiUBChallenge), "How often you beat Baal after an Ultimate Baal Challenge. You will receive 5 million statistic multi and P.Baals will grow weaker by 1% for each one (50% is minimum).", 30);
            string right7 = Conv.MsToGuiText(App.State.Statistic.FastestUBCallenge.ToLong(), true);

            if (App.State.Statistic.FastestUBCallenge <= 0)
            {
                right7 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStartedUltimateBaalChallenge)
            {
                str3 = string.Concat(new object[]
                {
                    "\nTime since you started the challenge: ",
                    Conv.MsToGuiText(App.State.Statistic.TimeAfterUBCStarted.ToLong(), true),
                    ", currently you are on the ",
                    App.State.Statistic.RebirthsAfterUBC,
                    ". rebirth."
                });
            }
            num = this.AddLine(num, "Fastest UBC", right7, "The fastest time you completed a 'Ultimate Baal Challenge'" + str3, 30);
            string right8 = "-";

            if (App.State.Statistic.MinRebirthsAfterUBC > 0)
            {
                right8 = App.State.Statistic.MinRebirthsAfterUBC.ToGuiText(true);
            }
            num = this.AddLine(num, "Minimum Rebirths used for UBC", right8, "Can you defeat baal in one rebirth?", 30);
            num = this.AddLine(num, "Ultimate Arty Challenges", App.State.Statistic.ArtyChallengesFinished + this.Multiboni(App.State.Statistic.MultiUAChallenge), "How often you beat Baal after an Ultimate Arty Challenge within 4 rebirths. You will receive 20 million statistic multi and P.Baals will grow weaker by 2% for each one (50% is minimum).", 30);
            string right9 = Conv.MsToGuiText(App.State.Statistic.FastestUACallenge.ToLong(), true);

            if (App.State.Statistic.FastestUACallenge <= 0)
            {
                right9 = "No challenge finished.";
            }
            str3 = string.Empty;
            if (App.State.Statistic.HasStartedUltimateBaalChallenge)
            {
                str3 = string.Concat(new object[]
                {
                    "\nTime since you started the challenge: ",
                    Conv.MsToGuiText(App.State.Statistic.TimeAfterUACStarted.ToLong(), true),
                    ", currently you are on the ",
                    App.State.Statistic.RebirthsAfterUAC,
                    ". rebirth."
                });
            }
            num    = this.AddLine(num, "Fastest UAC", right9, "The fastest time you completed an 'Ultimate Arty Challenge'" + str3, 30);
            right8 = "-";
            if (App.State.Statistic.MinRebirthsAfterUAC > 0)
            {
                right8 = App.State.Statistic.MinRebirthsAfterUAC.ToGuiText(true);
            }
            num  = this.AddLine(num, "Minimum Rebirths used for UAC", right8, "Can you defeat baal in one rebirth?", 30);
            num += 20;
            num  = this.AddLine(num, "Monuments created", App.State.Statistic.MonumentsCreated.GuiText, "The number of monuments you created. They work as a multiplier for all other statistic multiplier. Monuments are unlocked after defeating Diana.", 30);
            num  = this.AddLine(num, "Total Multiplier ", string.Concat(new object[]
            {
                App.State.Statistic.StatisticRebirthMultiplierBase.ToGuiText(true),
                " x ",
                App.State.Statistic.MultiMonumentsCreated + 1,
                " = ",
                (App.State.Statistic.StatisticRebirthMultiplierBase * (App.State.Statistic.MultiMonumentsCreated + 1)).ToGuiText(true)
            }), "Total multiplier out of all statistics. Also multiplied with " + App.State.PremiumBoni.StatisticMulti.ToGuiText(true) + " from god power purchases but it is capped at: " + App.State.Multiplier.RebirthMulti.ToGuiText(true), 50);
            num += 25;
            GUI.EndScrollView();
            GUI.EndGroup();
            this.scrollHeight = num;
        }
        private void UpdateAllStats()
        {
            long num = UpdateStats.CurrentTimeMillis() - this.lastUpdateStats;

            this.timerStack     += num;
            this.lastUpdateStats = UpdateStats.CurrentTimeMillis();
            if (this.timerStack < 30L || OfflineCalc.IsCalculating)
            {
                return;
            }
            num              = 30L;
            this.timerStack -= num;
            if (App.State == null)
            {
                return;
            }
            if (UpdateStats.TimeLeftForEvent > 0L)
            {
                App.State.Statistic.TimeUntilNextChocolate -= num;
                if (App.State.Statistic.TimeUntilNextChocolate < 0L)
                {
                    App.State.Statistic.TimeUntilNextChocolate = 1200000L;
                    State2 expr_B4 = App.State.Ext;
                    expr_B4.Chocolate = ++expr_B4.Chocolate;
                    GuiBase.ShowToast("You received 1 chocolate!");
                }
            }
            App.State.Ext.AfkGame.Update(num);
            foreach (Training current in App.State.AllTrainings)
            {
                current.UpdateDuration(num);
            }
            foreach (Skill current2 in App.State.AllSkills)
            {
                current2.UpdateDuration(num);
            }
            foreach (Fight current3 in App.State.AllFights)
            {
                current3.UpdateDuration(num);
            }
            foreach (Creation current4 in App.State.AllCreations)
            {
                current4.UpdateDuration(num);
            }
            foreach (Might current5 in App.State.AllMights)
            {
                current5.UpdateDuration(num);
            }
            App.State.RecoverHealth(num);
            App.State.PremiumBoni.UpdateDuration(num);
            App.State.Generator.UpdateDuration(num);
            App.State.PrinnyBaal.Fight(num);
            App.State.Battle.UpdateData(num);
            SpecialFightUi.UpdateAutoMode(num);
            App.State.CreatingSpeedBoniDuration -= num;
            if (App.State.CreatingSpeedBoniDuration < 0L)
            {
                App.State.CreatingSpeedBoniDuration = 0L;
            }
            if (!App.State.PremiumBoni.TotalMightIsUnlocked)
            {
                App.State.PremiumBoni.TotalMightIsUnlocked = (App.State.AllTrainings[App.State.AllTrainings.Count - 1].IsAvailable && App.State.AllSkills[App.State.AllSkills.Count - 1].IsAvailable);
                if (App.State.PremiumBoni.TotalMightIsUnlocked && !App.State.Statistic.HasStartedArtyChallenge && !App.State.Statistic.HasStartedUltimateBaalChallenge)
                {
                    foreach (Might current6 in App.State.AllMights)
                    {
                        CDouble cDouble = App.State.Statistic.DoubleRebirthChallengesFinished;
                        if (cDouble > 50)
                        {
                            cDouble = 50;
                        }
                        current6.Level += cDouble;
                        App.State.PremiumBoni.TotalMight += (long)cDouble.ToInt();
                    }
                }
            }
            foreach (Monument current7 in App.State.AllMonuments)
            {
                current7.UpdateDuration(num);
                if (App.State.Statistic.HasStartedBlackHoleChallenge && current7.TypeEnum == Monument.MonumentType.black_hole)
                {
                    MonumentUpgrade upgrade = current7.Upgrade;
                    if (current7.Level > 0 && upgrade.Level > 0)
                    {
                        App.State.Statistic.HasStartedBlackHoleChallenge = false;
                        if (App.State.Statistic.FastestBHCallenge <= 0 || App.State.Statistic.FastestBHCallenge > App.State.Statistic.TimeAfterBHCStarted)
                        {
                            App.State.Statistic.FastestBHCallenge = App.State.Statistic.TimeAfterBHCStarted;
                            Leaderboards.SubmitStat(LeaderBoardType.FastestBHCallenge, (int)(App.State.Statistic.FastestBHCallenge.ToLong() / 1000L), false);
                        }
                        App.State.Statistic.TimeAfterBHCStarted = 0;
                        Statistic expr_542 = App.State.Statistic;
                        expr_542.BlackHoleChallengesFinished = ++expr_542.BlackHoleChallengesFinished;
                        App.SaveGameState();
                        GuiBase.ShowToast("You finished your black hole challenge!");
                    }
                }
            }
            foreach (Pet current8 in App.State.Ext.AllPets)
            {
                current8.UpdateDuration(num);
            }
            App.State.HomePlanet.UpdateDuration(num);
            if (HeroImage.ShouldInitRessources)
            {
                //base.StartCoroutine(this.InitAvatarImages());
            }
        }
        private void ShowBuyCreations()
        {
            GUIStyle style  = GUI.skin.GetStyle("TextField");
            GUIStyle style2 = GUI.skin.GetStyle("Label");
            GUIStyle style3 = GUI.skin.GetStyle("Button");

            style.fontSize  = GuiBase.FontSize(16);
            style3.fontSize = GuiBase.FontSize(16);
            style.alignment = TextAnchor.MiddleCenter;
            Rect rect = new Rect(GuiBase.Width(365f), GuiBase.Height(360f), GuiBase.Width(500f), GuiBase.Height(150f));

            GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            style2.fontSize  = GuiBase.FontSize(16);
            style2.alignment = TextAnchor.MiddleCenter;
            GUI.Label(new Rect(rect.xMin, rect.yMin + GuiBase.Height(10f), GuiBase.Width(450f), GuiBase.Height(30f)), new GUIContent(string.Empty, "Hello my dear god. Please click twice on the white box and then put a big number into it.\nOnly numbers though! Then finalize with the 'Buy' button. You can ignore the 'Cancel' button"));
            if (string.IsNullOrEmpty(this.countToBuy))
            {
                this.countToBuy = string.Empty;
            }
            this.countToBuy = GUI.TextField(new Rect(rect.xMin + GuiBase.Width(30f), rect.yMin + GuiBase.Height(45f), GuiBase.Width(270f), GuiBase.Height(30f)), this.countToBuy);
            if (GUI.Button(new Rect(rect.xMin + GuiBase.Width(400f), rect.yMin + GuiBase.Height(45f), GuiBase.Width(75f), GuiBase.Height(30f)), "Cancel"))
            {
                this.creationToShow = null;
                return;
            }
            try
            {
                if (!string.IsNullOrEmpty(this.countToBuy) && this.countToBuy.StartsWith("-"))
                {
                    GuiBase.ShowToast("I only sell my creations to you. I won't buy them.");
                    this.countToBuy = string.Empty;
                    return;
                }
                CDouble cDouble = new CDouble(this.countToBuy);
                cDouble.Round();
                this.countToBuy  = cDouble.ToString();
                style2.alignment = TextAnchor.UpperLeft;
                GUI.Label(new Rect(rect.xMin + GuiBase.Width(35f), rect.yMin + GuiBase.Height(85f), GuiBase.Width(450f), GuiBase.Height(30f)), "Divinity cost: " + (this.creationToShow.BuyCost * cDouble).ToGuiText(true));
                GUI.Label(new Rect(rect.xMin + GuiBase.Width(35f), rect.yMin + GuiBase.Height(115f), GuiBase.Width(450f), GuiBase.Height(30f)), "You have: " + App.State.Money.ToGuiText(true) + " divinity");
                GUI.Label(new Rect(rect.xMin + GuiBase.Width(35f), rect.yMin + GuiBase.Height(145f), GuiBase.Width(450f), GuiBase.Height(30f)), "You have: " + this.creationToShow.Count.ToGuiText(true) + " " + this.creationToShow.Name.ToLower());
                style2.alignment = TextAnchor.MiddleCenter;
                if (GUI.Button(new Rect(rect.xMin + GuiBase.Width(315f), rect.yMin + GuiBase.Height(45f), GuiBase.Width(75f), GuiBase.Height(30f)), "Buy"))
                {
                    CDouble cDouble2 = this.creationToShow.BuyCost * cDouble;
                    App.State.Money.Round();
                    cDouble2.Round();
                    if (App.State.Money >= cDouble2)
                    {
                        App.State.Money                     -= cDouble2;
                        this.creationToShow.Count           += cDouble;
                        this.creationToShow                  = null;
                        App.State.Statistic.TotalMoneySpent += cDouble2;
                    }
                    else
                    {
                        GuiBase.ShowToast("Sorry you are way too poor to afford that.\nPlease save up a little more and then come back.");
                    }
                }
            }
            catch (ArgumentOutOfRangeException)
            {
                this.countToBuy = string.Empty;
                GuiBase.ShowToast("Only numbers are allowed! Don't ask why. It's just hard to count money with letters or some weird characters.");
            }
            GUI.BeginGroup(new Rect(GuiBase.Width(280f), GuiBase.Height(120f), GuiBase.Width(670f), GuiBase.Height(480f)));
            if (this.creationToShow != null)
            {
                style2.fontStyle = FontStyle.Bold;
                GUI.Label(new Rect(GuiBase.Width(10f), GuiBase.Height(10f), GuiBase.Width(660f), GuiBase.Height(50f)), "I can sell you a " + this.creationToShow.Name + ". How many do you want to buy? \nPress a button or input a number.");
                style2.fontStyle = FontStyle.Normal;
            }
            this.toggleNumber = GUI.Toolbar(new Rect(GuiBase.Width(55f), GuiBase.Height(70f), GuiBase.Width(245f), GuiBase.Height(35f)), this.toggleNumber, this.toolbarLeftStrings);
            int value = 1;

            if (this.toggleNumber == 1)
            {
                value = 2;
            }
            else if (this.toggleNumber == 2)
            {
                value = 5;
            }
            else if (this.toggleNumber == 3)
            {
                value = 25;
            }
            else if (this.toggleNumber == 4)
            {
                value = 75;
            }
            CDouble cDouble3 = new CDouble("1") * value;

            if (GUI.Button(new Rect(GuiBase.Width(55f), GuiBase.Height(120f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble3.ToGuiText(true)))
            {
                this.BuyCount(cDouble3);
            }
            CDouble cDouble4 = new CDouble("10") * value;

            if (GUI.Button(new Rect(GuiBase.Width(200f), GuiBase.Height(120f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble4.ToGuiText(true)))
            {
                this.BuyCount(cDouble4);
            }
            CDouble cDouble5 = new CDouble("100") * value;

            if (GUI.Button(new Rect(GuiBase.Width(345f), GuiBase.Height(120f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble5.ToGuiText(true)))
            {
                this.BuyCount(cDouble5);
            }
            CDouble cDouble6 = new CDouble("1000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(490f), GuiBase.Height(120f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble6.ToGuiText(true)))
            {
                this.BuyCount(cDouble6);
            }
            CDouble cDouble7 = new CDouble("10000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(55f), GuiBase.Height(155f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble7.ToGuiText(true)))
            {
                this.BuyCount(cDouble7);
            }
            CDouble cDouble8 = new CDouble("100000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(200f), GuiBase.Height(155f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble8.ToGuiText(true)))
            {
                this.BuyCount(cDouble8);
            }
            CDouble cDouble9 = new CDouble("1000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(345f), GuiBase.Height(155f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble9.ToGuiText(true)))
            {
                this.BuyCount(cDouble9);
            }
            CDouble cDouble10 = new CDouble("10000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(490f), GuiBase.Height(155f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble10.ToGuiText(true)))
            {
                this.BuyCount(cDouble10);
            }
            CDouble cDouble11 = new CDouble("100000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(55f), GuiBase.Height(190f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble11.ToGuiText(true)))
            {
                this.BuyCount(cDouble11);
            }
            CDouble cDouble12 = new CDouble("1000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(200f), GuiBase.Height(190f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble12.ToGuiText(true)))
            {
                this.BuyCount(cDouble12);
            }
            CDouble cDouble13 = new CDouble("10000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(345f), GuiBase.Height(190f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble13.ToGuiText(true)))
            {
                this.BuyCount(cDouble13);
            }
            CDouble cDouble14 = new CDouble("100000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(490f), GuiBase.Height(190f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble14.ToGuiText(true)))
            {
                this.BuyCount(cDouble14);
            }
            CDouble cDouble15 = new CDouble("1000000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(55f), GuiBase.Height(225f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble15.ToGuiText(true)))
            {
                this.BuyCount(cDouble15);
            }
            CDouble cDouble16 = new CDouble("10000000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(200f), GuiBase.Height(225f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble16.ToGuiText(true)))
            {
                this.BuyCount(cDouble16);
            }
            CDouble cDouble17 = new CDouble("100000000000000") * value;

            if (GUI.Button(new Rect(GuiBase.Width(345f), GuiBase.Height(225f), GuiBase.Width(140f), GuiBase.Height(25f)), cDouble17.ToGuiText(true)))
            {
                this.BuyCount(cDouble17);
            }
            if (GUI.Button(new Rect(GuiBase.Width(490f), GuiBase.Height(225f), GuiBase.Width(140f), GuiBase.Height(25f)), "MAX"))
            {
                CDouble buyCost = this.creationToShow.BuyCost;
                if (buyCost == 0)
                {
                    return;
                }
                CDouble cDouble18 = App.State.Money / this.creationToShow.BuyCost;
                cDouble18.Value = Math.Floor(cDouble18.Value);
                this.BuyCount(cDouble18);
            }
            GUI.EndGroup();
        }
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (SkillUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         SkillUi.scrollBarsToZero = false;
     }
     if (this.updateTime == 60)
     {
         this.totalMysticGain = new CDouble();
     }
     foreach (Skill current in App.State.AllSkills)
     {
         labelStyle.fontSize = GuiBase.FontSize(16);
         double percent = 0.0;
         if (current.CapCount > 1)
         {
             percent = current.getPercent();
         }
         GuiBase.CreateProgressBar(marginTop, percent, current.Name, current.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
         GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), string.Empty + current.LevelText, labelStyle);
         GUI.Label(new Rect(GuiBase.Width(330f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + current.ShadowCloneCount, labelStyle);
         if (current.IsAvailable)
         {
             if (this.updateTime == 60 && current.ShadowCloneCount > 0)
             {
                 int num = current.ShadowCloneCount.ToInt();
                 if (current.CapCount < num)
                 {
                     num = current.CapCount;
                 }
                 this.totalMysticGain += current.PowerGainInSec(num);
             }
             if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
             {
                 if (Event.current.button == 1)
                 {
                     current.AddCloneCount(28);
                 }
                 else
                 {
                     current.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
                 }
             }
             if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
             {
                 current.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
             }
             if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), "CAP"))
             {
                 current.RemoveCloneCount(999999);
                 int num2 = App.State.Clones.IdleClones();
                 if (num2 > 0)
                 {
                     int num3 = current.DurationInMS(1) / 30 + 1;
                     int i    = num3;
                     int num4 = 2;
                     while (i > num2)
                     {
                         i = num3 / num4 + 1;
                         num4++;
                         if (num4 > App.State.Clones.MaxShadowClones)
                         {
                             return;
                         }
                     }
                     current.AddCloneCount(i);
                 }
             }
         }
         marginTop += 35;
     }
     if (this.updateTime == 60)
     {
         this.updateTime = 0;
     }
     this.updateTime++;
 }
Exemplo n.º 9
0
        public void ReadArray(Array a)
        {
            if (a != null)
            {
                if (a.Length > 0)
                {
                    if (a is CDouble[])
                    {
                        var a1 = (CDouble[])a;
                        var a2 = new double[a1.Length * 2];
                        ReadArray(a2);
                        for (int i = 0; i < a1.Length; i++)
                        {
                            a1[i] = new CDouble(a2[i * 2], a2[i * 2 + 1]);
                        }
                        return;
                    }

                    if (a is CSingle[])
                    {
                        var a1 = (CSingle[])a;
                        var a2 = new float[a1.Length * 2];
                        ReadArray(a2);
                        for (int i = 0; i < a1.Length; i++)
                        {
                            a1[i] = new CSingle(a2[i * 2], a2[i * 2 + 1]);
                        }
                        return;
                    }

                    int l  = a.Length;
                    int bl = Buffer.ByteLength(a);


                    if (memstream)
                    {
                        if (Position + bl > CurrentLimit)
                        {
                            throw new IOException("Message read error");
                        }

                        //byte[] b = s_memstream.GetBuffer();
                        Buffer.BlockCopy(membuf, (int)s_memstream.Position, a, 0, bl);
                        s_memstream.Position = s_memstream.Position + bl;

                        m_Position += (uint)bl;
                    }
                    else
                    {
                        if (Position + bl > CurrentLimit)
                        {
                            throw new IOException("Message read error");
                        }
                        if (a.GetType().GetElementType().ToString() == "byte")
                        {
                            Read((byte[])a, 0, a.Length);
                        }
                        else
                        {
                            int n  = bl / bufsize;
                            int nm = bl % bufsize;



                            for (int i = 0; i < n; i++)
                            {
                                Read(abuffer, 0, bufsize);
                                Buffer.BlockCopy(abuffer, 0, a, i * bufsize, bufsize);
                            }

                            if (nm > 0)
                            {
                                Read(abuffer, 0, nm);
                                Buffer.BlockCopy(abuffer, 0, a, (n) * bufsize, nm);
                            }
                        }
                        m_Position += (uint)bl;
                    }
                }
            }
        }
Exemplo n.º 10
0
        public static void Show()
        {
            GUIStyle style  = GUI.skin.GetStyle("Label");
            GUIStyle style2 = GUI.skin.GetStyle("Button");

            style.alignment = TextAnchor.UpperLeft;
            style.fontSize  = GuiBase.FontSize(16);
            style2.fontSize = GuiBase.FontSize(16);
            App.State.PremiumBoni.CheckIfGPIsAdjusted();
            GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            GodPowerUi.scrollPosition = GuiBase.TouchScrollView(new Rect(GuiBase.Width(280f), GuiBase.Height(120f), GuiBase.Width(660f), GuiBase.Height(430f)), GodPowerUi.scrollPosition, new Rect(0f, GuiBase.Height(20f), GuiBase.Width(620f), GuiBase.Height((float)GodPowerUi.marginTop)));
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height(30f), GuiBase.Width(400f), GuiBase.Height(30f)), "Here you can buy various offers with your god power.");
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height(68f), GuiBase.Width(150f), GuiBase.Height(30f)), "You have: " + App.State.PremiumBoni.GodPower);
            GUI.Label(new Rect(GuiBase.Width(150f), GuiBase.Height(60f), GuiBase.Width(40f), GuiBase.Height(40f)), GodPowerUi.godPower);
            GodPowerUi.marginTop = 105;
            string tooltip = string.Empty;

            if (App.State.Statistic.UltimateBaalChallengesFinished > 0 || App.State.Statistic.ArtyChallengesFinished > 0)
            {
                tooltip = "The value in brackets is the total boost with your crystal power included.";
            }
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), new GUIContent("You can adjust unused god power for additional stat multiplier.", tooltip));
            GodPowerUi.marginTop += 30;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Bonus Physical: "));
            GUI.Label(new Rect(GuiBase.Width(250f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent(" % (" + (App.State.PremiumBoni.GpBoniPhysical * (1 + App.State.PremiumBoni.CrystalPower / 1000)).GuiText + ")"));
            App.State.PremiumBoni.GpBoniPhysical = (int)GUI.HorizontalSlider(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(GodPowerUi.marginTop + 2)), GuiBase.Width(200f), GuiBase.Height(30f)), (float)App.State.PremiumBoni.GpBoniPhysical.ToInt(), 0f, (float)App.State.PremiumBoni.MaxBoniPhysical);
            GodPowerUi.addTextField(ref App.State.PremiumBoni.GpBoniPhysical, App.State.PremiumBoni.GodPower);
            GodPowerUi.marginTop += 30;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Bonus Mystic: "));
            GUI.Label(new Rect(GuiBase.Width(250f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent(" % (" + (App.State.PremiumBoni.GpBoniMystic * (1 + App.State.PremiumBoni.CrystalPower / 1000)).GuiText + ")"));
            App.State.PremiumBoni.GpBoniMystic = (int)GUI.HorizontalSlider(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(GodPowerUi.marginTop + 2)), GuiBase.Width(200f), GuiBase.Height(30f)), (float)App.State.PremiumBoni.GpBoniMystic.ToInt(), 0f, (float)App.State.PremiumBoni.MaxBoniMystic);
            GodPowerUi.addTextField(ref App.State.PremiumBoni.GpBoniMystic, App.State.PremiumBoni.GodPower);
            GodPowerUi.marginTop += 30;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Bonus Battle: "));
            GUI.Label(new Rect(GuiBase.Width(250f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent(" % (" + (App.State.PremiumBoni.GpBoniBattle * (1 + App.State.PremiumBoni.CrystalPower / 1000)).GuiText + ")"));
            App.State.PremiumBoni.GpBoniBattle = (int)GUI.HorizontalSlider(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(GodPowerUi.marginTop + 2)), GuiBase.Width(200f), GuiBase.Height(30f)), (float)App.State.PremiumBoni.GpBoniBattle.ToInt(), 0f, (float)App.State.PremiumBoni.MaxBoniBattle);
            GodPowerUi.addTextField(ref App.State.PremiumBoni.GpBoniBattle, App.State.PremiumBoni.GodPower);
            GodPowerUi.marginTop += 30;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Bonus Creating: "));
            GUI.Label(new Rect(GuiBase.Width(250f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent(" % (" + (App.State.PremiumBoni.GpBoniCreating * (1 + App.State.PremiumBoni.CrystalPower / 1000)).GuiText + ")"));
            App.State.PremiumBoni.GpBoniCreating = (int)GUI.HorizontalSlider(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(GodPowerUi.marginTop + 2)), GuiBase.Width(200f), GuiBase.Height(30f)), (float)App.State.PremiumBoni.GpBoniCreating.ToInt(), 0f, (float)App.State.PremiumBoni.MaxBoniCreating);
            GodPowerUi.addTextField(ref App.State.PremiumBoni.GpBoniCreating, App.State.PremiumBoni.GodPower);
            GodPowerUi.marginTop += 35;
            style.fontStyle       = FontStyle.Bold;
            if (App.State.PremiumBoni.CrystalPower > 0 || App.State.PremiumBoni.CrystalBonusBuilding > 0)
            {
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(450f), GuiBase.Height(30f)), new GUIContent(string.Concat(new object[]
                {
                    "Your current creating speed multiplier: ",
                    App.State.PremiumBoni.CreatingSpeedUpPercent(false),
                    " % (",
                    App.State.PremiumBoni.CreatingSpeedUpPercent(true),
                    ")"
                }), string.Concat(new object[]
                {
                    "The higher your multiplier, the faster you can create things.\n",
                    App.State.PremiumBoni.CreatingSpeedUpPercent(false),
                    " from god power and ",
                    App.State.PremiumBoni.CrystalPower / 2,
                    " from crystal power."
                })));
                string text = ".";
                if (App.State.PremiumBoni.CrystalBonusBuilding > 0)
                {
                    text = ", increased by " + App.State.PremiumBoni.CrystalBonusBuilding.GuiText + " % from equipped crystals.";
                }
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)(GodPowerUi.marginTop + 28)), GuiBase.Width(450f), GuiBase.Height(30f)), new GUIContent(string.Concat(new object[]
                {
                    "Your current building speed multiplier: ",
                    App.State.PremiumBoni.BuildingSpeedUpPercent(false),
                    " % (",
                    App.State.PremiumBoni.BuildingSpeedUpPercent(true),
                    ")"
                }), string.Concat(new object[]
                {
                    "The higher your multiplier, the faster you can build monuments and upgrades.\n",
                    App.State.PremiumBoni.BuildingSpeedUpPercent(false),
                    " from god power and ",
                    App.State.PremiumBoni.CrystalPower / 2,
                    " from crystal power",
                    text
                })));
            }
            else
            {
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(450f), GuiBase.Height(30f)), new GUIContent("Your current creating speed multiplier: " + App.State.PremiumBoni.CreatingSpeedUpPercent(true) + " %", "The higher your multiplier, the faster you can create things.\n"));
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)(GodPowerUi.marginTop + 28)), GuiBase.Width(450f), GuiBase.Height(30f)), new GUIContent("Your current building speed multiplier: " + App.State.PremiumBoni.BuildingSpeedUpPercent(true) + " %", "The higher your multiplier, the faster you can build monuments and upgrades."));
            }
            if (App.State.Statistic.UltimateBaalChallengesFinished > 0 || App.State.Statistic.ArtyChallengesFinished > 0)
            {
                GodPowerUi.marginTop += 30;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)(GodPowerUi.marginTop + 28)), GuiBase.Width(400f), GuiBase.Height(30f)), new GUIContent("Crystal Power: " + App.State.PremiumBoni.CrystalPower.GuiText, "If you have crystals equipped when you rebirth, you will receive 1 crystal power for each grade (2 for ultimate crystals, 3 for god crystals).\nEach crystal power will add 0.5% to your creating speed, building speed multiplier, and increases the effectiveness of unused godpower adjusted by 0.1%."));
            }
            if (App.State.Statistic.HighestGodDefeated >= 28 && !App.State.Statistic.HasStartedArtyChallenge)
            {
                GodPowerUi.marginTop += 61;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), new GUIContent("Your current chance to lose levels on a miss in the TBS - Game: " + (100 - App.State.PremiumBoni.TbsMissreduction) + " %", "The lower the chance, the less likely you will lose a level when you miss on the TBS - Game. (20% is minimum)"));
                GodPowerUi.marginTop += 28;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), new GUIContent("The progress from the TBS - Game you keep after rebirthing: " + App.State.PremiumBoni.TbsProgressAfterRebirth + " %", "After rebirthing you will keep the shown % of your levels in the TBS - Game. (80% is maximum)"));
                GodPowerUi.marginTop += 28;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), new GUIContent("Chance for double points in TBS: " + App.State.PremiumBoni.TbsDoublePoints + " %", "If you hit the white bar in TBS, this is your chance to get twice as much points. (100% is maximum)"));
                GodPowerUi.marginTop += 28;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), new GUIContent("Extra Pixels for the white area: " + App.State.PremiumBoni.TbsExtraPixels, "The current (and also the minimum) width of the white area is increased by " + App.State.PremiumBoni.TbsExtraPixels + " pixels. (3 is maximum)"));
                GodPowerUi.marginTop -= 20;
            }
            style.fontStyle       = FontStyle.Normal;
            GodPowerUi.marginTop += 70;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase creating speed permanently by 2%", " increases your creating speed permanently by 2%.", GodPowerUi.marginTop, 1, style, delegate
            {
                App.State.PremiumBoni.AddCreationSpeed(2);
                GuiBase.ShowToast("Your creating speed multiplier is now increased by 2%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase creating speed permanently by 5%", " increases your creating speed permanently by 5%.", GodPowerUi.marginTop, 2, style, delegate
            {
                App.State.PremiumBoni.AddCreationSpeed(5);
                GuiBase.ShowToast("Your creating speed multiplier is now increased by 5%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase creating speed permanently by 15%", " increases your creating speed permanently by 15%.", GodPowerUi.marginTop, 5, style, delegate
            {
                App.State.PremiumBoni.AddCreationSpeed(15);
                GuiBase.ShowToast("Your creating speed multiplier is now increased by 15%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase creating speed permanently by 35%", " increases your creating speed permanently by 35%.", GodPowerUi.marginTop, 10, style, delegate
            {
                App.State.PremiumBoni.AddCreationSpeed(35);
                GuiBase.ShowToast("Your creating speed multiplier is now increased by 35%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase creating speed permanently by 350%", " increases your creating speed permanently by 350%.", GodPowerUi.marginTop, 100, style, delegate
            {
                App.State.PremiumBoni.AddCreationSpeed(350);
                GuiBase.ShowToast("Your creating speed multiplier is now increased by 350%!");
            });
            GodPowerUi.marginTop += 20;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase building speed permanently by 2%", " increases your building speed permanently by 2%.", GodPowerUi.marginTop, 1, style, delegate
            {
                App.State.PremiumBoni.AddBuildingSpeed(2);
                GuiBase.ShowToast("Your building speed multiplier is now increased by 2%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase building speed permanently by 5%", " increases your building speed permanently by 5%.", GodPowerUi.marginTop, 2, style, delegate
            {
                App.State.PremiumBoni.AddBuildingSpeed(5);
                GuiBase.ShowToast("Your building speed multiplier is now increased by 5%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase building speed permanently by 15%", " increases your building speed permanently by 15%.", GodPowerUi.marginTop, 5, style, delegate
            {
                App.State.PremiumBoni.AddBuildingSpeed(15);
                GuiBase.ShowToast("Your building speed multiplier is now increased by 15%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase building speed permanently by 35%", " increases your building speed permanently by 35%.", GodPowerUi.marginTop, 10, style, delegate
            {
                App.State.PremiumBoni.AddBuildingSpeed(35);
                GuiBase.ShowToast("Your building speed multiplier is now increased by 35%!");
            });
            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase building speed permanently by 350%", " increases your building speed permanently by 350%.", GodPowerUi.marginTop, 100, style, delegate
            {
                App.State.PremiumBoni.AddBuildingSpeed(350);
                GuiBase.ShowToast("Your building speed multiplier is now increased by 350%!");
            });
            GodPowerUi.marginTop += 20;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Double your statistic multi (currently: " + App.State.PremiumBoni.StatisticMulti.GuiText + " x)", "your statistic multi will double. (It still can't be higher than your god multi, so only buy it, if you feel like your god multi outruns your statistic multi by far)", GodPowerUi.marginTop, 50, style, delegate
            {
                App.State.PremiumBoni.StatisticMulti = App.State.PremiumBoni.StatisticMulti * 2;
                GuiBase.ShowToast("Your statistic multi is now twice as high!");
            });
            GodPowerUi.marginTop += 20;
            GodPowerUi.marginTop  = GodPowerUi.AddItem(string.Concat(new object[]
            {
                "Increase the count of creations per bar by one. \nYou need to be able to afford it or nothing will be created.\nCurrently you can create up to ",
                App.State.PremiumBoni.CreationCountBoni(true).ToInt() + 1,
                " (",
                App.State.PremiumBoni.CreationCountBoni(false).ToInt() + 1,
                " from god power) at once."
            }), "increases the count you create for each progressbar in 'Create' by one.", GodPowerUi.marginTop, 50, style, delegate
            {
                App.State.PremiumBoni.AddCreationCountBoni(1);
                GuiBase.ShowToast("You can now create more items for each progress!");
            });
            GodPowerUi.marginTop += 100;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase your maximum Clones by 1 instantly.\nAlso increases your soft cap by 1.", "increases your maximum clones by 1.", GodPowerUi.marginTop, 1, style, delegate
            {
                App.State.Clones.MaxShadowClones += 1;
                App.State.Clones.AbsoluteMaximum++;
                GuiBase.ShowToast("Your maximum clones are increased by 1!");
            });
            GodPowerUi.marginTop += 25;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase your maximum Clones by 1000 instantly.\nAlso increases your soft cap by 1000.", "increases your maximum clones by 1000.", GodPowerUi.marginTop, 3, style, delegate
            {
                App.State.Clones.MaxShadowClones += 1000;
                App.State.Clones.AbsoluteMaximum += 1000;
                GuiBase.ShowToast("Your maximum clones are increased by 1000!");
            });
            GodPowerUi.marginTop += 25;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase your maximum Clones by 10000 instantly.\nAlso increases your soft cap by 10000.", "increases your maximum clones by 10000.", GodPowerUi.marginTop, 25, style, delegate
            {
                App.State.Clones.MaxShadowClones += 10000;
                App.State.Clones.AbsoluteMaximum += 10000;
                GuiBase.ShowToast("Your maximum clones are increased by 10000!");
            });
            GodPowerUi.marginTop += 25;
            GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase your maximum Clones by 100,000 instantly.\nAlso increases your soft cap by 100,000.", "increases your maximum clones by 100,000.", GodPowerUi.marginTop, 250, style, delegate
            {
                App.State.Clones.MaxShadowClones += 100000;
                App.State.Clones.AbsoluteMaximum += 100000;
                GuiBase.ShowToast("Your maximum clones are increased by 100,000!");
            });
            if (App.State.Statistic.HighestGodDefeated >= 28)
            {
                if (App.State.PremiumBoni.TbsMissreduction < 80)
                {
                    GodPowerUi.marginTop += 25;
                    GodPowerUi.marginTop  = GodPowerUi.AddItem("Reduce the chance to lose a level on the TBS - Game when you miss by 5%.", "decreases the chance to lose points after a miss in the TBS - Game by 5%. (20% is minimum).", GodPowerUi.marginTop, 10, style, delegate
                    {
                        App.State.PremiumBoni.TbsMissreduction += 5;
                        GuiBase.ShowToast("The chance to lose a level if you miss in the TBS - Game is reduced by 5%!");
                    });
                }
                if (App.State.PremiumBoni.TbsProgressAfterRebirth < 80)
                {
                    GodPowerUi.marginTop += 25;
                    GodPowerUi.marginTop  = GodPowerUi.AddItem("Keep 10% of your levels from the TBS - Game even after rebirthing.", "you will Keep 10% more of your levels from the TBS - Game after rebirthing. (80% is maximum)", GodPowerUi.marginTop, 10, style, delegate
                    {
                        App.State.PremiumBoni.TbsProgressAfterRebirth += 10;
                        GuiBase.ShowToast("You keep 10% more of your levels after rebirthing!");
                    });
                }
                if (App.State.PremiumBoni.TbsDoublePoints < 100)
                {
                    GodPowerUi.marginTop += 25;
                    GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase the chance to score twice as much points in TBS by 5%.", "your chance to score double points in TBS after a hit will increase by 5 %", GodPowerUi.marginTop, 5, style, delegate
                    {
                        App.State.PremiumBoni.TbsDoublePoints += 5;
                        GuiBase.ShowToast("Your chance to score double points in TBS is increased by 5%!");
                    });
                }
                if (App.State.PremiumBoni.TbsExtraPixels < 3)
                {
                    GodPowerUi.marginTop += 25;
                    GodPowerUi.marginTop  = GodPowerUi.AddItem("Increase the white area for TBS by 1 pixel.", "the current (and also the minimum) width of the white area in the TBS-Game will be increased by 1 pixel", GodPowerUi.marginTop, 33, style, delegate
                    {
                        App.State.PremiumBoni.TbsExtraPixels++;
                        GuiBase.ShowToast("The current (and also the minimum) width of the white area in TBS is increased by 1 pixel!");
                    });
                }
            }
            string str = "male";

            if (App.State.Avatar.IsFemale)
            {
                str = "female";
            }
            GodPowerUi.marginTop += 20;
            if (!App.State.PremiumBoni.HasUnlimitedGenderChange)
            {
                GodPowerUi.marginTop = GodPowerUi.AddItem("Change your gender. Your current gender is " + str, "you can choose your gender again.", GodPowerUi.marginTop, 20, style, delegate
                {
                    App.State.Avatar.GenderChosen    = false;
                    App.State.GameSettings.AvaScaled = false;
                    HeroImage.Init(true);
                });
                GodPowerUi.marginTop += 30;
                GodPowerUi.marginTop  = GodPowerUi.AddItem("Change your name. Your current name is " + App.State.AvatarName, "you can rename your character.", GodPowerUi.marginTop, 20, style, delegate
                {
                    App.State.ChangeAvatarName = true;
                });
            }
            else
            {
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(390f), GuiBase.Height(100f)), "Change your gender. Your current gender is " + str);
                if (GUI.Button(new Rect(GuiBase.Width(420f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Change")))
                {
                    App.State.Avatar.GenderChosen    = false;
                    App.State.GameSettings.AvaScaled = false;
                    HeroImage.Init(true);
                }
                GodPowerUi.marginTop += 40;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(390f), GuiBase.Height(100f)), "Change your name. Your current name is " + App.State.AvatarName);
                if (GUI.Button(new Rect(GuiBase.Width(420f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Change")))
                {
                    App.State.ChangeAvatarName = true;
                }
            }
            GodPowerUi.marginTop += 40;
            if (App.State.PremiumBoni.AutoBuyCostReduction < 20)
            {
                GodPowerUi.marginTop += 10;
                GodPowerUi.marginTop  = GodPowerUi.AddItem("Decrease Auto buy cost. Currently you pay " + (120 - App.State.PremiumBoni.AutoBuyCostReduction) + " %.", "decreases the cost for auto buy by 1%.", GodPowerUi.marginTop, 3, style, delegate
                {
                    App.State.PremiumBoni.AutoBuyCostReduction++;
                });
            }
            if (!App.State.PremiumBoni.HasPetHalfStats)
            {
                GodPowerUi.marginTop += 20;
                GodPowerUi.marginTop  = GodPowerUi.AddItem("Pet half stats. This will unlock a button to create clones with half the stats of your pets.", "adds a button 'Half stats' and 'Half stats for all' to the clone creation screen of your pets.", GodPowerUi.marginTop, 100, style, delegate
                {
                    App.State.PremiumBoni.HasPetHalfStats = true;
                    GuiBase.ShowToast("You can now adjust the stats of your clones with one button! It might not be the most effective way but its fast and easy.");
                });
                GodPowerUi.marginTop += 20;
            }
            else
            {
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(550f), GuiBase.Height(50f)), "Pet half stats is already bought");
                GodPowerUi.marginTop += 20;
            }
            if (!App.State.PremiumBoni.ImprovedNextAt)
            {
                GodPowerUi.marginTop += 20;
                GodPowerUi.marginTop  = GodPowerUi.AddItem("Improved 'Next at'. With this your clones will stay at the current skill until a next one is available!", "the 'Next at'-option won't remove clones if there is no skill unlocked.", GodPowerUi.marginTop, 99, style, delegate
                {
                    App.State.PremiumBoni.ImprovedNextAt = true;
                    GuiBase.ShowToast("Now you can say good bye to micromanaging skills. Just have 'Next at' on with a low value until all skills / trainings are unlocked.");
                });
            }
            else
            {
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(550f), GuiBase.Height(50f)), "Improved 'Next at' is already bought");
                GodPowerUi.marginTop += 20;
            }
            if (!App.State.PremiumBoni.CanShowAlerts)
            {
                GodPowerUi.marginTop += 20;
                GodPowerUi.marginTop  = GodPowerUi.AddItem("Show an alert button if your divinity generator is empty or you can feed your pets.", "a button will show up below the achievement toggle, if your divinity generator is empty or your pets can be fed.", GodPowerUi.marginTop, 50, style, delegate
                {
                    App.State.PremiumBoni.CanShowAlerts = true;
                    GuiBase.ShowToast("Now a button will be shown, if your divinity generator is empty or your pets can be fed.");
                });
            }
            else
            {
                GodPowerUi.marginTop += 20;
                GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(550f), GuiBase.Height(50f)), "The alert button is already bought");
                GodPowerUi.marginTop += 20;
            }
            GodPowerUi.marginTop += 35;
            style.fontStyle       = FontStyle.Bold;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(550f), GuiBase.Height(50f)), "The offers below are temporary and lost when you rebirth.");
            style.fontStyle       = FontStyle.Normal;
            GodPowerUi.marginTop += 35;
            CDouble newClones = App.State.Clones.MaxShadowClones - App.State.Clones.Count;

            if (newClones > 99999)
            {
                newClones = 99999;
            }
            GodPowerUi.marginTop = GodPowerUi.AddItem("Create up to 99999 Shadow Clones at once! \nThis can't be higher than your maximum clones.", " will let you create " + newClones + " shadow clones at once.", GodPowerUi.marginTop, 3, style, delegate
            {
                App.State.Clones.Count += newClones;
                App.State.Clones.TotalClonesCreated          += newClones;
                App.State.Statistic.TotalShadowClonesCreated += newClones;
                if (App.State.Clones.Count > App.State.Clones.MaxShadowClones)
                {
                    App.State.Clones.Count = App.State.Clones.MaxShadowClones;
                }
                GuiBase.ShowToast("You created " + newClones + " shadow clones at once!");
            });
            GodPowerUi.marginTop += 20;
            CDouble divinityToGet = App.State.DivinityGainSec(true) * 3600;

            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase your 'Divinity' by " + divinityToGet.ToGuiText(true), " will increase your current 'Divinity' by " + divinityToGet.ToGuiText(true), GodPowerUi.marginTop, 1, style, delegate
            {
                App.State.Money += divinityToGet;
                GuiBase.ShowToast("Your 'Divinity' is increased by " + divinityToGet.ToGuiText(true));
            });
            CDouble divinityV2 = divinityToGet * 4;

            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase your 'Divinity' by " + divinityV2.ToGuiText(true), " will increase your current 'Divinity' by " + divinityV2.ToGuiText(true), GodPowerUi.marginTop, 3, style, delegate
            {
                App.State.Money += divinityV2;
                GuiBase.ShowToast("Your 'Divinity' is increased by " + divinityV2.ToGuiText(true));
            });
            CDouble divinityV3 = divinityToGet * 8;

            GodPowerUi.marginTop = GodPowerUi.AddItem("Increase your 'Divinity' by " + divinityV3.ToGuiText(true), " will increase your current 'Divinity' by " + divinityV3.ToGuiText(true), GodPowerUi.marginTop, 5, style, delegate
            {
                App.State.Money += divinityV3;
                GuiBase.ShowToast("Your 'Divinity' is increased by " + divinityV3.ToGuiText(true));
            });
            GUI.EndScrollView();
        }
Exemplo n.º 11
0
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (TrainingUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         TrainingUi.scrollBarsToZero = false;
     }
     if (this.updateTime == 60)
     {
         this.totalPhysicalGain = new CDouble();
     }
     using (List <Training> .Enumerator enumerator = App.State.AllTrainings.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Training training = enumerator.Current;
             labelStyle.fontSize = GuiBase.FontSize(16);
             double percent = 0.0;
             if (training.CapCount > 1)
             {
                 percent = training.getPercent();
             }
             GuiBase.CreateProgressBar(marginTop, percent, training.Name, training.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
             GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), string.Empty + training.LevelText);
             GUI.Label(new Rect(GuiBase.Width(330f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + training.ShadowCloneCount);
             if (training.IsAvailable)
             {
                 if (this.updateTime == 60 && training.ShadowCloneCount > 0)
                 {
                     int num = training.ShadowCloneCount.ToInt();
                     if (training.CapCount < num)
                     {
                         num = training.CapCount;
                     }
                     this.totalPhysicalGain += training.PowerGainInSec(num);
                 }
                 if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
                 {
                     int value = App.State.GameSettings.ClonesToAddCount;
                     if (Event.current.button == 1)
                     {
                         value = 28;
                     }
                     training.AddCloneCount(value);
                     if (App.State.GameSettings.SyncTrainingSkill)
                     {
                         Skill skill = App.State.AllSkills.FirstOrDefault((Skill x) => x.TypeEnum == (Skill.SkillType)training.TypeEnum);
                         if (skill != null && skill.IsAvailable)
                         {
                             skill.AddCloneCount(value);
                         }
                     }
                 }
                 if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
                 {
                     training.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
                     if (App.State.GameSettings.SyncTrainingSkill)
                     {
                         Skill skill2 = App.State.AllSkills.FirstOrDefault((Skill x) => x.TypeEnum == (Skill.SkillType)training.TypeEnum);
                         if (skill2 != null && skill2.IsAvailable)
                         {
                             skill2.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
                         }
                     }
                 }
                 if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), "CAP"))
                 {
                     Skill skill3 = null;
                     if (App.State.GameSettings.SyncTrainingSkill)
                     {
                         skill3 = App.State.AllSkills.FirstOrDefault((Skill x) => x.TypeEnum == (Skill.SkillType)training.TypeEnum);
                     }
                     training.RemoveCloneCount(9999999);
                     if (skill3 != null && skill3.IsAvailable)
                     {
                         skill3.RemoveCloneCount(9999999);
                     }
                     int num2 = App.State.Clones.IdleClones();
                     if (skill3 != null && skill3.IsAvailable)
                     {
                         num2 /= 2;
                     }
                     if (num2 > 0)
                     {
                         int num3 = training.DurationInMS(1) / 30 + 1;
                         int i    = num3;
                         int num4 = 2;
                         while (i > num2)
                         {
                             i = num3 / num4 + 1;
                             num4++;
                             if (num4 > App.State.Clones.MaxShadowClones)
                             {
                                 return;
                             }
                         }
                         training.AddCloneCount(i);
                         if (skill3 != null && skill3.IsAvailable)
                         {
                             skill3.AddCloneCount(i);
                         }
                     }
                 }
             }
             marginTop += 35;
         }
     }
     if (this.updateTime == 60)
     {
         this.updateTime = 0;
     }
     this.updateTime++;
 }
 public void UpdateProgress()
 {
     if (this.isFlying)
     {
         long num = UpdateStats.CurrentTimeMillis() - this.timeMs;
         this.timeMs     = UpdateStats.CurrentTimeMillis();
         this.multi      = (float)(num / 12L);
         this.marginTop += 3f * this.multi;
         this.time      += num;
         this.timeCloud += num;
         int num2 = -1;
         if (this.time > this.newBoulderTimer && this.boss == null)
         {
             this.time = 0L;
             float num3 = (float)UnityEngine.Random.Range(40, 100);
             this.AllBoulders.Add(new AreaGodlyShoot.Element(this.ImageBoulder, (float)UnityEngine.Random.Range(0, 1200), -200f, num3, num3));
         }
         if (this.boss != null)
         {
             this.bossShootTimer         += num;
             this.bossSpecialAttackTimer += num;
             if (this.bossShootTimer > this.bossShoot)
             {
                 if (this.boss.CurrentLevel.ToInt() > 4)
                 {
                     int num4 = 50;
                     if (this.LaserIndexV2 && this.boss.CurrentLevel.ToInt() > 5)
                     {
                         num4 = 10;
                     }
                     this.Lasers.Add(new AreaGodlyShoot.Element(this.ImageLaser, (float)(num4 + this.LaserIndex * 100), -400f, 100f, 364f));
                     this.LaserIndex++;
                     if (this.LaserIndex > 4)
                     {
                         this.LaserIndexV2 = !this.LaserIndexV2;
                         this.LaserIndex   = 0;
                     }
                 }
                 this.bossShootTimer = 0L;
                 this.BossShoots.Add(new AreaGodlyShoot.Element(this.ImageBossShoot, this.boss.marginLeft, this.boss.marginTop + this.boss.height * 0.44f, 90f, 50f));
             }
             if (this.bossSpecialAttackTimer > this.bossSpecialAttack)
             {
                 this.bossSpecialAttackTimer = 0L;
                 for (int i = 0; i < 15; i++)
                 {
                     this.AllBoulders.Add(new AreaGodlyShoot.Element(this.ImageBoulder, (float)(500 + i * 50), (float)(i * 50 - 300), 150f, 150f));
                 }
                 if (this.boss.CurrentLevel.ToInt() > 2)
                 {
                     for (int j = 0; j < 15; j++)
                     {
                         this.AllBoulders.Add(new AreaGodlyShoot.Element(this.ImageBoulder, (float)(400 + j * 50), (float)(j * 50 - 300), 150f, 150f));
                     }
                 }
                 if (this.boss.CurrentLevel.ToInt() > 3)
                 {
                     for (int k = 0; k < 15; k++)
                     {
                         this.AllBoulders.Add(new AreaGodlyShoot.Element(this.ImageBoulder, (float)(300 + k * 50), (float)(k * 50 - 300), 150f, 150f));
                     }
                 }
             }
             for (int l = 0; l < this.BossShoots.Count; l++)
             {
                 AreaGodlyShoot.Element element = this.BossShoots[l];
                 if (element.Check(this.Player))
                 {
                     this.EndGame();
                     return;
                 }
                 if (element.marginLeft < -50f)
                 {
                     num2 = l;
                 }
                 element.Shoot(-8f * this.multi);
             }
             if (num2 != -1 && num2 < this.BossShoots.Count)
             {
                 this.BossShoots.RemoveAt(num2);
             }
             int num5 = 3 + this.boss.CurrentLevel.ToInt();
             if (num5 > 10)
             {
                 num5 = 10;
             }
             this.boss.Move((float)num5 * this.multi);
             num2 = -1;
             for (int m = 0; m < this.Lasers.Count; m++)
             {
                 AreaGodlyShoot.Element element2 = this.Lasers[m];
                 if (element2 != null)
                 {
                     if (element2.Check(this.Player))
                     {
                         this.EndGame();
                         return;
                     }
                     element2.ShootDown(20f * this.multi);
                     if (element2.marginTop > 800f)
                     {
                         num2 = m;
                     }
                 }
             }
             if (num2 != -1 && num2 < this.Lasers.Count)
             {
                 this.Lasers.RemoveAt(num2);
             }
         }
         if (this.timeCloud > this.newCloudTimer)
         {
             this.newCloudTimer = (long)UnityEngine.Random.Range(800, 2400);
             this.timeCloud     = 0L;
             this.AddCloud(960f);
         }
         for (int n = 0; n < this.AllShots.Count; n++)
         {
             AreaGodlyShoot.Element element3 = this.AllShots[n];
             if (this.boss != null && element3.Check(this.boss) && this.boss.GetHit())
             {
                 this.Points += this.boss.CurrentLevel * 50;
                 this.Points *= 1.2;
                 this.boss.UpgradeLevel();
             }
             for (int num6 = 0; num6 < this.AllBoulders.Count; num6++)
             {
                 if (element3.Check(this.AllBoulders[num6]))
                 {
                     this.AllBoulders.RemoveAt(num6);
                     this.Points = ++this.Points;
                     break;
                 }
             }
             if (GuiBase.Width((float)((int)element3.marginLeft)) > GuiBase.Width(900f))
             {
                 this.AllShots.RemoveAt(n);
                 break;
             }
             element3.Shoot(12f * this.multi);
         }
         if (this.boss != null && this.boss.Check(this.Player))
         {
             this.EndGame();
             return;
         }
         num2 = -1;
         for (int num7 = 0; num7 < this.AllBoulders.Count; num7++)
         {
             AreaGodlyShoot.Element element4 = this.AllBoulders[num7];
             if (element4.Check(this.Player))
             {
                 this.EndGame();
                 return;
             }
             if (element4.marginLeft < -50f)
             {
                 num2 = num7;
             }
             element4.Fall(3f * this.multi);
         }
         if (num2 != -1 && num2 < this.AllBoulders.Count)
         {
             this.AllBoulders.RemoveAt(num2);
         }
         num2 = -1;
         for (int num8 = 0; num8 < this.AllClouds.Count; num8++)
         {
             AreaGodlyShoot.Element element5 = this.AllClouds[num8];
             if (element5.marginLeft < -50f)
             {
                 num2 = num8;
             }
             element5.Move((float)UnityEngine.Random.Range(0, 4));
         }
         if (num2 != -1 && num2 < this.AllClouds.Count)
         {
             this.AllClouds.RemoveAt(num2);
         }
     }
     if (this.marginTop > 500f || this.marginLeft < -20f || this.marginLeft > 890f || this.marginTop < -20f)
     {
         this.EndGame();
     }
 }
 public void UpgradeLevel()
 {
     this.CurrentLevel = ++this.CurrentLevel;
     this.MaxHp        = this.CurrentLevel * 50;
     this.CurrentHP    = this.MaxHp;
 }
Exemplo n.º 14
0
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (FightingUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         FightingUi.scrollBarsToZero = false;
     }
     if (this.updateTime == 60)
     {
         this.totalBattleGain = new CDouble();
     }
     foreach (Fight current in App.State.AllFights)
     {
         labelStyle.fontSize = GuiBase.FontSize(16);
         GuiBase.CreateProgressBar(marginTop, current.getPercentOfHP(), current.Name, current.Description, GuiBase.progressBg, GuiBase.progressFgRed);
         GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)(marginTop + 3)), GuiBase.Width(110f), GuiBase.Height(30f)), current.LevelText, labelStyle);
         GUI.Label(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(marginTop + 3)), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + current.ShadowCloneCount, labelStyle);
         if (current.IsAvailable)
         {
             if (this.updateTime == 60 && current.ShadowCloneCount > 0)
             {
                 this.totalBattleGain += current.PowerGainInSec(current.ShadowCloneCount);
             }
             if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
             {
                 if (Event.current.button == 1)
                 {
                     current.AddCloneCount(34);
                 }
                 else
                 {
                     current.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
                 }
             }
             if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
             {
                 current.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
             }
             if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), "CAP"))
             {
                 int num = ((167 * current.MaxHealth - 1 + current.Defense) / (App.State.CloneAttack + 1)).ToNextInt();
                 if (num <= 0)
                 {
                     num = 1;
                 }
                 else if (num > App.State.Clones.IdleClones() + current.ShadowCloneCount)
                 {
                     num = App.State.Clones.IdleClones() + current.ShadowCloneCount.ToInt();
                 }
                 current.RemoveCloneCount(current.ShadowCloneCount);
                 current.AddCloneCount(num);
             }
         }
         marginTop += 35;
     }
     if (this.updateTime == 60)
     {
         this.updateTime = 0;
     }
     this.updateTime++;
 }
 private void BuyCount(CDouble count)
 {
     this.countToBuy = count.Serialize();
 }
Exemplo n.º 16
0
 protected void ShowNumberInput(string calculatorText, CDouble calculatorNumber, CDouble calculatorMaxNumber, Action <CDouble> calculatorAction)
 {
     GuiBase.NumberInputAction    = calculatorAction;
     GuiBase.NumberInputText      = calculatorText;
     GuiBase.NumberInputMaxNumber = calculatorMaxNumber;
     GuiBase.NumberInputNumber    = calculatorNumber;
 }
Exemplo n.º 17
0
        private void CalcCreations(long timeMS, StringBuilder infoBuilder)
        {
            CDouble cDouble = this.State.CreationSpeed(timeMS) / 3L;
            long    num     = timeMS;
            bool    flag    = false;

            if ((this.State.GameSettings.LastCreation != null && this.State.GameSettings.LastCreation.TypeEnum == Creation.CreationType.Shadow_clone) || (this.State.GameSettings.CreateShadowClonesIfNotMax && this.State.Clones.Count < this.State.Clones.MaxShadowClones))
            {
                flag = true;
            }
            if (flag)
            {
                Creation creation = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Shadow_clone);
                Creation.UpdateDurationMulti(this.State);
                CDouble cDouble2 = cDouble / creation.DurationInMS * (this.State.PremiumBoni.CreationCountBoni(true) + 1);
                if (cDouble2 > timeMS / 30L * (this.State.PremiumBoni.CreationCountBoni(true) + 1))
                {
                    cDouble2 = timeMS / 30L * (this.State.PremiumBoni.CreationCountBoni(true) + 1);
                }
                if (cDouble2 > 0)
                {
                    CDouble cDouble3 = timeMS / cDouble2;
                    bool    flag2    = this.State.GameSettings.LastCreation != null && this.State.GameSettings.LastCreation.TypeEnum == Creation.CreationType.Shadow_clone;
                    if (cDouble2 + creation.Count > this.State.Clones.MaxShadowClones && this.State.GameSettings.CreateShadowClonesIfNotMax && !flag2)
                    {
                        cDouble2 = this.State.Clones.MaxShadowClones - creation.Count;
                        num     -= cDouble2.ToLong() * cDouble3.ToLong();
                    }
                    creation.TotalCreated += cDouble2;
                    this.State.Clones.TotalClonesCreated          += cDouble2;
                    this.State.Statistic.TotalShadowClonesCreated += cDouble2;
                    if (cDouble2 > 0)
                    {
                        infoBuilder.Append("- created ").Append(cDouble2.GuiText).Append(" Shadow Clones\n");
                    }
                    if (this.State.Clones.Count + cDouble2 > this.State.Clones.MaxShadowClones)
                    {
                        cDouble2 = this.State.Clones.MaxShadowClones - this.State.Clones.Count;
                    }
                    this.State.Clones.Count = this.State.Clones.Count + cDouble2.ToInt();
                    if (this.State.Clones.Count < this.State.Clones.MaxShadowClones)
                    {
                        num = 0L;
                    }
                }
            }
            if (this.State.GameSettings.LastCreation != null && this.State.GameSettings.LastCreation.TypeEnum != Creation.CreationType.Shadow_clone && App.CurrentPlattform == Plattform.Android)
            {
                while (num > 0L)
                {
                    cDouble = this.State.CreationSpeed(num) / 3L;
                    Creation creation2 = this.State.GameSettings.LastCreation;
                    CDouble  cDouble4  = creation2.DurationInMS;
                    if (cDouble4 < 30)
                    {
                        cDouble4 = 30;
                    }
                    CDouble cDouble5 = cDouble / cDouble4;
                    if (cDouble5 < 1)
                    {
                        creation2.currentDuration += cDouble.ToLong();
                        break;
                    }
                    cDouble5.Round();
                    cDouble5 *= this.State.PremiumBoni.CreationCountBoni(true) + 1;
                    List <CreationCost> list = CreationCost.RequiredCreations(creation2.TypeEnum, cDouble5.ToLong(), true);
                    bool flag3 = true;
                    foreach (CreationCost current in list)
                    {
                        if (!CreationCost.HasCreations(this.State, current, this.State.GameSettings.AutoBuyCreations))
                        {
                            flag3 = false;
                        }
                    }
                    if (!flag3)
                    {
                        cDouble5 = this.State.GameSettings.CreationToCreateCount;
                        if (cDouble5 == 0)
                        {
                            cDouble5 = 1;
                        }
                        list  = CreationCost.RequiredCreations(creation2.TypeEnum, cDouble5.ToLong(), true);
                        flag3 = true;
                        foreach (CreationCost current2 in list)
                        {
                            if (!CreationCost.HasCreations(this.State, current2, this.State.GameSettings.AutoBuyCreations))
                            {
                                flag3 = false;
                            }
                        }
                        if (flag3)
                        {
                            bool flag4 = true;
                            while (flag4)
                            {
                                cDouble5 *= 2;
                                list      = CreationCost.RequiredCreations(creation2.TypeEnum, cDouble5.ToLong(), true);
                                foreach (CreationCost current3 in list)
                                {
                                    if (!CreationCost.HasCreations(this.State, current3, this.State.GameSettings.AutoBuyCreations))
                                    {
                                        flag4     = false;
                                        cDouble5 /= 2;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (!flag3)
                    {
                        infoBuilder.Append("- you failed to create " + creation2.Name + " because of missing prerequisites or divinity, so you created stones instead.\n");
                        list      = new List <CreationCost>();
                        creation2 = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Stone);
                        cDouble4  = creation2.DurationInMS;
                        if (cDouble4 < 30)
                        {
                            cDouble4 = 30;
                        }
                        cDouble5 = cDouble / cDouble4 * (this.State.PremiumBoni.CreationCountBoni(true) + 1);
                    }
                    CDouble cDouble6 = cDouble5 + creation2.Count;
                    CDouble cDouble7 = -1;
                    if (creation2.NextAtCount > 0)
                    {
                        if (this.State.GameSettings.CreationsNextAtMode == 1)
                        {
                            cDouble7 = creation2.NextAtCount - creation2.Count;
                        }
                        else if (this.State.GameSettings.CreationsNextAtMode == 2)
                        {
                            cDouble7 = creation2.NextAtCount - creation2.TotalCreated;
                        }
                    }
                    if (cDouble7 != -1 && cDouble5 > cDouble7 && flag3)
                    {
                        if (cDouble7 > 0)
                        {
                            cDouble5 = cDouble7;
                            CDouble cDouble8 = (cDouble5 * cDouble4 / (this.State.PremiumBoni.CreationCountBoni(true) + 1)).ToLong();
                            cDouble8 = cDouble8 / this.State.PremiumBoni.CreationDopingDivider / (100 + this.State.PremiumBoni.CreatingSpeedUpPercent(true)) * 100;
                            num     -= cDouble8.ToLong();
                        }
                        else
                        {
                            cDouble5 = 0;
                        }
                    }
                    else
                    {
                        num = 0L;
                    }
                    if (num > 0L && this.State.GameSettings.LastCreation.TypeEnum != Creation.CreationType.Universe)
                    {
                        Creation creation3 = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == this.State.GameSettings.LastCreation.TypeEnum + 1);
                        if (!creation3.GodToDefeat.IsDefeated)
                        {
                            break;
                        }
                        this.State.GameSettings.LastCreation = creation3;
                    }
                    else
                    {
                        num = 0L;
                    }
                    if (cDouble5 > 1)
                    {
                        list = CreationCost.RequiredCreations(creation2.TypeEnum, cDouble5.ToLong(), true);
                        using (List <CreationCost> .Enumerator enumerator4 = list.GetEnumerator())
                        {
                            while (enumerator4.MoveNext())
                            {
                                CreationCost cost      = enumerator4.Current;
                                Creation     creation4 = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                                creation4.Count -= cost.CountNeeded;
                                if (creation4.Count < 0)
                                {
                                    Log.Info(string.Concat(new object[]
                                    {
                                        creation4.Name,
                                        " had ",
                                        creation4.Count,
                                        "!"
                                    }));
                                    creation4.Count = 0;
                                }
                            }
                        }
                        cDouble5.Floor();
                        creation2.Count        += cDouble5;
                        creation2.TotalCreated += cDouble5;
                        this.State.CheckForAchievement(creation2);
                        this.State.CheckForAchievement(creation2);
                        this.State.CheckForAchievement(creation2);
                        infoBuilder.Append("- you created ").Append(cDouble5.GuiText).Append(" " + creation2.Name + "\n\n");
                    }
                }
                num = 0L;
            }
            if (this.State.Statistic.HasStartedUniverseChallenge)
            {
                Creation creation5 = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Universe);
                creation5.FinishUUC(this.State);
            }
        }
Exemplo n.º 18
0
        protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
        {
            if (this.showInfo)
            {
                labelStyle.alignment = TextAnchor.UpperLeft;
                string text = "\r\nYou can adjust defender clones who will defend against incoming ultimate beings. This fight is just like if you attack them by yourself, but you won't lose hp.\r\nIf you win, you will receive Energy. If you lose, they will steal level 1 crystals (1 - 5 or each kind depending on the UB who attacks) and energy. With energy you can upgrade your modules. If you have upgraded modules, you can adjust shadow clones and they will produce crystals every 10 minutes with the same kind of the module.\r\nYour modules will still generate crystals when you are offline, but UBs won't attack you.\r\n\r\nThey will always produce level 1 crystals which can be upgraded if you have enough of them. You will lose crystals depending on a percentage basis which increases by 5% after every upgrade.\r\nWhen you upgrade crystals, there are two buttons. 'Upgrade Opt' will upgrade your crystals so you won't lose any crystal. For example an ultimate crystal starts at 60%. That means if you have have 8 crystals, only the 'Upgrade All' button is available.  After clicking it, you will lose 4 crystals because 60% of 8 is 4.8 and the number is rounded down.\r\nIf you have at least 10, the 'Upgrade Opt' will appear and would upgrade 6 out of 10 with 4 crystals lost. If you have 11, it would upgrade still 10 with 4 lost and it keeps 1 left over.\r\n\r\nIf you equip crystals, you will get a boost which is shown in their tooltip. You can only equip one of a kind, and the highest grade will be equipped. If you upgrade a crystal of the same kind later to a higher grade, you need to unequip your old one and equip it again for the higher grade to take effect.\r\nYou can only equip 2 different crystals at the beginning. This can be increased if you buy a slot upgrade until at most 6 slots. There is also a very rare chance to receive a slot upgrade with a lucky draw.\r\nWhen you rebirth, all your equipped crystals will give you crystal power depending on their grade. Your crystal power increases various stats which is shown in the god power page.\r\n";
                this.scrollViewHeight = (int)labelStyle.CalcHeight(new GUIContent(text), GuiBase.Width(600f));
                GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)(marginTop - 2)), GuiBase.Width(600f), (float)this.scrollViewHeight), text, labelStyle);
                return;
            }
            double percent = 1.0;

            if (App.State.Ext.Factory.TimeUntilAttack > 0L)
            {
                percent = 1.0 - (double)App.State.Ext.Factory.TimeUntilAttack / 3600000.0;
            }
            string str = string.Empty;

            if (App.State.PremiumBoni.CrystalBonusDefender > 0)
            {
                str = "\nDefender clones will only take " + (100 - App.State.PremiumBoni.CrystalBonusDefender) + " % damage because of equipped crystals.";
            }
            GuiBase.CreateProgressBar(marginTop, percent, "Defender Clones", "Ultimate beings will attack your crystal factory 10 minutes after they become available to fight in the UBs-Tab.\nIf two are available at the same time, there will be a pause of 10 minutes after each fight.\nIf your clones defeat them, you will get the same boost as if you would fight them yourself.\nIf you lose, they will steal some of your energy or level 1 crystals!" + str, GuiBase.progressBg, GuiBase.progressFgRed);
            if (App.State.Ext.Factory.DefenderFightsText.Length > 0 && GUI.Button(new Rect(GuiBase.Width(260f), GuiBase.Height((float)marginTop), GuiBase.Width(60f), GuiBase.Height(30f)), new GUIContent("Log", "Shows a short log of the last UB battles vs your defender clones.")))
            {
                GuiBase.ShowBigMessage(App.State.Ext.Factory.DefenderFightsText.ToString());
                App.State.Ext.Factory.DefenderFightsText = new StringBuilder();
            }
            labelStyle.alignment = TextAnchor.MiddleCenter;
            GUI.Label(new Rect(GuiBase.Width(340f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), App.State.Ext.Factory.DefenderClones.CommaFormatted, labelStyle);
            labelStyle.alignment = TextAnchor.UpperLeft;
            if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
            {
                App.State.Ext.Factory.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
            }
            if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
            {
                App.State.Ext.Factory.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
            }
            marginTop += 35;
            if (App.State.Statistic.HasStarted1kChallenge)
            {
                GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(500f), GuiBase.Height(30f)), "UBs won't attack in 1KC.", labelStyle);
            }
            else
            {
                GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(500f), GuiBase.Height(30f)), "Next UB attack in: " + Conv.MsToGuiText(App.State.Ext.Factory.TimeUntilAttack, true), labelStyle);
            }
            App.State.GameSettings.AutofillDefenders = GUI.Toggle(new Rect(GuiBase.Width(340f), GuiBase.Height((float)(marginTop + 5)), GuiBase.Width(100f), GuiBase.Height(30f)), App.State.GameSettings.AutofillDefenders, new GUIContent("Autofill", "Automatically fills up your defender clones if you have enough idle clones up to this number"));
            int num = (App.State.Clones.MaxShadowClones - App.State.GameSettings.SavedClonesForFight).ToInt();

            if (App.CurrentPlattform == Plattform.Android)
            {
                GUIStyle textField = Gui.ChosenSkin.textField;
                if (GUI.Button(new Rect(GuiBase.Width(480f), GuiBase.Height((float)(marginTop + 3)), GuiBase.Width(100f), GuiBase.Height(25f)), App.State.GameSettings.MaxDefenderClones.ToString(), textField))
                {
                    base.ShowNumberInput("Maximum number of clones to autofill", App.State.GameSettings.MaxDefenderClones, num, delegate(CDouble x)
                    {
                        App.State.GameSettings.MaxDefenderClones = x.ToInt();
                    });
                }
            }
            else
            {
                string s = GUI.TextField(new Rect(GuiBase.Width(480f), GuiBase.Height((float)(marginTop + 5)), GuiBase.Width(100f), GuiBase.Height(25f)), App.State.GameSettings.MaxDefenderClones.ToString());
                int.TryParse(s, out App.State.GameSettings.MaxDefenderClones);
                if (App.State.GameSettings.MaxDefenderClones > num)
                {
                    App.State.GameSettings.MaxDefenderClones = num;
                }
                if (App.State.GameSettings.MaxDefenderClones < 0)
                {
                    App.State.GameSettings.MaxDefenderClones = 0;
                }
            }
            marginTop           += 40;
            labelStyle.fontSize  = GuiBase.FontSize(18);
            labelStyle.fontStyle = FontStyle.Bold;
            GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent("Energy", "Each UB you defeat will give you energy. You can use this energy to upgrade your modules."));
            GUI.Label(new Rect(GuiBase.Width(320f), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent(App.State.Ext.Factory.Energy.GuiText, string.Empty));
            labelStyle.fontStyle = FontStyle.Normal;
            labelStyle.fontSize  = GuiBase.FontSize(16);
            marginTop           += 40;
            labelStyle.alignment = TextAnchor.MiddleCenter;
            labelStyle.fontStyle = FontStyle.Bold;
            GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(185f), GuiBase.Height(30f)), new GUIContent("Modules", "You can produce crystals with each module. The count of the produced crystal to be produced is the same as the module level."));
            GUI.Label(new Rect(GuiBase.Width(227f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Level", "A module can only create level 1 crystals. For each level one crystal is produced for each progressbar filled.\nEach level also increases the upgrade chance of crystals of this kind by 1%. This increase is capped at 25% for god or ultimate modules, no cap for the others. The chance can't go lower than 5%, or higher is 95%"));
            GUI.Label(new Rect(GuiBase.Width(340f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Clones", "Adjusted clones will fill the module constantly with light, air and water so the module can produce crystals.\nThe first 4 modules need 10k clones,the ultimate module needs 30k, and the god module 50k for every level.\nClicking + or - will fill in all you need or remove all clones."));
            App.State.GameSettings.AutoBuyForCrystal = GUI.Toggle(new Rect(GuiBase.Width(450f), GuiBase.Height((float)(marginTop + 4)), GuiBase.Width(300f), GuiBase.Height(25f)), App.State.GameSettings.AutoBuyForCrystal, new GUIContent("Autobuy", "If this is on, and you have defeated Nephthys, the game will automatically buy the creations you need to produce crystals."));
            labelStyle.fontStyle = FontStyle.Normal;
            marginTop           += 35;
            foreach (FactoryModule current in App.State.Ext.Factory.AllModules)
            {
                if (current.Crystals.Count > 0)
                {
                }
                GuiBase.CreateProgressBar(marginTop, (double)current.CurrentDuration / (double)current.BaseDuration, current.Name + " Module", current.InfoText, GuiBase.progressBg, GuiBase.progressFgGreen);
                GUI.Label(new Rect(GuiBase.Width(227f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + current.LevelText, labelStyle);
                if (current.Level < current.MaxLevel && GUI.Button(new Rect(GuiBase.Width(225f), GuiBase.Height((float)marginTop), GuiBase.Width(35f), GuiBase.Height(30f)), "+"))
                {
                    current.ChangeLevel(true);
                    current.AddNeededClones();
                }
                if (current.Level > 1 && GUI.Button(new Rect(GuiBase.Width(300f), GuiBase.Height((float)marginTop), GuiBase.Width(35f), GuiBase.Height(30f)), "-"))
                {
                    current.ChangeLevel(false);
                    current.AddNeededClones();
                }
                if (current.MaxLevel > 0)
                {
                    GUI.Label(new Rect(GuiBase.Width(340f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), current.ShadowClones.CommaFormatted, labelStyle);
                    if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(35f), GuiBase.Height(30f)), "+"))
                    {
                        current.AddNeededClones();
                    }
                    if (GUI.Button(new Rect(GuiBase.Width(495f), GuiBase.Height((float)marginTop), GuiBase.Width(35f), GuiBase.Height(30f)), "-"))
                    {
                        current.RemoveAllClones();
                    }
                }
                else
                {
                    GUI.Label(new Rect(GuiBase.Width(365f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "Please upgrade first", labelStyle);
                }
                if (GUI.Button(new Rect(GuiBase.Width(540f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Upgrade", "You need " + current.UpgradeCost.GuiText + " Energy to upgrade this module.")))
                {
                    if (current.Upgrade(ref App.State.Ext.Factory.Energy))
                    {
                        GuiBase.ShowToast(current.Name + " has now a max level of " + current.MaxLevel.GuiText + "!");
                    }
                    else
                    {
                        GuiBase.ShowToast("You don't have enough energy!");
                    }
                }
                marginTop += 35;
            }
            marginTop += 35;
            GUI.Label(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Show All", "If this is off, it will show only the crystals with the highest grade."), labelStyle);
            this.showAll = GUI.Toggle(new Rect(GuiBase.Width(543f), GuiBase.Height((float)(marginTop + 4)), GuiBase.Width(60f), GuiBase.Height(30f)), this.showAll, string.Empty);
            using (List <FactoryModule> .Enumerator enumerator2 = App.State.Ext.Factory.AllModules.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    FactoryModule module  = enumerator2.Current;
                    Crystal       crystal = App.State.Ext.Factory.EquippedCrystals.FirstOrDefault((Crystal x) => x.Type == module.Type);
                    if (module.Crystals.Count > 0 || crystal != null)
                    {
                        labelStyle.alignment = TextAnchor.UpperLeft;
                        GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent(module.Type + " Crystals"), labelStyle);
                        labelStyle.alignment = TextAnchor.MiddleCenter;
                        if (crystal == null)
                        {
                            if (GUI.Button(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Equip", "Equip the highest grade of your " + module.Type + " Crystals.")))
                            {
                                if (SpecialFightUi.IsFighting)
                                {
                                    GuiBase.ShowToast("Please finish your special fight first!");
                                }
                                else
                                {
                                    App.State.PremiumBoni.MaxCrystals.Round();
                                    if (App.State.PremiumBoni.MaxCrystals <= App.State.Ext.Factory.EquippedCrystals.Count)
                                    {
                                        GuiBase.ShowToast("You can only equip " + App.State.PremiumBoni.MaxCrystals + " crystals at once!");
                                    }
                                    else
                                    {
                                        Crystal crystal2 = module.Crystals[module.Crystals.Count - 1];
                                        crystal2.Count.Round();
                                        if (crystal2.Count == 0)
                                        {
                                            GuiBase.ShowToast("You don't have any crystals you can equip...");
                                        }
                                        else
                                        {
                                            if (crystal2.Count > 1)
                                            {
                                                crystal2.Count -= 1;
                                            }
                                            else
                                            {
                                                module.Crystals.RemoveAt(module.Crystals.Count - 1);
                                            }
                                            App.State.Ext.Factory.EquippedCrystals.Add(crystal2);
                                        }
                                    }
                                    App.State.PremiumBoni.CheckCrystalBonus(App.State);
                                    if (App.State.GameSettings.MaxAfterEquipCrystal)
                                    {
                                        App.State.GameSettings.CreationToCreateCount = App.State.PremiumBoni.CreationCountBoni(true).ToInt() + 1;
                                    }
                                }
                            }
                        }
                        else if (GUI.Button(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Unequip", "Equip the highest grade of your " + module.Type + " Crystals.")))
                        {
                            App.State.Ext.Factory.EquippedCrystals.Remove(crystal);
                            module.AddCrystal(crystal, 1);
                        }
                        marginTop += 35;
                    }
                    for (int i = 0; i < module.Crystals.Count; i++)
                    {
                        if (i < module.Crystals.Count)
                        {
                            if (this.showAll || i >= module.Crystals.Count - 1)
                            {
                                Crystal crystal3 = module.Crystals[i];
                                if (crystal3.Count > 0)
                                {
                                    GUI.Label(new Rect(GuiBase.Width(60f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), new GUIContent(crystal3.Image, crystal3.Description));
                                    GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), string.Empty + crystal3.Level.GuiText + "*", labelStyle);
                                    GUI.Label(new Rect(GuiBase.Width(90f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), " x " + crystal3.Count.GuiText, labelStyle);
                                    int maxLevel = crystal3.MaxLevel;
                                    if (crystal3.Level < maxLevel)
                                    {
                                        CDouble cDouble               = crystal3.GetOptimalCount(App.State, module.MaxLevel);
                                        string  text2                 = string.Empty;
                                        CDouble cDouble2              = crystal3.UpgradeChance(App.State, module.MaxLevel, true);
                                        CDouble cDouble3              = crystal3.UpgradeChance(App.State, module.MaxLevel, false);
                                        CDouble countKeepLeftovers    = crystal3.GetCountKeepLeftovers(App.State, module.MaxLevel, crystal3.Count);
                                        CDouble crystalsAfterUpgrade  = crystal3.GetCrystalsAfterUpgrade(App.State, module.MaxLevel, cDouble);
                                        CDouble crystalsAfterUpgrade2 = crystal3.GetCrystalsAfterUpgrade(App.State, module.MaxLevel, countKeepLeftovers);
                                        if (cDouble2.ToInt() > cDouble3)
                                        {
                                            text2 = cDouble3.GuiText + " (capped out of your total chance of " + cDouble2.GuiText + ")";
                                        }
                                        else
                                        {
                                            text2 = cDouble3.GuiText;
                                        }
                                        labelStyle.alignment = TextAnchor.MiddleLeft;
                                        GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), " upgrade: " + cDouble3.GuiText + "%", labelStyle);
                                        if (cDouble <= crystal3.Count)
                                        {
                                            if (GUI.Button(new Rect(GuiBase.Width(370f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), new GUIContent("Upgrade Opt", string.Concat(new object[]
                                            {
                                                "If you upgrade your grade ",
                                                crystal3.Level,
                                                " ",
                                                crystal3.Type,
                                                " crystals to the next grade, ",
                                                text2,
                                                " % of your crystals can be upgraded, the others are lost. This upgrades your crystals with losing the least amount and keeps a left over. You will use ",
                                                cDouble,
                                                " crystals which will be upgraded to ",
                                                crystalsAfterUpgrade.GuiText,
                                                " of the next grade.\nMaxed with grade ",
                                                maxLevel,
                                                ".\n"
                                            }))))
                                            {
                                                module.UpgradeCrystal(App.State, crystal3, module.MaxLevel, cDouble);
                                            }
                                            GUI.Label(new Rect(GuiBase.Width(310f), GuiBase.Height((float)marginTop), GuiBase.Width(210f), GuiBase.Height(30f)), "(" + crystalsAfterUpgrade.GuiText + ")", labelStyle);
                                        }
                                        else if (countKeepLeftovers <= crystal3.Count && countKeepLeftovers > 0)
                                        {
                                            if (GUI.Button(new Rect(GuiBase.Width(370f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), new GUIContent("Upgrade Keep", string.Concat(new object[]
                                            {
                                                "If you upgrade your grade ",
                                                crystal3.Level,
                                                " ",
                                                crystal3.Type,
                                                " crystals to the next grade, ",
                                                text2,
                                                " % of your crystals can be upgraded, the others are lost. This upgrades your crystals similar to 'Upgrade All', keeps the left over instead of wasting it. You will use ",
                                                countKeepLeftovers,
                                                " crystals which will be upgraded to ",
                                                crystalsAfterUpgrade2.GuiText,
                                                " of the next grade.\nMaxed with grade ",
                                                maxLevel,
                                                ".\n"
                                            }))))
                                            {
                                                module.UpgradeCrystal(App.State, crystal3, module.MaxLevel, countKeepLeftovers);
                                            }
                                            GUI.Label(new Rect(GuiBase.Width(310f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), "(" + crystalsAfterUpgrade2.GuiText + ")", labelStyle);
                                        }
                                        labelStyle.alignment = TextAnchor.MiddleCenter;
                                        CDouble crystalsAfterUpgrade3 = crystal3.GetCrystalsAfterUpgrade(App.State, module.MaxLevel, crystal3.Count);
                                        if (crystalsAfterUpgrade3 >= 1)
                                        {
                                            if (GUI.Button(new Rect(GuiBase.Width(490f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), new GUIContent("Upgrade All", string.Concat(new object[]
                                            {
                                                "If you upgrade your grade ",
                                                crystal3.Level,
                                                " ",
                                                crystal3.Type,
                                                " crystals to the next grade, ",
                                                text2,
                                                " % of your crystals can be upgraded, the others are lost. This will use up all your crystals of this grade and keeps no left over. You will use ",
                                                crystal3.Count.GuiText,
                                                " crystals which will be upgraded to ",
                                                crystalsAfterUpgrade3,
                                                " of the next grade.\nMaxed with grade ",
                                                maxLevel,
                                                ".\n"
                                            }))))
                                            {
                                                module.UpgradeCrystal(App.State, crystal3, module.MaxLevel, crystal3.Count);
                                            }
                                        }
                                        else
                                        {
                                            GUI.Label(new Rect(GuiBase.Width(370f), GuiBase.Height((float)marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Not enough crystals.", string.Concat(new object[]
                                            {
                                                cDouble3,
                                                " % of the crystals can be upgraded, the others are lost.\nYou need to have at least ",
                                                crystal3.GetMinimumNeeded(App.State, module.MaxLevel),
                                                " grade ",
                                                crystal3.Level,
                                                " ",
                                                crystal3.Type,
                                                " crystals to be able to upgrade them."
                                            })), labelStyle);
                                        }
                                    }
                                    marginTop += 35;
                                }
                            }
                        }
                    }
                }
            }
            this.scrollViewHeight = marginTop - 140;
        }
Exemplo n.º 19
0
 private void CalcMonuments(long timeMS, StringBuilder infoBuilder)
 {
     foreach (Monument current in this.State.AllMonuments)
     {
         if (current.ShadowCloneCount > 0)
         {
             int     num     = current.ShadowCloneCount.ToInt();
             CDouble cDouble = timeMS * (long)num * (long)this.State.PremiumBoni.MonumentBuildTimeDivider * (100 + this.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100;
             long    num2    = current.DurationInMS(1);
             long    num3    = num2 / (current.Level.ToLong() + 1L);
             if (num2 < 30L)
             {
                 num2 = 30L;
             }
             if (num3 < 30L)
             {
                 num3 = 30L;
             }
             CDouble rightSide = current.Level * (num2 - num3) / 2;
             CDouble leftSide  = cDouble + rightSide;
             CDouble cDouble2  = Math.Sqrt((leftSide / num3).Double) * 1.414215;
             cDouble2.Floor();
             if (cDouble2 < current.Level)
             {
                 cDouble2 = current.Level;
             }
             if (cDouble2 > current.StopAt && current.StopAt != 0)
             {
                 cDouble2 = current.StopAt;
             }
             if (this.State.GameSettings.StopMonumentBuilding && cDouble2 > current.Level)
             {
                 cDouble2 = current.Level + 1;
             }
             int num4 = (cDouble2 - current.Level).ToInt();
             if (num4 > 20000)
             {
                 num4 = 20000;
             }
             CDouble cDouble3 = 1;
             if (num4 == 0)
             {
                 current.CurrentDuration += cDouble.ToLong();
             }
             else
             {
                 bool    flag     = false;
                 CDouble cDouble4 = cDouble2;
                 if ((num4 + current.Level).ToInt() == current.StopAt && current.StopAt != 0)
                 {
                     current.CurrentDuration = 0L;
                     cDouble4 = --cDouble4;
                 }
                 if (num4 > 1)
                 {
                     cDouble3 = cDouble4 * cDouble4 / 2 + cDouble4 / 2;
                     cDouble3 = cDouble3 - current.Level * current.Level / 2 + current.Level / 2;
                     foreach (CreationCost current2 in current.RequiredCreations(cDouble3))
                     {
                         if (!CreationCost.HasCreations(this.State, current2, this.State.GameSettings.AutoBuyCreationsForMonuments))
                         {
                             flag    = true;
                             cDouble = 0;
                             break;
                         }
                     }
                     while (flag)
                     {
                         flag     = false;
                         num4    /= 2;
                         cDouble2 = num4 + current.Level;
                         if (num4 < 1)
                         {
                             break;
                         }
                         cDouble3 = cDouble2 * cDouble2 / 2 + cDouble2 / 2;
                         cDouble3 = cDouble3 - current.Level * current.Level / 2 + current.Level / 2;
                         foreach (CreationCost current3 in current.RequiredCreations(cDouble3))
                         {
                             if (!CreationCost.HasCreations(this.State, current3, this.State.GameSettings.AutoBuyCreationsForMonuments))
                             {
                                 flag    = true;
                                 cDouble = 0;
                                 break;
                             }
                         }
                     }
                 }
                 if (!flag)
                 {
                     if (num4 > 1)
                     {
                         using (List <CreationCost> .Enumerator enumerator4 = current.RequiredCreations(cDouble3).GetEnumerator())
                         {
                             while (enumerator4.MoveNext())
                             {
                                 CreationCost cost     = enumerator4.Current;
                                 Creation     creation = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                                 creation.Count -= cost.CountNeeded;
                                 if (creation.count < 0)
                                 {
                                     creation.count = 0;
                                 }
                             }
                         }
                     }
                     current.Level += num4;
                     this.State.Statistic.MonumentsCreated += num4;
                     current.AddStatBoni();
                     if (this.State.GameSettings.StopMonumentBuilding)
                     {
                         this.State.Clones.RemoveUsedShadowClones(current.ShadowCloneCount);
                         current.ShadowCloneCount = 0;
                         current.CurrentDuration  = 0L;
                         cDouble = 0;
                     }
                     if (current.TypeEnum == Monument.MonumentType.temple_of_god)
                     {
                         this.State.Generator.IsAvailable = true;
                     }
                 }
             }
             if (current.CurrentDuration < 0L)
             {
                 current.CurrentDuration = 0L;
             }
             if (num4 > 0)
             {
                 infoBuilder.Append("- monument: ").Append(current.Name).Append(" was built ").Append(num4).Append(" x\n");
             }
         }
         if (current.Upgrade.ShadowCloneCount > 0)
         {
             int     num5     = current.Upgrade.ShadowCloneCount.ToInt();
             CDouble cDouble5 = timeMS * (long)num5 * (long)this.State.PremiumBoni.MonumentBuildTimeDivider * (100 + this.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100;
             int     num6     = 0;
             while (cDouble5 > 0)
             {
                 long value = current.Upgrade.DurationInMS(1) - current.Upgrade.CurrentDuration;
                 if (cDouble5 >= value && current.Upgrade.Level >= current.Upgrade.StopAt && current.Upgrade.StopAt != 0)
                 {
                     this.State.Clones.RemoveUsedShadowClones(current.Upgrade.ShadowCloneCount);
                     current.Upgrade.ShadowCloneCount = 0;
                     current.Upgrade.CurrentDuration  = 0L;
                     cDouble5 = 0;
                 }
                 else if (cDouble5 >= value)
                 {
                     cDouble5 -= value;
                     current.Upgrade.CurrentDuration = 0L;
                     bool flag2 = false;
                     if (!current.Upgrade.IsPaid)
                     {
                         foreach (CreationCost current4 in current.Upgrade.RequiredCreations)
                         {
                             if (!CreationCost.HasCreations(this.State, current4, this.State.GameSettings.AutoBuyCreationsForMonuments))
                             {
                                 flag2    = true;
                                 cDouble5 = 0;
                                 break;
                             }
                         }
                     }
                     if (!flag2)
                     {
                         if (!current.Upgrade.IsPaid)
                         {
                             using (List <CreationCost> .Enumerator enumerator6 = current.Upgrade.RequiredCreations.GetEnumerator())
                             {
                                 while (enumerator6.MoveNext())
                                 {
                                     CreationCost cost      = enumerator6.Current;
                                     Creation     creation2 = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                                     creation2.Count -= cost.CountNeeded;
                                     if (creation2.count < 0)
                                     {
                                         creation2.count = 0;
                                     }
                                 }
                             }
                         }
                         else
                         {
                             current.Upgrade.IsPaid = false;
                         }
                         num6++;
                         current.AddUpgradeLevel();
                         if (this.State.GameSettings.StopMonumentBuilding)
                         {
                             this.State.Clones.RemoveUsedShadowClones(current.Upgrade.ShadowCloneCount);
                             current.Upgrade.ShadowCloneCount = 0;
                             current.Upgrade.CurrentDuration  = 0L;
                             cDouble5 = 0;
                         }
                     }
                 }
                 else
                 {
                     current.Upgrade.CurrentDuration += cDouble5.ToLong();
                     cDouble5 = 0;
                 }
             }
             if (num6 > 0)
             {
                 infoBuilder.Append("- upgrade for ").Append(current.Name).Append(" was built ").Append(num6).Append(" x\n");
             }
         }
     }
 }
 private string Multiboni(CDouble value)
 {
     return(" (" + value.ToGuiText(true) + ")");
 }
Exemplo n.º 21
0
        private void CalcMight(long timeMS, StringBuilder infoBuilder)
        {
            long num = 0L;

            if (this.State.PremiumBoni.TotalMightIsUnlocked)
            {
                using (List <Might> .Enumerator enumerator = this.State.AllMights.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Might might = enumerator.Current;
                        if (might.ShadowCloneCount > 0)
                        {
                            long value = timeMS;
                            if (num > 0L)
                            {
                                value = num;
                                num   = 0L;
                            }
                            int  num2 = might.ShadowCloneCount.ToInt();
                            long num3 = might.DurationInMS(1, this.State);
                            long num4 = num3 / (might.Level.ToLong() + 1L);
                            if (num3 < 30L)
                            {
                                num3 = 30L;
                            }
                            if (num4 < 30L)
                            {
                                num4 = 30L;
                            }
                            CDouble rightSide = might.Level * (num3 - num4) / 2 + might.CurrentDuration;
                            CDouble leftSide  = value * might.ShadowCloneCount + rightSide;
                            CDouble cDouble   = Math.Sqrt((leftSide / num4).Double) * 1.414215;
                            int     num5      = (cDouble.Floored - might.Level).ToInt();
                            if (num5 > 0)
                            {
                                if (might.NextAt > 0 && might.Level + num5 >= might.NextAt)
                                {
                                    int num6 = num5;
                                    num5 = 0;
                                    if (might.Level < might.NextAt)
                                    {
                                        num5 = might.NextAt - might.Level.ToInt();
                                    }
                                    num6 -= num5;
                                    num   = (num4 * might.Level.ToLong() * (long)num6 + num4 * (might.Level.ToLong() + (long)num5 + (long)num6) * (long)num6) / 2L / (long)num2;
                                    might.RemoveCloneCount(num2);
                                    Might might2 = this.State.AllMights.FirstOrDefault((Might x) => x.TypeEnum == might.TypeEnum + 1);
                                    if (might2 == null)
                                    {
                                        might2 = this.State.AllMights[0];
                                    }
                                    might2.AddCloneCount(num2);
                                }
                                if (num5 > 0)
                                {
                                    might.CurrentDuration              = (num3 * (cDouble - cDouble.Floored)).ToLong();
                                    might.Level                       += num5;
                                    this.State.PremiumBoni.TotalMight += (long)num5;
                                    infoBuilder.Append("- gained ").Append(num5).Append(" levels in ' ").Append(might.Name).Append(" '\n");
                                }
                            }
                            if (num5 == 0 && might.Level < might.NextAt)
                            {
                                might.CurrentDuration += timeMS * (long)num2;
                            }
                        }
                        if (might.DurationLeft > 0L)
                        {
                            might.DurationLeft -= timeMS;
                            if (might.DurationLeft <= 0L)
                            {
                                might.DurationLeft = 0L;
                                might.UseCoolDown  = 3600000L;
                            }
                        }
                        if (might.UseCoolDown > 0L)
                        {
                            might.UseCoolDown -= timeMS;
                            if (might.UseCoolDown <= 0L)
                            {
                                might.UseCoolDown = 0L;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 22
0
        private static void ShowAdUi()
        {
            GUIStyle style  = GUI.skin.GetStyle("Label");
            GUIStyle style2 = GUI.skin.GetStyle("Button");

            style2.fontSize = GuiBase.FontSize(16);
            style.alignment = TextAnchor.UpperLeft;
            style.fontSize  = GuiBase.FontSize(16);
            GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            int num  = 125;
            int num2 = 305;

            if (GUI.Button(new Rect(GuiBase.Width((float)(num2 + 420)), GuiBase.Height((float)num), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Back")))
            {
                KredOffersUi.ShowAds = false;
            }
            GUI.Label(new Rect(GuiBase.Width((float)num2), GuiBase.Height((float)(num + 5)), GuiBase.Width(400f), GuiBase.Height(60f)), "For every Ad you watch, you will receive 1 Ad point. You can spend Ad points for various benefits below.");
            bool flag = App.State.Ext.AdsWatched >= 20;

            if (!App.CanShowAds || flag)
            {
                num += 45;
                GUI.Label(new Rect(GuiBase.Width((float)num2), GuiBase.Height((float)(num + 5)), GuiBase.Width(500f), GuiBase.Height(60f)), "You currently have " + App.State.Ext.AdPoints.ToInt() + " Ad points.\nCurrently there are no Ads available. Please come back later.");
            }
            else
            {
                num += 45;
                if (GUI.Button(new Rect(GuiBase.Width((float)(num2 + 420)), GuiBase.Height((float)num), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Watch Ad")))
                {
                    Kongregate.ShowIncentivizedAd();
                }
                GUI.Label(new Rect(GuiBase.Width((float)num2), GuiBase.Height((float)(num + 5)), GuiBase.Width(400f), GuiBase.Height(60f)), "You currently have " + App.State.Ext.AdPoints.ToInt() + " Ad points.");
            }
            num += 50;
            if (!App.State.Statistic.HasStartedUltimateBaalChallenge && !App.State.Statistic.HasStartedArtyChallenge)
            {
                if (App.State.Multiplier.DrawMultiPhysical < 10000000000L)
                {
                    KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.physical, "Increase your Physical by 10% until you rebirth", 1, "Maxed at 100 billion and not useable in UBC / UAC");
                }
                if (App.State.Multiplier.DrawMultiMystic < 10000000000L)
                {
                    KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.mystic, "Increase your Mystic by 10% until you rebirth", 1, "Maxed at 100 billion and not useable in UBC / UAC");
                }
                if (App.State.Multiplier.DrawMultiBattle < 10000000000L)
                {
                    KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.battle, "Increase your Battle by 10% until you rebirth", 1, "Maxed at 100 billion and not useable in UBC / UAC");
                }
                if (App.State.Multiplier.DrawMultiCreating < 10000000000L)
                {
                    KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.creating, "Increase your Creating by 10% until you rebirth", 1, "Maxed at 100 billion and not useable in UBC / UAC");
                }
                if (App.State.Multiplier.DrawMultiPhysical < 10000000000L && App.State.Multiplier.DrawMultiMystic < 10000000000L && App.State.Multiplier.DrawMultiBattle < 10000000000L && App.State.Multiplier.DrawMultiCreating < 10000000000L)
                {
                    KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.all, "Increase all 4 stats by 10% until you rebirth", 3, "Maxed at 100 billion");
                }
            }
            CDouble cDouble = App.State.DivinityGainSec(true) * 1200;

            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.div1, "Get " + cDouble.GuiText + " Divinity", 1, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.div2, "Get " + (cDouble * 2.5).GuiText + " Divinity", 2, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.creatingSpeed, "Increase your creating speed to 300% for 10 minutes", 2, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.puny, "Get one Puny Food", 2, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.strong, "Get one Strong Food", 4, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.mighty, "Get one Mighty Food", 6, string.Empty);
            KredOffersUi.addSpendPointsButton(ref num, KredOffersUi.Reward.lucky, "Get one Lucky Draw", 10, string.Empty);
        }
Exemplo n.º 23
0
        private void CalcTrainingSkills <T>(long timeMS, StringBuilder infoBuilder, List <T> elements, int stopAtCount, bool isNextOn)
        {
            int  num  = 0;
            long num2 = 0L;
            List <TrainingBase> list = new List <TrainingBase>();

            foreach (T current in elements)
            {
                if (current is TrainingBase)
                {
                    list.Add(current as TrainingBase);
                }
            }
            for (int i = 0; i < list.Count; i++)
            {
                TrainingBase trainingBase = list[i];
                bool         flag         = false;
                if (trainingBase is Skill)
                {
                    flag = ((Skill)trainingBase).IsAvailable;
                }
                if (trainingBase is Training)
                {
                    flag = ((Training)trainingBase).IsAvailable;
                }
                if (num > 0 && flag)
                {
                    if (trainingBase.ShadowCloneCount > 0)
                    {
                        num2 = 0L;
                    }
                    trainingBase.AddCloneCount(num);
                    num = 0;
                }
                long num3 = 0L;
                if (trainingBase is Skill && ((Skill)trainingBase).IsAvailable && trainingBase.DurationInMS(1) > 30)
                {
                    num3 = timeMS / 300000L;
                    if (num3 > 10000L)
                    {
                        num3 = 10000L;
                    }
                    ((Skill)trainingBase).Extension.UsageCount += num3;
                }
                if (trainingBase.ShadowCloneCount > 0)
                {
                    int num4 = trainingBase.ShadowCloneCount.ToInt();
                    int num5 = trainingBase.DurationInMS(num4);
                    if (num5 < 30)
                    {
                        num5 = 30;
                    }
                    long    num6    = timeMS;
                    CDouble cDouble = 0;
                    if (num2 > 0L)
                    {
                        num6 = num2;
                        num2 = 0L;
                    }
                    cDouble = num6 / (long)num5;
                    if (cDouble > 0)
                    {
                        bool flag2 = num4 <= this.State.GameSettings.TrainIgnoreCount && this.State.GameSettings.IgnoreCloneCountOn;
                        if (!flag2 && !this.State.GameSettings.UseStopAt && stopAtCount <= trainingBase.Level + cDouble && isNextOn)
                        {
                            CDouble cDouble2 = stopAtCount - trainingBase.Level;
                            if (this.State.PremiumBoni.ImprovedNextAt)
                            {
                                cDouble2 = (trainingBase.EnumValue + 1) * 500 - trainingBase.Level;
                                if (stopAtCount - trainingBase.Level > cDouble2)
                                {
                                    cDouble2 = stopAtCount - trainingBase.Level;
                                }
                            }
                            if (cDouble2 > 0)
                            {
                                num6 -= (cDouble2 * num5).ToLong();
                                num2  = (num5 * (cDouble - cDouble2)).ToLong();
                                int num7 = this.State.GameSettings.TrainIgnoreCount;
                                if (!this.State.GameSettings.IgnoreCloneCountOn)
                                {
                                    num7 = 0;
                                }
                                num = trainingBase.ShadowCloneCount.ToInt() - num7;
                                if (num2 > 0L)
                                {
                                    int num8 = trainingBase.ShadowCloneCount.ToInt() - num;
                                    num5 = trainingBase.DurationInMS(num8);
                                    if (num5 < 30)
                                    {
                                        num5 = 30;
                                    }
                                    if (num8 > 0)
                                    {
                                        cDouble = cDouble2 + num6 / (long)num5;
                                    }
                                    else
                                    {
                                        cDouble = cDouble2;
                                    }
                                    trainingBase.RemoveCloneCount(num);
                                }
                                else
                                {
                                    num = 0;
                                }
                            }
                        }
                        else if (!flag2 && isNextOn && stopAtCount <= trainingBase.Level + cDouble && (this.State.GameSettings.UseStopAt || trainingBase.EnumValue != 27))
                        {
                            cDouble = stopAtCount - trainingBase.Level.ToInt();
                            if (cDouble < 0)
                            {
                                cDouble = 0;
                            }
                        }
                        cDouble.Round();
                        trainingBase.Level += cDouble;
                        string value = string.Empty;
                        if (trainingBase is Training)
                        {
                            value = ((Training)trainingBase).Name;
                            this.State.PhysicalPowerBase             += trainingBase.PowerGain * cDouble;
                            this.State.Statistic.TotalTrainingLevels += cDouble;
                        }
                        else if (trainingBase is Skill)
                        {
                            value = ((Skill)trainingBase).Name;
                            this.State.MysticPowerBase            += trainingBase.PowerGain * cDouble;
                            this.State.Statistic.TotalSkillLevels += cDouble;
                        }
                        infoBuilder.Append("- gained ").Append(cDouble).Append(" levels in ' ").Append(value).Append(" '\n");
                        if (num3 > 0L)
                        {
                            infoBuilder.Append("- ").Append(value).Append(" was also used ").Append(num3).Append(" times to reduce the cap").Append("\n");
                        }
                    }
                }
            }
        }
 protected void ShowLabels(int marginTop, GUIStyle labelStyle)
 {
     if (App.State.IsBuyUnlocked)
     {
         string text = "If this is on, missing creations will be bought automatically if you have enough divinity.";
         if (App.State.PremiumBoni.AutoBuyCostReduction < 20)
         {
             text = string.Concat(new object[]
             {
                 text,
                 "\nBut beware: there is an additional ",
                 20 - App.State.PremiumBoni.AutoBuyCostReduction,
                 "% transaction fee!"
             });
         }
         GUI.Label(new Rect(GuiBase.Width(365f), GuiBase.Height(42f), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Auto buy missing creations", text));
         App.State.GameSettings.AutoBuyCreationsForDivGen = GUI.Toggle(new Rect(GuiBase.Width(593f), GuiBase.Height(47f), GuiBase.Width(300f), GuiBase.Height(30f)), App.State.GameSettings.AutoBuyCreationsForDivGen, new GUIContent(string.Empty));
     }
     if (App.State.Generator.IsBuilt)
     {
         labelStyle.fontSize  = GuiBase.FontSize(18);
         labelStyle.fontStyle = FontStyle.Bold;
         labelStyle.alignment = TextAnchor.MiddleCenter;
         GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(650f), GuiBase.Height(30f)), new GUIContent("Divinity Generator", "The divinity generator can convert your creations into divinity. You need to fill in creations for it to work."));
         marginTop           += 45;
         labelStyle.fontSize  = GuiBase.FontSize(16);
         labelStyle.fontStyle = FontStyle.Normal;
         labelStyle.alignment = TextAnchor.UpperLeft;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(250f), GuiBase.Height(30f)), new GUIContent("Capacity / In use", "The total capacity and the capacity in use. The base will increase for each god defeated after Zeus (stays after rebirth)."));
         GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), App.State.Generator.Capacity.ToGuiText(true) + " / " + App.State.Generator.FilledCapacity.ToGuiText(true));
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height(42f), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent("Stop after finish", "If this is on, clones will be removed from generator upgrade when it is finished."));
         App.State.GameSettings.StopDivinityGenBuilding = GUI.Toggle(new Rect(GuiBase.Width(200f), GuiBase.Height(47f), GuiBase.Width(300f), GuiBase.Height(30f)), App.State.GameSettings.StopDivinityGenBuilding, new GUIContent(string.Empty));
         if (!DivinityGeneratorUi.AddIsOpen)
         {
             if (GUI.Button(new Rect(GuiBase.Width(540f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), new GUIContent("Add", "Add your creations to use them up for more divinity.")))
             {
                 DivinityGeneratorUi.AddIsOpen = true;
             }
             marginTop += 25;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Time till empty", "It takes that long until the capacity in use is 0. It does not take the worker clones into consideration!"));
             CDouble convertSec = App.State.Generator.ConvertSec;
             if (this.count == 30)
             {
                 this.count            = 0;
                 this.secLeftTillEmpty = (long)(App.State.Generator.FilledCapacity * 1000 / App.State.Generator.ConvertSec).ToInt();
             }
             this.count++;
             GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), Conv.MsToGuiText(this.secLeftTillEmpty, true));
             marginTop += 25;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Divinity each convert", "The number from Convert will be multiplied with this number for the divinity gain."));
             GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), App.State.Generator.DivinityEachCapacity.ToString());
             marginTop += 25;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Converts / s", "Each second this number will be converted into divinity. The base will increase for each god defeated after Zeus (stays after rebirth)."));
             GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), convertSec.ToGuiText(true));
             marginTop += 25;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Divinity / s", "The amount of divinity the generator will generate each second."));
             string text2 = App.State.Generator.DivinitySecWithWorker.ToGuiText(true);
             if (App.State.PremiumBoni.CrystalBonusDivinity > 0)
             {
                 text2 = text2 + " (" + App.State.Generator.DivinitySecWithWorkerCrystal.GuiText + ")";
             }
             string tooltip = string.Empty;
             if (App.State.PremiumBoni.CrystalBonusDivinity > 0)
             {
                 tooltip = App.State.PremiumBoni.CrystalBonusDivinity.GuiText + "% more income from equipped crystals";
             }
             GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(340f), GuiBase.Height(30f)), new GUIContent(text2, tooltip));
             marginTop += 25;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Worker Clones", "You can adjust some clones to auto-fill your generator. They can only use stones to refill the generator, so be sure to have enough! (It is hard to carry things like light or oceans for them). One shadow clone can fill in " + App.State.Generator.CloneFillSpeedText + "\nIf you allocate more clones than the break even point, the leftover clones will fill the capacity of the divinity generator. If it is full, they will increase the divinity gain by 1% every 5000 clones (maxed at 400% additional bonus)."));
             GUI.Label(new Rect(GuiBase.Width(200f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), string.Empty + App.State.Generator.ShadowCloneCount.CommaFormatted);
             if (GUI.Button(new Rect(GuiBase.Width(470f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
             {
                 App.State.Generator.AddCloneCount((int)this.ClonesToAdd);
             }
             if (GUI.Button(new Rect(GuiBase.Width(530f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
             {
                 App.State.Generator.RemoveCloneCount((int)this.ClonesToAdd);
             }
             if (GUI.Button(new Rect(GuiBase.Width(590f), GuiBase.Height((float)marginTop), GuiBase.Width(50f), GuiBase.Height(30f)), new GUIContent("CAP")))
             {
                 App.State.Generator.UseBreakEvenWorkerCount();
             }
         }
         else
         {
             if (GUI.Button(new Rect(GuiBase.Width(540f), GuiBase.Height((float)marginTop), GuiBase.Width(60f), GuiBase.Height(30f)), "Close"))
             {
                 DivinityGeneratorUi.AddIsOpen = false;
             }
             marginTop           += 35;
             labelStyle.fontSize  = GuiBase.FontSize(18);
             labelStyle.fontStyle = FontStyle.Bold;
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "Creation");
             GUI.Label(new Rect(GuiBase.Width(180f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "Count", labelStyle);
             GUI.Label(new Rect(GuiBase.Width(325f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "Capacity", labelStyle);
             GUI.Label(new Rect(GuiBase.Width(480f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "Add", labelStyle);
             labelStyle.fontSize  = GuiBase.FontSize(16);
             labelStyle.fontStyle = FontStyle.Normal;
         }
     }
 }
Exemplo n.º 25
0
 private void CalcDivGen(long timeMS, StringBuilder infoBuilder)
 {
     if (this.State.Generator.ShadowCloneCount > 0 && !this.State.Generator.IsBuilt)
     {
         int     num     = this.State.Generator.ShadowCloneCount.ToInt();
         CDouble cDouble = timeMS * (long)num * (long)this.State.PremiumBoni.MonumentBuildTimeDivider * (100 + this.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100;
         long    value   = this.State.Generator.DurationInMS(1) - this.State.Generator.CurrentDuration;
         if (cDouble >= value)
         {
             this.State.Generator.CurrentDuration = 0L;
             this.State.Generator.IsPaid          = false;
             this.State.Generator.IsBuilt         = true;
             this.State.Clones.RemoveUsedShadowClones(num);
             this.State.Generator.ShadowCloneCount = 0;
             infoBuilder.Append("- divinity generator was built\n");
         }
         else
         {
             this.State.Generator.CurrentDuration += cDouble.ToLong();
             cDouble = 0;
         }
     }
     foreach (GeneratorUpgrade current in this.State.Generator.Upgrades)
     {
         if (current.ShadowCloneCount > 0)
         {
             int     num2     = current.ShadowCloneCount.ToInt();
             CDouble cDouble2 = timeMS * (long)num2 * (long)this.State.PremiumBoni.MonumentBuildTimeDivider * (100 + this.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100;
             int     num3     = 0;
             while (cDouble2 > 0)
             {
                 if (current.StopAt != 0 && current.StopAt <= current.Level)
                 {
                     this.State.Clones.RemoveUsedShadowClones(current.ShadowCloneCount);
                     current.ShadowCloneCount = 0;
                     cDouble2 = 0;
                 }
                 else
                 {
                     long value2 = current.DurationInMS(1) - current.CurrentDuration;
                     if (cDouble2 >= value2)
                     {
                         cDouble2 -= value2;
                         current.CurrentDuration = 0L;
                         bool flag = false;
                         if (!current.IsPaid)
                         {
                             foreach (CreationCost current2 in current.RequiredCreations)
                             {
                                 if (!CreationCost.HasCreations(this.State, current2, this.State.GameSettings.AutoBuyCreationsForMonuments))
                                 {
                                     flag = true;
                                     current.CurrentDuration = current.DurationInMS(1);
                                     cDouble2 = 0;
                                     break;
                                 }
                             }
                         }
                         if (!flag)
                         {
                             if (!current.IsPaid)
                             {
                                 using (List <CreationCost> .Enumerator enumerator3 = current.RequiredCreations.GetEnumerator())
                                 {
                                     while (enumerator3.MoveNext())
                                     {
                                         CreationCost cost     = enumerator3.Current;
                                         Creation     creation = this.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum);
                                         creation.Count -= cost.CountNeeded;
                                     }
                                 }
                             }
                             else
                             {
                                 current.IsPaid = false;
                             }
                             num3++;
                             GeneratorUpgrade expr_3BE = current;
                             expr_3BE.Level = ++expr_3BE.Level;
                             if (this.State.GameSettings.StopDivinityGenBuilding)
                             {
                                 this.State.Clones.RemoveUsedShadowClones(current.ShadowCloneCount);
                                 current.ShadowCloneCount = 0;
                                 current.CurrentDuration  = 0L;
                                 cDouble2 = 0;
                             }
                         }
                     }
                     else
                     {
                         current.CurrentDuration += cDouble2.ToLong();
                         cDouble2 = 0;
                     }
                 }
             }
             if (num3 > 0)
             {
                 infoBuilder.Append("- upgrade: ").Append(current.Name).Append(" was built ").Append(num3).Append(" x\n");
             }
         }
     }
     infoBuilder.Append("After your break, you feel refreshed and your creation speed is tripled for the next ").Append(Conv.MsToGuiText(this.State.CreatingSpeedBoniDuration, true)).Append("!");
 }
Exemplo n.º 26
0
        void TestComplex()
        {
            var c1_1 = new CDouble(5.708705e+01, -2.328294e-03);

            if (r.c1 != c1_1)
            {
                throw new Exception();
            }

            var c1_2 = new CDouble(5.708705e+01, -2.328294e-03);

            r.c1 = c1_2;

            CDouble[] c2_1   = r.c2;
            double[]  c2_1_1 = new double[] { 1.968551e+07, 2.380643e+18, 3.107374e-16, 7.249542e-16, -4.701135e-19, -6.092764e-17, 2.285854e+14, 2.776180e+05, -1.436152e-12, 3.626609e+11, 3.600952e-02, -3.118123e-16, -1.312210e-10, -1.738940e-07, -1.476586e-12, -2.899781e-20, 4.806642e+03, 4.476869e-05, -2.935084e-16, 3.114019e-20, -3.675955e+01, 3.779796e-21, 2.190594e-11, 4.251420e-06, -9.715221e+11, -3.483924e-01, 7.606428e+05, 5.418088e+15, 4.786378e+16, -1.202581e+08, -1.662061e+02, -2.392954e+03 };
            ca(c2_1, ComplexFromScalars(c2_1_1));

            double[] c2_2_1 = new double[] { 4.925965e-03, 5.695254e+13, -4.576890e-14, -6.056342e-07, -4.918571e-08, -1.940684e-10, 1.549104e-02, -1.954145e+04, -2.499019e-16, 4.010614e+09, -1.906811e-08, 3.297924e-10, 2.742399e-02, -4.372839e-01, -3.093171e-10, 4.311755e-01, -2.218220e-14, 5.399758e+10, 3.360304e+17, 1.340681e-18, -4.441140e+11, -1.845055e-09, -3.074586e-10, -1.754926e+01, -2.766799e+04, -2.307577e+10, 2.754875e+14, 1.179639e+15, 6.976204e-10, 1.901856e+08, -3.824351e-02, -1.414167e+08 };

            r.c2 = ComplexFromScalars(c2_2_1);

            MultiDimArray c3_1 = r.c3;

            uint[]   c3_1_1 = new uint[] { 2, 5 };
            double[] c3_1_2 = new double[] { 5.524802e+18, -2.443857e-05, 3.737932e-02, -4.883553e-03, -1.184347e+12, 4.537366e-08, -4.567913e-01, -1.683542e+15, -1.676517e+00, -8.911085e+12, -2.537376e-17, 1.835687e-10, -9.366069e-22, -5.426323e-12, -7.820969e-10, -1.061541e+12, -3.660854e-12, -4.969930e-03, 1.988428e+07, 1.860782e-16 };
            ca(c3_1.Dims, c3_1_1);
            ca((CDouble[])c3_1.Array_, ComplexFromScalars(c3_1_2));

            uint[]   c3_2_1 = new uint[] { 3, 4 };
            double[] c3_2_2 = new double[] { 4.435180e+04, 5.198060e-18, -1.316737e-13, -4.821771e-03, -4.077550e-19, -1.659105e-09, -6.332363e-11, -1.128999e+16, 4.869912e+16, 2.680490e-04, -8.880119e-04, 3.960452e+11, 4.427784e-09, -2.813742e-18, 7.397516e+18, 1.196394e+13, 3.236906e-14, -4.219297e-17, 1.316282e-06, -2.771084e-18, -1.239118e-09, 2.887453e-08, -1.746515e+08, -2.312264e-11 };
            r.c3 = new MultiDimArray(c3_2_1, ComplexFromScalars(c3_2_2));

            List <CDouble[]> c5_1 = r.c5;

            double[] c5_1_1 = new double[] { 1.104801e+00, 4.871266e-10, -2.392938e-03, 4.210339e-07, 1.474114e-19, -1.147137e-01, -2.026434e+06, 4.450447e-19, 3.702953e-21, 9.722025e+12, 3.464073e-14, 4.628110e+15, 2.345453e-19, 3.730012e-04, 4.116650e+16, 4.380220e+08 };
            ca(c5_1[0], ComplexFromScalars(c5_1_1));

            var c5_2 = new List <CDouble[]>();

            double[] c5_2_1 = { 2.720831e-20, 2.853037e-16, -7.982497e+16, -2.684318e-09, -2.505796e+17, -4.743970e-12, -3.657056e+11, 2.718388e+15, 1.597672e+03, 2.611859e+14, 2.224926e+06, -1.431096e-09, 3.699894e+19, -5.936706e-01, -1.385395e-09, -4.248415e-13 };
            c5_2.Add(ComplexFromScalars(c5_2_1));
            r.c5 = (c5_2);

            var c7_1 = new CSingle(-5.527021e-18f, -9.848457e+03f);

            if (r.c7 != c7_1)
            {
                throw new Exception();
            }

            var c7_2 = new CSingle(9.303345e-12f, -3.865684e-05f);

            r.c7 = (c7_2);

            var c8_1 = r.c8;

            float[] c8_1_1 = new float[] { -3.153395e-09f, 3.829492e-02f, -2.665239e+12f, 1.592927e-03f, 3.188444e+06f, -3.595015e-11f, 2.973887e-18f, -2.189921e+17f, 1.651567e+10f, 1.095838e+05f, 3.865249e-02f, 4.725510e+10f, -2.334376e+03f, 3.744977e-05f, -1.050821e+02f, 1.122660e-22f, 3.501520e-18f, -2.991601e-17f, 6.039622e-17f, 4.778095e-07f, -4.793136e-05f, 3.096513e+19f, 2.476004e+18f, 1.296297e-03f, 2.165336e-13f, 4.834427e+06f, 4.675370e-01f, -2.942290e-12f, -2.090883e-19f, 6.674942e+07f, -4.809047e-10f, -4.911772e-13f };
            ca(c8_1, ComplexFromScalars(c8_1_1));

            float[] c8_2_1 = new float[] { 1.324498e+06f, 1.341746e-04f, 4.292993e-04f, -3.844509e+15f, -3.804802e+10f, 3.785305e-12f, 2.628285e-19f, -1.664089e+15f, -4.246472e-10f, -3.334943e+03f, -3.305796e-01f, 1.878648e-03f, 1.420880e-05f, -3.024657e+14f, 2.227031e-21f, 2.044653e+17f, 9.753609e-20f, -6.581817e-03f, 3.271063e-03f, -1.726081e+06f, -1.614502e-06f, -2.641638e-19f, -2.977317e+07f, -1.278224e+03f, -1.760207e-05f, -4.877944e-07f, -2.171524e+02f, 1.620645e+01f, -4.334168e-02f, 1.871011e-09f, -3.066163e+06f, -3.533662e+07f };
            r.c8 = ComplexFromScalars(c8_2_1);

            var c9_1 = r.c9;

            uint[]  c9_1_1 = new uint[] { 2, 4 };
            float[] c9_1_2 = new float[] { 1.397743e+15f, 3.933042e+10f, -3.812329e+07f, 1.508109e+16f, -2.091397e-20f, 3.207851e+12f, -3.640702e+02f, 3.903769e+02f, -2.879727e+17f, -4.589604e-06f, 2.202769e-06f, 2.892523e+04f, -3.306489e-14f, 4.522308e-06f, 1.665807e+15f, 2.340476e+10f };
            ca(c9_1.Dims, c9_1_1);
            ca((CSingle[])c9_1.Array_, ComplexFromScalars(c9_1_2));

            uint[]  c9_2_1 = new uint[] { 2, 2, 2 };
            float[] c9_2_2 = new float[] { 2.138322e-03f, 4.036979e-21f, 1.345236e+10f, -1.348460e-12f, -3.615340e+12f, -2.911340e-21f, 3.220362e+09f, 3.459909e-04f, 4.276259e-08f, -3.199451e+18f, 3.468308e+07f, -2.928506e-09f, -3.154288e+17f, -2.352920e-02f, 6.976385e-21f, 2.435472e+12f };
            r.c9 = new MultiDimArray(c9_2_1, ComplexFromScalars(c9_2_2));
        }
Exemplo n.º 27
0
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (PlanetUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         PlanetUi.scrollBarsToZero = false;
     }
     if (this.showInfo)
     {
         labelStyle.alignment = TextAnchor.UpperLeft;
         string text = "Here at your planet you get an extra multiplier. At first your clones can increase the multiplier with powersurge. If you upgrade your planet, you can increase the multiplier faster and fight ultimate beings.\nIf you defeat an ultimate being, your multiplier for physical, mystic, battle and creating will increase, however after each kill the effect will decrease. Tier 1 drops one GP every 5 times, Tier 2 drops once GP twice every 5 times up to once GP every kill for the highest UB! (The counter will reset after rebirthing)\nFighting the ultimate beings works like this: \nFirst you adjust clones, then you press the 'Fight' button and then the fight will be calculated.\nIn the fight some or all your clones might die, so take this into consideration!\nThe power of the ultimate beings is adjusted to your own power. So the number of clones you use is the most important!\nIt is advisable to use more than 100k clones for the first fight and more for the later ones.\nIf you lose a fight, the health the ultimate being lost will stay and it won't recover it's hp. However each ultimate being has a timer. When the timer reaches zero, it will be back to full health. If you killed it, it will also be back and you can fight it again.";
         this.scrollViewHeight = (int)labelStyle.CalcHeight(new GUIContent(text), GuiBase.Width(600f));
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)(marginTop - 2)), GuiBase.Width(600f), (float)this.scrollViewHeight), text, labelStyle);
         return;
     }
     if (this.showV2)
     {
         marginTop += 10;
         this.addPowerSurge(marginTop, labelStyle);
         marginTop += 80;
         this.showUBV2s(marginTop, labelStyle);
         return;
     }
     if (this.showBaalPower)
     {
         labelStyle.alignment = TextAnchor.UpperLeft;
         marginTop           += 2;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(50f)), "Here you can spend Baal Power to increase your chances to beat UBs. The increased Attack / Defense will last for one fight.", labelStyle);
         marginTop += 50;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(340f)), "You have " + (App.State.HomePlanet.BaalPower - this.bPAttackUsage - this.bPDefUsage) + " Baal Power", labelStyle);
         marginTop += 50;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(340f)), "Clone Attack: " + (App.State.ClonesPlanetMod + this.bPAttackUsage * 50) + " %", labelStyle);
         if (App.State.HomePlanet.BaalPower > this.bPAttackUsage + this.bPDefUsage && GUI.Button(new Rect(GuiBase.Width(300f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
         {
             this.bPAttackUsage++;
         }
         if (this.bPAttackUsage > 0 && GUI.Button(new Rect(GuiBase.Width(350f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
         {
             this.bPAttackUsage--;
         }
         if (this.bPAttackUsage + this.bPDefUsage > App.State.HomePlanet.BaalPower)
         {
             this.bPAttackUsage = 0;
             this.bPDefUsage    = 0;
         }
         marginTop += 50;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(340f)), "Clone Defense: " + (App.State.ClonesPlanetMod + this.bPDefUsage * 50) + " %", labelStyle);
         if (App.State.HomePlanet.BaalPower > this.bPAttackUsage + this.bPDefUsage && GUI.Button(new Rect(GuiBase.Width(300f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
         {
             this.bPDefUsage++;
         }
         if (this.bPDefUsage > 0 && GUI.Button(new Rect(GuiBase.Width(350f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
         {
             this.bPDefUsage--;
         }
         marginTop += 50;
         int num = App.State.HomePlanet.PowerSurgeBoni / 2;
         this.useUpPowerSurge = GUI.Toggle(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(280f), GuiBase.Height(30f)), this.useUpPowerSurge, new GUIContent("Use Powersurge (" + num + " %)", "If this is on, your get additional % to Attack and Defense for this fight and the bonus from Powersurge will reset."));
         if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), "Fight"))
         {
             this.showBaalPower = false;
             if (this.useUpPowerSurge)
             {
                 this.fightLog = this.selectedBeing.Fight(App.State, this.bPAttackUsage, this.bPDefUsage, num, App.State.HomePlanet.ShadowCloneCount, false);
                 App.State.HomePlanet.PowerSurgeBoni = 0;
             }
             else
             {
                 this.fightLog = this.selectedBeing.Fight(App.State, this.bPAttackUsage, this.bPDefUsage, 0, App.State.HomePlanet.ShadowCloneCount, false);
             }
             this.bPDefUsage    = 0;
             this.bPAttackUsage = 0;
             this.isFighting    = true;
         }
         return;
     }
     if (this.isFighting)
     {
         this.scrollViewHeight = this.fightLog.Split(new char[]
         {
             '\n'
         }).Length * 35 + 40;
         labelStyle.alignment = TextAnchor.UpperLeft;
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height((float)(this.scrollViewHeight - 40))), this.fightLog, labelStyle);
         marginTop += this.scrollViewHeight - 40;
         return;
     }
     this.scrollViewHeight = 320;
     if (App.State.HomePlanet.IsCreated)
     {
         marginTop += 10;
         this.addPowerSurge(marginTop, labelStyle);
         marginTop += 80;
         bool flag = false;
         foreach (UltimateBeing current in App.State.HomePlanet.UltimateBeings)
         {
             labelStyle.fontSize = GuiBase.FontSize(16);
             if (current.IsAvailable)
             {
                 GuiBase.CreateProgressBar(marginTop, current.HPPercent / 100.0, current.Name, current.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
                 GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), string.Empty + Conv.MsToGuiText(current.TimeUntilComeBack, true), labelStyle);
                 GUI.Label(new Rect(GuiBase.Width(355f), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), string.Empty + current.NextMultiplier.ToGuiText(false) + " %", labelStyle);
                 if (current.HPPercent > 0.0 && GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), "Fight"))
                 {
                     if (App.State.HomePlanet.ShadowCloneCount > 0)
                     {
                         if (App.State.HomePlanet.BaalPower == 0 && App.State.HomePlanet.PowerSurgeBoni < 2)
                         {
                             this.fightLog   = current.Fight(App.State, 0, 0, 0, App.State.HomePlanet.ShadowCloneCount, false);
                             this.isFighting = true;
                         }
                         else
                         {
                             this.showBaalPower = true;
                             this.selectedBeing = current;
                         }
                     }
                     else
                     {
                         GuiBase.ShowToast("You need to add clones to powersurge before starting a fight!");
                     }
                 }
                 if (current.Tier == 5 && current.TimesDefeated > 0)
                 {
                     flag = true;
                 }
             }
             else
             {
                 labelStyle.alignment = TextAnchor.UpperLeft;
                 GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(450f), GuiBase.Height(30f)), "Your planet has to be level " + current.Tier + " to unlock this ultimate being.", labelStyle);
             }
             marginTop += 35;
         }
         labelStyle.alignment = TextAnchor.UpperLeft;
         GUI.Label(new Rect(GuiBase.Width(240f), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), (App.State.HomePlanet.PlanetMultiplier + 100).ToGuiText(true) + " %", labelStyle);
         labelStyle.fontStyle = FontStyle.Bold;
         labelStyle.fontSize  = GuiBase.FontSize(18);
         GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(300f), GuiBase.Height(30f)), new GUIContent("Planet Multiplier", string.Concat(new string[]
         {
             "This multiplier multiplies directly Physical, Mystic, Battle and Creating. 100% is the base value.lowerTextMulti from Powersurge: ",
             App.State.HomePlanet.PowerSurgeMultiplier.GuiText,
             " %\nMulti from Ultimate Beings: ",
             App.State.HomePlanet.UBMultiplier.ToGuiText(true),
             " %"
         })), labelStyle);
         labelStyle.fontStyle = FontStyle.Normal;
         marginTop           += 30;
         if (flag)
         {
             CDouble cDouble = App.State.Statistic.MonumentsCreated;
             cDouble += App.State.Statistic.HighestGodDefeated * 10000;
             cDouble += App.State.Statistic.TotalAchievements * 10;
             cDouble += App.State.Statistic.TotalGodsDefeated * 100;
             cDouble += App.State.Statistic.MostDefeatedShadowClones * 5000;
             cDouble += App.State.Statistic.TBSScore * 100;
             cDouble += App.State.Statistic.TotalTrainingLevels / 100000;
             cDouble += App.State.Statistic.TotalSkillLevels / 100000;
             cDouble += App.State.Statistic.TotalEnemiesDefeated / 200000;
             cDouble += App.State.Statistic.TotalShadowClonesCreated / 5000;
             cDouble += App.State.Statistic.TotalCreations / 10000;
             cDouble += App.State.Clones.MaxShadowClones / 10;
             cDouble += App.State.Statistic.UBsDefeated * 250;
             cDouble += App.State.Statistic.TimePlayed / 50000L;
             cDouble += App.State.PremiumBoni.CrystalPower * 100;
             GUI.Label(new Rect(GuiBase.Width(240f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), string.Empty + cDouble.ToGuiText(true), labelStyle);
             labelStyle.fontStyle = FontStyle.Bold;
             labelStyle.fontSize  = GuiBase.FontSize(18);
             GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Game Points", "Congratulation for reaching this far! This is calculated from your stats in this game. In Steam you can export the score and keep it. It might be useful in one of my next games.\nFor other plattforms it is just a score you can compare with others currently."), labelStyle);
             labelStyle.fontStyle = FontStyle.Normal;
             if (App.CurrentPlattform == Plattform.Steam && GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(180f), GuiBase.Height(30f)), "I win"))
             {
                 string        password      = "******";
                 StringBuilder stringBuilder = new StringBuilder();
                 Conv.AppendValue(stringBuilder, "a", UnityEngine.Random.Range(0, 9999999).ToString());
                 Conv.AppendValue(stringBuilder, "b", cDouble.ToInt().ToString());
                 Conv.AppendValue(stringBuilder, "c", App.State.KongUserId.ToString());
                 Conv.AppendValue(stringBuilder, "d", UnityEngine.Random.Range(0, 9999999).ToString());
                 Conv.AppendValue(stringBuilder, "e", App.State.KongUserName.ToString());
                 Conv.AppendValue(stringBuilder, "f", UnityEngine.Random.Range(0, 9999999).ToString());
                 string     plainText  = Conv.ToBase64(stringBuilder.ToString(), string.Empty);
                 string     plainText2 = Vertifier.Encrypt(plainText, password);
                 string     text2      = Conv.ToBase64(plainText2, string.Empty);
                 TextEditor textEditor = new TextEditor();
                 textEditor.text = text2;
                 textEditor.SelectAll();
                 textEditor.Copy();
                 GuiBase.ShowToast("Your data is copied to your clipboard. Please paste it to a text-editor and keep it save until it is of use in one of my next games!");
             }
         }
     }
 }