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;
         }
     }
 }
        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 string Multiboni(CDouble value)
 {
     return(" (" + value.ToGuiText(true) + ")");
 }
Exemplo n.º 4
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;
            }
        }
        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();
        }
Exemplo n.º 6
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.º 7
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!");
             }
         }
     }
 }