Esempio n. 1
0
 private void addPowerSurge(int marginTop, GUIStyle labelStyle)
 {
     GuiBase.CreateProgressBar(marginTop, App.State.HomePlanet.Percent, "Powersurge", string.Concat(new object[]
     {
         "Adjust clones here to get more power!\nOne Shadow Clone generates (1 + planet level) power / hour. 100k power will increase your Stat Multiplier by 1.lowerText",
         App.State.HomePlanet.ProgressInfo,
         "\nPowerbonus for Fights: ",
         App.State.HomePlanet.PowerSurgeBoni / 2,
         " %"
     }), GuiBase.progressBg, GuiBase.progressFgGreen);
     GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), new GUIContent("Clones", "All clones here will be also used for UB-Fights if you start a fight."), labelStyle);
     GUI.Label(new Rect(GuiBase.Width(340f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + App.State.HomePlanet.ShadowCloneCount.CommaFormatted, labelStyle);
     if (GUI.Button(new Rect(GuiBase.Width(450f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
     {
         App.State.HomePlanet.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.HomePlanet.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
     }
 }
        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;
                }
            }
        }
        public void Show()
        {
            if (GodUi.scrollBarsToZero)
            {
                this.scrollPosition    = Vector2.zero;
                GodUi.scrollBarsToZero = false;
            }
            GUIStyle style = GUI.skin.GetStyle("Label");

            style.alignment = TextAnchor.UpperLeft;
            style.fontSize  = GuiBase.FontSize(18);
            GUI.BeginGroup(new Rect(GuiBase.Width(280f), GuiBase.Height(110f), GuiBase.Width(670f), GuiBase.Height(480f)));
            GUI.Box(new Rect(GuiBase.Width(10f), GuiBase.Height(0f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            style.alignment = TextAnchor.UpperCenter;
            int num  = 20;
            int num2 = 400;

            if (App.State.Statistic.HasStartedUltimatePetChallenge)
            {
                GUI.Label(new Rect(GuiBase.Width(0f), GuiBase.Height((float)num), GuiBase.Width(550f), GuiBase.Height(30f)), new GUIContent("Pet Power: " + App.State.Ext.GetTotalPetPower(false).ToGuiText(true), "The power of all pets who are available to fight gods combined."), style);
                GUI.Label(new Rect(GuiBase.Width(0f), GuiBase.Height((float)(num + 25)), GuiBase.Width(550f), GuiBase.Height(30f)), new GUIContent("Multi from gods: " + App.State.Ext.PetPowerMultiGods.ToGuiText(true), "This is a multiplier to the pet power and will multiply with 4 for each god defeated. This won't reset after rebirthing."), style);
                GUI.Label(new Rect(GuiBase.Width(0f), GuiBase.Height((float)(num + 50)), GuiBase.Width(550f), GuiBase.Height(30f)), new GUIContent("Multi from pet pills: " + App.State.Ext.PetPowerMultiCampaigns.ToGuiText(true), "You can find Pet Pills in item campaigns for additional multipliers. This won't reset after rebirthing."), style);
                GUI.Label(new Rect(GuiBase.Width(0f), GuiBase.Height((float)(num + 75)), GuiBase.Width(550f), GuiBase.Height(30f)), new GUIContent("Multi from monuments: " + App.State.Ext.PetPowerMultiMonuments().ToGuiText(true), "Your monuments will even give multipliers to your pets! Sadly, all of this is lost after rebirthing."), style);
                GUI.Label(new Rect(GuiBase.Width(0f), GuiBase.Height((float)(num + 100)), GuiBase.Width(550f), GuiBase.Height(30f)), new GUIContent("Total Pet Power: " + App.State.Ext.GetTotalPetPower(true).ToGuiText(true), "The total power your pets have to fight the gods. The damage you do is (total power / 3 - god defense) / 5000 * milliseconds. \nCriticals from TBS are also possible."), style);
                num += 115;
                int num3 = 20;
                int num4 = num;
                int num5 = 0;
                foreach (Pet current in App.State.Ext.AllPets)
                {
                    if (current.CurrentHealth > 0 && !current.IsInCampaign)
                    {
                        GUI.Label(new Rect(GuiBase.Width((float)num3), GuiBase.Height((float)PetUi.GetPetTop(current.TypeEnum, num4)), GuiBase.Width(40f), GuiBase.Height(40f)), new GUIContent(current.Image, "Pets who are available for fighting against the gods. Pets with no health or who are in campaigns can't participate."));
                        num5++;
                        num4 += 5;
                        if (num5 > App.State.Ext.AllPets.Count / 2)
                        {
                            num4 -= 10;
                        }
                        num3 += 20;
                    }
                }
                num  += 120;
                num2 -= 220;
            }
            GUIStyle style2 = GUI.skin.GetStyle("Button");

            style2.fontSize = GuiBase.FontSize(18);
            style.fontStyle = FontStyle.Bold;
            GUI.Label(new Rect(GuiBase.Width(25f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), "God");
            GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), "Unlocks", style);
            style.fontStyle = FontStyle.Normal;
            num            += 35;
            if (App.State.PremiumBoni.TotalMightIsUnlocked && GUI.Button(new Rect(GuiBase.Width(520f), GuiBase.Height(10f), GuiBase.Width(140f), GuiBase.Height(30f)), "Unleash Might"))
            {
                if (SpecialFightUi.IsFighting)
                {
                    GuiBase.ShowToast("Please finish your special fight first°");
                }
                else
                {
                    int num6 = 0;
                    foreach (Might current2 in App.State.AllMights)
                    {
                        if (current2.IsUsable && current2.UseCoolDown == 0L && current2.DurationLeft <= 0L)
                        {
                            current2.Unleash();
                            num6++;
                        }
                    }
                    if (num6 > 0)
                    {
                        GuiBase.ShowToast("Multi unleash!");
                    }
                    else
                    {
                        GuiBase.ShowToast("Skills are on cooldown, please wait a bit.");
                    }
                }
            }
            this.scrollPosition = GuiBase.TouchScrollView(new Rect(GuiBase.Width(0f), GuiBase.Height((float)num), GuiBase.Width(650f), GuiBase.Height((float)num2)), this.scrollPosition, new Rect(0f, GuiBase.Height((float)num), GuiBase.Width(620f), GuiBase.Height((float)(this.marginTop - num))));
            if (this.marginTop < 390)
            {
                GUIStyle style3 = GUI.skin.GetStyle("scrollview");
                style3.normal.background = null;
            }
            this.marginTop = num;
            bool flag = true;

            for (int i = 0; i < App.State.AllCreations.Count; i++)
            {
                Creation creation = App.State.AllCreations[i];
                if (!creation.GodToDefeat.IsDefeated)
                {
                    flag = false;
                }
            }
            if (App.State.PrinnyBaal.IsUnlocked && flag)
            {
                style.fontSize = GuiBase.FontSize(16);
                GuiBase.CreateProgressBar(this.marginTop, App.State.PrinnyBaal.getPercentOfHP(), App.State.PrinnyBaal.Name, App.State.PrinnyBaal.Description, GuiBase.progressBg, GuiBase.progressFgRed);
                if (App.State.PrinnyBaal.IsFighting)
                {
                    GUI.Toggle(new Rect(GuiBase.Width(430f), GuiBase.Height((float)this.marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), true, "Fighting...", GUI.skin.GetStyle("Button"));
                    style.alignment = TextAnchor.MiddleLeft;
                    GUI.Label(new Rect(GuiBase.Width(35f), GuiBase.Height((float)(this.marginTop + 35)), GuiBase.Width(400f), GuiBase.Height(30f)), "Your damage /s: " + App.State.PrinnyBaal.DamageSec.ToGuiText(true), style);
                    style.alignment = TextAnchor.UpperCenter;
                    if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)this.marginTop), GuiBase.Width(70f), GuiBase.Height(30f)), "Stop"))
                    {
                        GodUi.EnableCreating();
                    }
                    this.marginTop += 35;
                }
                else if (GUI.Button(new Rect(GuiBase.Width(430f), GuiBase.Height((float)this.marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), "Fight"))
                {
                    App.State.PrinnyBaal.IsFighting = true;
                    GodUi.DisableCreation();
                }
            }
            else
            {
                for (int j = 0; j < App.State.AllCreations.Count; j++)
                {
                    Creation creation2 = App.State.AllCreations[j];
                    if (!creation2.GodToDefeat.IsDefeated)
                    {
                        style.fontSize = GuiBase.FontSize(16);
                        GuiBase.CreateProgressBar(this.marginTop, creation2.GodToDefeat.getPercentOfHP(), creation2.GodToDefeat.Name, creation2.Description, GuiBase.progressBg, GuiBase.progressFgRed);
                        GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)this.marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), creation2.Name, style);
                        if (creation2.IsActive)
                        {
                            GUI.Toggle(new Rect(GuiBase.Width(430f), GuiBase.Height((float)this.marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), true, "Fighting...", GUI.skin.GetStyle("Button"));
                            style.alignment = TextAnchor.MiddleLeft;
                            GUI.Label(new Rect(GuiBase.Width(35f), GuiBase.Height((float)(this.marginTop + 35)), GuiBase.Width(400f), GuiBase.Height(30f)), "Your damage /s: " + creation2.GodToDefeat.DamageSec.ToGuiText(true), style);
                            style.alignment = TextAnchor.UpperCenter;
                            if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)this.marginTop), GuiBase.Width(70f), GuiBase.Height(30f)), "Stop"))
                            {
                                GodUi.EnableCreating();
                            }
                            this.marginTop += 35;
                        }
                        else if (GUI.Button(new Rect(GuiBase.Width(430f), GuiBase.Height((float)this.marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), "Fight"))
                        {
                            bool flag2 = true;
                            foreach (Creation current3 in App.State.AllCreations)
                            {
                                if (current3.TypeEnum < creation2.TypeEnum && !current3.GodToDefeat.IsDefeated)
                                {
                                    flag2 = false;
                                }
                            }
                            if (!flag2)
                            {
                                GuiBase.ShowToast("You need to defeat all previous gods first!");
                            }
                            else
                            {
                                App.State.PrinnyBaal.IsFighting = false;
                                bool isActive = creation2.IsActive;
                                GodUi.DisableCreation();
                                creation2.IsActive = !isActive;
                            }
                        }
                        this.marginTop += 35;
                    }
                }
            }
            GUI.EndScrollView();
            GUI.EndGroup();
        }
Esempio n. 4
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;
        }
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (MightUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         MightUi.scrollBarsToZero = false;
     }
     foreach (Might current in App.State.AllMights)
     {
         if (current.ShadowCloneCount > 0)
         {
             current.ShouldUpdateText = true;
         }
         if (current.TypeEnum == Might.MightType.focused_breathing)
         {
             marginTop           += 35;
             labelStyle.alignment = TextAnchor.UpperCenter;
             labelStyle.fontStyle = FontStyle.Bold;
             labelStyle.fontSize  = GuiBase.FontSize(18);
             GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), "Usable Skills");
             labelStyle.fontStyle = FontStyle.Normal;
             marginTop           += 35;
         }
         labelStyle.fontSize = GuiBase.FontSize(16);
         GuiBase.CreateProgressBar(marginTop, current.getPercent(), current.Name, current.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
         GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), current.Level.CommaFormatted);
         GUI.Label(new Rect(GuiBase.Width(380f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), current.ShadowCloneCount.CommaFormatted);
         if (App.CurrentPlattform == Plattform.Android)
         {
             GUIStyle textField = Gui.ChosenSkin.textField;
             if (GUI.Button(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.NextAt.ToString(), textField))
             {
                 Might migh = current;
                 base.ShowNumberInput("Next at for " + migh.Name, migh.NextAt, 2147483647, delegate(CDouble x)
                 {
                     migh.NextAt = x.ToInt();
                 });
             }
         }
         else
         {
             int    num = 0;
             string s   = GUI.TextField(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.NextAt.ToString());
             int.TryParse(s, out num);
             if (num >= 0)
             {
                 current.NextAt = num;
             }
         }
         if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
         {
             current.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
         }
         if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
         {
             current.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
         }
         if (current.IsUsable)
         {
             marginTop += 35;
             if (current.DurationLeft > 0L)
             {
                 float num2 = GuiBase.Width(185f);
                 GUI.BeginGroup(new Rect(GuiBase.Width(30f), GuiBase.Height((float)marginTop), num2, GuiBase.Height(25f)));
                 GUI.DrawTexture(new Rect(0f, 0f, num2, GuiBase.Height(25f)), GuiBase.progressBg);
                 float num3  = (float)current.DurationLeft / ((float)current.UseDuration * 1000f);
                 float width = num3 * num2;
                 float x2    = 0f;
                 GUI.DrawTexture(new Rect(x2, 0f, width, GuiBase.Height(25f)), GuiBase.progressFgGreen);
                 GUI.EndGroup();
             }
             else if (current.UseCoolDown > 0L)
             {
                 double percent = (double)current.UseCoolDown / 3600000.0;
                 GuiBase.CreateProgressBar(marginTop, percent, Conv.MsToGuiText(current.UseCoolDown, true), current.UnleashDesc + "\n\nYou can use it again when timer hits zero.", GuiBase.progressBg, GuiBase.progressFgRed);
             }
             else if (GUI.Button(new Rect(GuiBase.Width(60f), GuiBase.Height((float)marginTop), GuiBase.Width(120f), GuiBase.Height(30f)), new GUIContent("Unleash", current.UnleashDesc)))
             {
                 if (SpecialFightUi.IsFighting)
                 {
                     GuiBase.ShowToast("Please finish your special fight first!");
                 }
                 else
                 {
                     current.Unleash();
                 }
             }
         }
         marginTop += 35;
     }
 }
 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++;
 }
Esempio n. 7
0
 public static void CreateProgressBar(int marginTop, double percent, string name, string mouseover, Texture2D bgImage, Texture2D fgImage)
 {
     GuiBase.CreateProgressBar(30, marginTop, 185f, 31f, percent, name, mouseover, bgImage, fgImage);
 }
Esempio n. 8
0
 public static void CreateBossHPBar(int marginLeft, int marginTop, float width, float height, double percent, string name)
 {
     GuiBase.CreateProgressBar(marginLeft, marginTop, width, height, percent, name, string.Empty, GuiBase.progressBg, GuiBase.progressFgRed);
 }
Esempio n. 9
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 Show()
        {
            if (CreatingUi.scrollBarsToZero)
            {
                this.scrollPosition         = Vector2.zero;
                CreatingUi.scrollBarsToZero = false;
            }
            if (this.IsAchievement)
            {
                GuiBase.ShowAchievements(App.State.CreatingAchievements, "creating");
                return;
            }
            GUIStyle style = GUI.skin.GetStyle("Label");

            if (this.showAutoBuyOptions)
            {
                this.ShowAutoBuyOptions();
            }
            else if (this.creationToShow != null)
            {
                this.ShowBuyCreations();
            }
            else
            {
                style.fontSize = GuiBase.FontSize(16);
                GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
                GUI.BeginGroup(new Rect(GuiBase.Width(280f), GuiBase.Height(110f), GuiBase.Width(670f), GuiBase.Height(480f)));
                int num = 20;
                GUI.Label(new Rect(GuiBase.Width(345f), GuiBase.Height((float)(num - 7)), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent("Create Clones if not max", "If this is on, shadow clones will be created instead of the selected creation if they are not maxed already."));
                App.State.GameSettings.CreateShadowClonesIfNotMax = GUI.Toggle(new Rect(GuiBase.Width(580f), GuiBase.Height((float)(num - 5)), GuiBase.Width(70f), GuiBase.Height(30f)), App.State.GameSettings.CreateShadowClonesIfNotMax, new GUIContent(string.Empty));
                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!"
                        });
                    }
                    App.State.GameSettings.AutoBuyCreations = GUI.Toggle(new Rect(GuiBase.Width(580f), GuiBase.Height((float)(num + 22)), GuiBase.Width(70f), GuiBase.Height(30f)), App.State.GameSettings.AutoBuyCreations, new GUIContent(string.Empty));
                    if (GUI.Button(new Rect(GuiBase.Width(345f), GuiBase.Height((float)(num + 20)), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Auto buy missing creations", text + "\nClick this button for more advanced settings.")))
                    {
                        this.showAutoBuyOptions = true;
                    }
                }
                num += 50;
                if (App.State.PremiumBoni.CreationCountBoni(true) > 0)
                {
                    num -= 25;
                    if (App.State.GameSettings.CreationToCreateCount == 0)
                    {
                        App.State.GameSettings.CreationToCreateCount = 1;
                    }
                    int num2 = App.State.PremiumBoni.CreationCountBoni(true).ToInt() + 1;
                    GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height(15f), GuiBase.Width(155f), GuiBase.Height(30f)), new GUIContent("Creations to create: ", "Cost of resources to create one creation with 1 = 100%, 2 = 195% ... 10 = 775%, 11 = 825%, 12 = 875%..., Creation/s is 100% + 5% for each more than one."));
                    if (App.State.IsCrystalFactoryAvailable)
                    {
                        App.State.GameSettings.MaxAfterEquipCrystal = GUI.Toggle(new Rect(GuiBase.Width(240f), GuiBase.Height((float)(num - 25)), GuiBase.Width(70f), GuiBase.Height(30f)), App.State.GameSettings.MaxAfterEquipCrystal, new GUIContent(string.Empty, "If this is on, your creation count will be adjusted to your maximum count after equipping crystals."));
                    }
                    if (App.CurrentPlattform == Plattform.Android)
                    {
                        GUIStyle textField = Gui.ChosenSkin.textField;
                        if (GUI.Button(new Rect(GuiBase.Width(185f), GuiBase.Height(15f), GuiBase.Width(45f), GuiBase.Height(25f)), App.State.GameSettings.CreationToCreateCount.ToString(), textField))
                        {
                            base.ShowNumberInput("Creations to create (Max = " + (App.State.PremiumBoni.CreationCountBoni(true).ToInt() + 1) + ")", App.State.GameSettings.CreationToCreateCount, App.State.PremiumBoni.CreationCountBoni(true).ToInt() + 1, delegate(CDouble x)
                            {
                                App.State.GameSettings.CreationToCreateCount = x.ToInt();
                            });
                        }
                    }
                    else
                    {
                        this.CreationInput = GUI.TextField(new Rect(GuiBase.Width(185f), GuiBase.Height(15f), GuiBase.Width(45f), GuiBase.Height(25f)), App.State.GameSettings.CreationToCreateCount.ToString());
                    }
                    Rect position = new Rect(GuiBase.Width(30f), GuiBase.Height(50f), GuiBase.Width(200f), GuiBase.Height(30f));
                    if (position.Contains(Event.current.mousePosition) && this.creationCount != App.State.GameSettings.CreationToCreateCount)
                    {
                        this.creationCount = App.State.GameSettings.CreationToCreateCount;
                        foreach (Creation current in App.State.AllCreations)
                        {
                            current.InitSubItemCost(0);
                        }
                    }
                    App.State.GameSettings.CreationToCreateCount = (int)GUI.HorizontalSlider(position, (float)App.State.GameSettings.CreationToCreateCount, 1f, (float)num2);
                    num += 25;
                }
                style.alignment = TextAnchor.UpperCenter;
                style.fontStyle = FontStyle.Bold;
                GUI.Label(new Rect(GuiBase.Width(25f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), "You are creating:");
                if (App.State.CreatingSpeedBoniDuration > 0L)
                {
                    GUI.Label(new Rect(GuiBase.Width(235f), GuiBase.Height((float)num), GuiBase.Width(400f), GuiBase.Height(30f)), "300% creation speed for the next " + Conv.MsToGuiText(App.State.CreatingSpeedBoniDuration, true) + "!");
                }
                style.fontStyle = FontStyle.Normal;
                num            += 35;
                Creation activeCreation = App.State.GameSettings.LastCreation;
                if (activeCreation == null)
                {
                    activeCreation = App.State.AllCreations.FirstOrDefault((Creation x) => x.IsActive);
                }
                if (activeCreation == null)
                {
                    activeCreation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Shadow_clone);
                }
                GuiBase.CreateProgressBar(num, activeCreation.getPercent(), activeCreation.Name, activeCreation.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
                style.alignment = TextAnchor.UpperLeft;
                GUI.Label(new Rect(GuiBase.Width(255f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), "You have: " + activeCreation.Count.ToGuiText(true));
                string text2 = "Change creation";
                if (this.ChooseCreationIsOpen)
                {
                    text2 = "More Info";
                }
                if (GUI.Button(new Rect(GuiBase.Width(485f), GuiBase.Height((float)(num + 10)), GuiBase.Width(140f), GuiBase.Height(30f)), text2))
                {
                    this.ChooseCreationIsOpen = !this.ChooseCreationIsOpen;
                    if (this.ChooseCreationIsOpen)
                    {
                        this.scrollPosition = this.scrollPositionAllCreations;
                    }
                    else
                    {
                        this.scrollPositionAllCreations = this.scrollPosition;
                        this.scrollPosition             = Vector2.zero;
                    }
                }
                num += 25;
                GUI.Label(new Rect(GuiBase.Width(255f), GuiBase.Height((float)num), GuiBase.Width(250f), GuiBase.Height(30f)), "You created: " + activeCreation.TotalCreated.ToGuiText(true));
                num += 35;
                List <CreationCost> list = CreationCost.RequiredCreations(activeCreation.TypeEnum, 0L, false);
                int num3 = 290;
                if (this.ChooseCreationIsOpen)
                {
                    style.fontStyle = FontStyle.Bold;
                    GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)num), GuiBase.Width(150f), GuiBase.Height(30f)), "Creation");
                    GUI.Label(new Rect(GuiBase.Width(160f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(30f)), "Count", style);
                    GUI.Label(new Rect(GuiBase.Width(290f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(30f)), "Next At", style);
                    GUI.Label(new Rect(GuiBase.Width(375f), GuiBase.Height((float)num), GuiBase.Width(150f), GuiBase.Height(30f)), "Achieve.", style);
                    style.fontStyle = FontStyle.Normal;
                    GUI.Label(new Rect(GuiBase.Width(475f), GuiBase.Height((float)num), GuiBase.Width(40f), GuiBase.Height(30f)), new GUIContent("N A", "Off will ignore the next at. 1 will go to the next creation if the current number reached the count. 2 will go to the next creation if you created the count by yourself."), style);
                    App.State.GameSettings.CreationsNextAtMode = GUI.Toolbar(new Rect(GuiBase.Width(510f), GuiBase.Height((float)(num - 5)), GuiBase.Width(135f), GuiBase.Height(30f)), App.State.GameSettings.CreationsNextAtMode, this.toolbarNextAt);
                    num  += 35;
                    num3 -= 35;
                }
                this.scrollPosition = GuiBase.TouchScrollView(new Rect(GuiBase.Width(0f), GuiBase.Height((float)num), GuiBase.Width(660f), GuiBase.Height((float)num3)), this.scrollPosition, new Rect(0f, GuiBase.Height((float)num), GuiBase.Width(620f), GuiBase.Height((float)this.svHeight)));
                Achievement first = null;
                if (this.ChooseCreationIsOpen)
                {
                    for (int i = 0; i < App.State.AllCreations.Count; i++)
                    {
                        Creation creation = App.State.AllCreations[i];
                        if (creation.IsActive)
                        {
                            style.fontStyle = FontStyle.Bold;
                        }
                        GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height((float)num), GuiBase.Width(145f), GuiBase.Height(30f)), new GUIContent(creation.Name, creation.Description), style);
                        GUI.Label(new Rect(GuiBase.Width(160f), GuiBase.Height((float)num), GuiBase.Width(150f), GuiBase.Height(35f)), creation.Count.ToGuiText(true), style);
                        if (App.CurrentPlattform == Plattform.Android && creation.TypeEnum != Creation.CreationType.Shadow_clone)
                        {
                            GUIStyle textField2 = Gui.ChosenSkin.textField;
                            if (GUI.Button(new Rect(GuiBase.Width(290f), GuiBase.Height((float)num), GuiBase.Width(70f), GuiBase.Height(25f)), creation.NextAtCount + string.Empty, textField2))
                            {
                                base.ShowNumberInput("Next at for " + creation.Name, creation.NextAtCount, 2147483647, delegate(CDouble x)
                                {
                                    creation.NextAtCount = x.ToInt();
                                });
                            }
                        }
                        else if (creation.TypeEnum != Creation.CreationType.Shadow_clone)
                        {
                            creation.NextAtString = GUI.TextField(new Rect(GuiBase.Width(290f), GuiBase.Height((float)num), GuiBase.Width(70f), GuiBase.Height(25f)), creation.NextAtCount.ToString());
                        }
                        if (!creation.GodToDefeat.IsDefeated)
                        {
                            GUI.Label(new Rect(GuiBase.Width(365f), GuiBase.Height((float)num), GuiBase.Width(300f), GuiBase.Height(30f)), "Defeat " + creation.GodToDefeat.Name + " to unlock", style);
                        }
                        else
                        {
                            first = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.IntEnum == (int)creation.TypeEnum);
                            if (first != null)
                            {
                                this.AddAchievementImg(first, 370, num, 25);
                                Achievement achievement = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.Id == first.Id + 1);
                                this.AddAchievementImg(achievement, 405, num, 25);
                                Achievement achievement2 = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.Id == first.Id + 2);
                                this.AddAchievementImg(achievement2, 440, num, 25);
                            }
                            if (App.State.IsBuyUnlocked && creation.CanBuy && creation.TypeEnum != Creation.CreationType.Shadow_clone && GUI.Button(new Rect(GuiBase.Width(565f), GuiBase.Height((float)num), GuiBase.Width(60f), GuiBase.Height(25f)), "Buy"))
                            {
                                this.creationToShow = creation;
                            }
                            if (GUI.Button(new Rect(GuiBase.Width(475f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(25f)), "Create"))
                            {
                                bool flag = false;
                                foreach (Creation current2 in App.State.AllCreations)
                                {
                                    if (!current2.GodToDefeat.IsDefeated && current2.IsActive)
                                    {
                                        flag = true;
                                    }
                                }
                                if (App.State.PrinnyBaal.IsFighting)
                                {
                                    flag = true;
                                }
                                if (flag)
                                {
                                    GuiBase.ShowToast("You can't create something while you fight a god!");
                                    App.State.GameSettings.LastCreation = creation;
                                }
                                else
                                {
                                    foreach (Creation current3 in App.State.AllCreations)
                                    {
                                        current3.IsActive = false;
                                    }
                                    creation.IsActive = true;
                                    App.State.GameSettings.LastCreation = creation;
                                    foreach (UltimateBeingV2 current4 in App.State.HomePlanet.UltimateBeingsV2)
                                    {
                                        current4.isCreating = false;
                                    }
                                }
                            }
                        }
                        if (creation.IsActive)
                        {
                            style.fontStyle = FontStyle.Normal;
                        }
                        num += 30;
                    }
                }
                else
                {
                    first = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.IntEnum == (int)activeCreation.TypeEnum);
                    if (first != null)
                    {
                        GUI.Label(new Rect(GuiBase.Width(35f), GuiBase.Height((float)(num + 10)), GuiBase.Width(200f), GuiBase.Height(50f)), "Achievements for " + activeCreation.Name + ":");
                        this.AddAchievementImg(first, 255, num, 40);
                        Achievement achievement3 = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.Id == first.Id + 1);
                        this.AddAchievementImg(achievement3, 315, num, 40);
                        Achievement achievement4 = App.State.CreatingAchievements.FirstOrDefault((Achievement x) => x.Id == first.Id + 2);
                        this.AddAchievementImg(achievement4, 375, num, 40);
                        num += 70;
                    }
                    if (list.Count > 0)
                    {
                        style.fontStyle = FontStyle.Bold;
                        int num4 = App.State.GameSettings.CreationToCreateCount;
                        if (num4 == 0)
                        {
                            num4 = 1;
                        }
                        GUI.Label(new Rect(GuiBase.Width(35f), GuiBase.Height((float)num), GuiBase.Width(210f), GuiBase.Height(50f)), string.Concat(new object[]
                        {
                            "Creations for ",
                            num4,
                            " x ",
                            activeCreation.Name
                        }));
                        if (activeCreation.Name.Length > 8)
                        {
                            num += 20;
                        }
                        style.alignment = TextAnchor.UpperCenter;
                        GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), " you need");
                        GUI.Label(new Rect(GuiBase.Width(335f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), " you have");
                        style.fontStyle = FontStyle.Normal;
                        num            += 30;
                        using (List <CreationCost> .Enumerator enumerator5 = list.GetEnumerator())
                        {
                            while (enumerator5.MoveNext())
                            {
                                CreationCost requirement = enumerator5.Current;
                                Creation     creation3   = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == requirement.TypeEnum);
                                GuiBase.CreateProgressBar(num, creation3.getPercent(), EnumName.Name(requirement.TypeEnum), creation3.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
                                GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)(num + 5)), GuiBase.Width(200f), GuiBase.Height(30f)), requirement.CountNeeded.ToGuiText(true));
                                GUI.Label(new Rect(GuiBase.Width(335f), GuiBase.Height((float)(num + 5)), GuiBase.Width(200f), GuiBase.Height(30f)), creation3.Count.ToGuiText(true));
                                if (App.State.IsBuyUnlocked && creation3.CanBuy && creation3.TypeEnum != Creation.CreationType.Shadow_clone && GUI.Button(new Rect(GuiBase.Width(545f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(30f)), "Buy"))
                                {
                                    this.creationToShow = creation3;
                                }
                                num += 35;
                            }
                        }
                        if (activeCreation.SubItemCreationCost.Count > 0)
                        {
                            num            += 10;
                            style.alignment = TextAnchor.UpperLeft;
                            style.fontStyle = FontStyle.Bold;
                            GUI.Label(new Rect(GuiBase.Width(35f), GuiBase.Height((float)num), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent("Prerequisite Creations", "All creations needed to create the creations you need to create one." + activeCreation.Name));
                            style.alignment = TextAnchor.UpperCenter;
                            style.fontStyle = FontStyle.Normal;
                            num            += 30;
                            using (List <CreationCost> .Enumerator enumerator6 = activeCreation.SubItemCreationCost.GetEnumerator())
                            {
                                while (enumerator6.MoveNext())
                                {
                                    CreationCost requirement = enumerator6.Current;
                                    Creation     creation2   = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == requirement.TypeEnum);
                                    GuiBase.CreateProgressBar(num, creation2.getPercent(), EnumName.Name(requirement.TypeEnum), creation2.Description, GuiBase.progressBg, GuiBase.progressFgBlue);
                                    GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)(num + 5)), GuiBase.Width(200f), GuiBase.Height(30f)), requirement.CountNeeded.ToGuiText(true));
                                    GUI.Label(new Rect(GuiBase.Width(335f), GuiBase.Height((float)(num + 5)), GuiBase.Width(200f), GuiBase.Height(30f)), creation2.Count.ToGuiText(true));
                                    if (App.State.IsBuyUnlocked && creation2.CanBuy && creation2.TypeEnum != Creation.CreationType.Shadow_clone && GUI.Button(new Rect(GuiBase.Width(545f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(30f)), "Buy"))
                                    {
                                        this.creationToShow = creation2;
                                    }
                                    num += 35;
                                }
                            }
                        }
                    }
                }
                this.svHeight = num - 150;
                GUI.EndScrollView();
                GUI.EndGroup();
            }
        }
Esempio 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++;
 }
Esempio n. 12
0
        private void FightUB()
        {
            int      num   = 10;
            int      num2  = 10;
            GUIStyle style = GUI.skin.GetStyle("Label");

            GUI.BeginGroup(new Rect(GuiBase.Width(280f), GuiBase.Height(110f), GuiBase.Width(670f), GuiBase.Height(480f)));
            GUI.Box(new Rect(GuiBase.Width(10f), GuiBase.Height(0f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            string text = App.State.AvatarName;

            if (string.IsNullOrEmpty(text))
            {
                text = "Guest";
            }
            if (GUI.Button(new Rect(GuiBase.Width(20f), GuiBase.Height((float)num), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Flee")))
            {
                this.Battle.IsFighting = false;
                GuiBase.ShowToast("You ran away! You gained a new title: Chicken God!");
                App.State.Title = "Chicken God";
                if (App.State.Avatar.IsFemale)
                {
                    App.State.Title = "Chicken Goddess";
                }
                App.State.TitleGod = "nothing, but you were able to run away really fast.";
            }
            style.fontSize  = GuiBase.FontSize(14);
            style.alignment = TextAnchor.UpperCenter;
            GUI.Label(new Rect(GuiBase.Width(385f), GuiBase.Height((float)(num + 35)), GuiBase.Width(185f), GuiBase.Height(30f)), "Damage Reduction: " + this.Battle.Being.DamageReduction.ToGuiText(true) + " %");
            style.fontStyle = FontStyle.Bold;
            style.fontSize  = GuiBase.FontSize(16);
            GuiBase.CreateProgressBar(130, num + 1, 185f, 31f, this.Battle.PlayerHp.Double / App.State.MaxHealth.Double, text, this.Battle.PlayerHp.ToGuiText(true) + " / " + App.State.MaxHealth.ToGuiText(true), GuiBase.progressBg, GuiBase.progressFgRed);
            GuiBase.CreateProgressBar(130, num + 31, 185f, 31f, this.Battle.PlayerEnergy.Double / 1000.0, this.Battle.PlayerEnergy.ToGuiText(true) + " / 1000", "Your energy. You will recover 10 each turn.", GuiBase.progressBg, GuiBase.progressFgBlue);
            string str = this.Battle.Being.HPPercent.ToGuiText(false);

            if (this.Battle.Being.HPPercent < 0.01)
            {
                str = "Less than 0.01";
            }
            GuiBase.CreateProgressBar(385, num + 1, 185f, 31f, this.Battle.Being.HPPercent.Double / 100.0, this.Battle.Being.Name, "Health: " + str + " %", GuiBase.progressBg, GuiBase.progressFgRed);
            style.fontSize = GuiBase.FontSize(22);
            GUI.Label(new Rect(GuiBase.Width(325f), GuiBase.Height((float)num), GuiBase.Width(60f), GuiBase.Height(30f)), "VS");
            style.fontSize  = GuiBase.FontSize(16);
            style.alignment = TextAnchor.UpperLeft;
            num            += 80;
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 10)), GuiBase.Height((float)num), GuiBase.Width(150f), GuiBase.Height(45f)), "Current Turn: " + this.Battle.TurnCount);
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 160)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "Clones left: " + App.State.HomePlanet.ShadowCloneCount);
            style.fontStyle = FontStyle.Normal;
            num            += 30;
            style.fontSize  = GuiBase.FontSize(14);
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 430)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "Dodge Chance = " + this.Battle.DodgeChance + " %");
            num += 20;
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 10)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), new GUIContent("Your Damage: " + this.Battle.Damage.ToGuiText(true) + " %", "The base damage multiplier is 100 + Physical Attack + training in 'Might'."));
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 220)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), new GUIContent("Damage Reduction: " + this.Battle.DamageReduction.ToGuiText(true) + " %", "The base damage reduction is Mystic Defense + training in 'Might' / 10 with a maximum of 75%."));
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 430)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "Counter Chance = " + this.Battle.CounterChance + " %");
            num += 20;
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 430)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "Damage Reflect = " + this.Battle.DamageReflect);
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 220)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "God Speed: " + (this.Battle.GodSpeedModeDuration / 2).Floored + " turns");
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 10)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(45f)), "Double Damage = " + this.Battle.DoubleUp);
            num += 40;
            GUI.Label(new Rect(GuiBase.Width((float)(num2 + 10)), GuiBase.Height((float)num), GuiBase.Width(640f), GuiBase.Height(130f)), this.Battle.InfoText);
            GUIStyle style2 = GUI.skin.GetStyle("Button");

            style2.fontSize = GuiBase.FontSize(13);
            num            += 130;
            num2            = 20;
            int num3 = 0;

            foreach (SkillUB2 current in this.Battle.PlayerSkills)
            {
                if (GUI.Button(new Rect(GuiBase.Width((float)num2), GuiBase.Height((float)num), GuiBase.Width(152f), GuiBase.Height(30f)), new GUIContent(current.Name, current.Desc)))
                {
                    this.Battle.NextTurn(current);
                }
                if (current.TypeEnum == SkillTypeUBV2.FocusedBreathing || current.TypeEnum == SkillTypeUBV2.IonioiHeroSummon)
                {
                    num3++;
                }
                num2 += 161;
                num3++;
                if (num3 % 4 == 0)
                {
                    num2 = 20;
                    num += 35;
                }
            }
            GUI.EndGroup();
        }
Esempio n. 13
0
 private void showUBV2s(int marginTop, GUIStyle labelStyle)
 {
     using (List <UltimateBeingV2> .Enumerator enumerator = App.State.HomePlanet.UltimateBeingsV2.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             UltimateBeingV2 being = enumerator.Current;
             if (!being.IsDefeated)
             {
                 labelStyle.fontSize = GuiBase.FontSize(16);
                 if (being.IsAvailable)
                 {
                     string text = being.Description;
                     if (being.HPPercent < 100)
                     {
                         text = text + "\nHp left: " + being.HPPercent.ToGuiText(true) + " %";
                     }
                     GuiBase.CreateProgressBar(marginTop, being.HPPercent.Double / 100.0, being.Name, text, GuiBase.progressBg, GuiBase.progressFgRed);
                     if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Fight", string.Concat(new object[]
                     {
                         "If you win, you will receive ",
                         being.Tier * 10,
                         " God Power and your Multi from Ultimate Beings will increase by ",
                         being.GetMultiplier(App.State.HomePlanet.UBMultiplier).ToGuiText(true),
                         " %"
                     }))))
                     {
                         if (App.State.CurrentHealth * 2 < App.State.MaxHealth || App.State.HomePlanet.ShadowCloneCount < 100000)
                         {
                             GuiBase.ShowToast("Your need at least 50% of your health and 100000 Clones on Powersurge to be able to start a fight.");
                         }
                         else
                         {
                             this.Battle = BattleUBV2.Instance;
                             this.Battle.start(being);
                         }
                     }
                     marginTop += 35;
                     Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == being.CreationNeeded);
                     string   str      = string.Empty;
                     if (creation != null)
                     {
                         str = "\n\nYou have " + creation.Count.GuiText + " x " + creation.Name;
                     }
                     GuiBase.CreateProgressBar(marginTop, being.CurrentCreationDuration.Double / being.CreationDuration.Double, being.CreationName, being.CreationDescription + str, GuiBase.progressBg, GuiBase.progressFgBlue);
                     being.StopAtString = GUI.TextField(new Rect(GuiBase.Width(350f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), being.StopAtString);
                     if (!being.isCreating)
                     {
                         if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Create", "If you create a " + being.CreationName + ", you can't create anything else until you stop it.")))
                         {
                             being.isCreating = true;
                             being.InitDuration(App.State);
                             foreach (Creation current in App.State.AllCreations)
                             {
                                 current.IsActive = false;
                             }
                         }
                     }
                     else if (GUI.Button(new Rect(GuiBase.Width(550f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), "Stop"))
                     {
                         being.isCreating = false;
                         being.GoBackToCreating();
                     }
                     GUI.Label(new Rect(GuiBase.Width(235f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), string.Empty + being.CreationCount.ToGuiText(true), labelStyle);
                 }
                 marginTop += 35;
             }
         }
     }
     labelStyle.alignment = TextAnchor.UpperLeft;
     GUI.Label(new Rect(GuiBase.Width(240f), GuiBase.Height((float)(marginTop - 5)), 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 - 5)), 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.ToGuiText(true),
         " %\nMulti from Ultimate Beings: ",
         App.State.HomePlanet.UBMultiplier.ToGuiText(true),
         " %"
     })), labelStyle);
     labelStyle.fontStyle = FontStyle.Normal;
 }
Esempio n. 14
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!");
             }
         }
     }
 }
Esempio n. 15
0
 protected override void ShowScrollViewElements(int marginTop, GUIStyle labelStyle)
 {
     if (MonumentUi.scrollBarsToZero)
     {
         base.SetScrollbarPosition(Vector2.zero);
         MonumentUi.scrollBarsToZero = false;
     }
     foreach (Monument current in App.State.AllMonuments)
     {
         labelStyle.fontSize = GuiBase.FontSize(16);
         GuiBase.CreateProgressBar(marginTop, current.getPercent(), current.Name, current.Description + current.MissingItems, GuiBase.progressBg, GuiBase.progressFgBlue);
         labelStyle.fontSize = GuiBase.FontSize(18);
         GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), current.Level.CommaFormatted, labelStyle);
         GUI.Label(new Rect(GuiBase.Width(380f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), current.ShadowCloneCount.CommaFormatted, labelStyle);
         if (current.IsAvailable)
         {
             if (current.ShadowCloneCount > 0)
             {
                 current.ShouldUpdateText = true;
             }
             if (App.CurrentPlattform == Plattform.Android)
             {
                 GUIStyle textField = Gui.ChosenSkin.textField;
                 if (GUI.Button(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.StopAt + string.Empty, textField))
                 {
                     Monument monu = current;
                     base.ShowNumberInput("Next at for " + current.Name, current.StopAt, 2147483647, delegate(CDouble x)
                     {
                         monu.StopAt = x.ToInt();
                     });
                 }
             }
             else
             {
                 current.StopAtString = GUI.TextField(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.StopAtString);
             }
             if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
             {
                 current.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
             }
             if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
             {
                 current.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
             }
             if (current.Upgrade.IsAvailable)
             {
                 if (current.Upgrade.ShadowCloneCount > 0)
                 {
                     current.Upgrade.ShouldUpdateText = true;
                 }
                 marginTop          += 35;
                 labelStyle.fontSize = GuiBase.FontSize(16);
                 GuiBase.CreateProgressBar(marginTop, current.Upgrade.getPercent(), current.Upgrade.Name, current.Upgrade.Description + current.Upgrade.MissingItems, GuiBase.progressBg, GuiBase.progressFgGreen);
                 labelStyle.fontSize = GuiBase.FontSize(18);
                 GUI.Label(new Rect(GuiBase.Width(210f), GuiBase.Height((float)marginTop), GuiBase.Width(110f), GuiBase.Height(30f)), current.Upgrade.Level.CommaFormatted, labelStyle);
                 GUI.Label(new Rect(GuiBase.Width(380f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), current.Upgrade.ShadowCloneCount.CommaFormatted, labelStyle);
                 if (App.CurrentPlattform == Plattform.Android)
                 {
                     Monument monu       = current;
                     GUIStyle textField2 = Gui.ChosenSkin.textField;
                     if (GUI.Button(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), monu.Upgrade.StopAt + string.Empty, textField2))
                     {
                         base.ShowNumberInput("Stop at for " + monu.Name + " " + monu.Upgrade.Name, monu.Upgrade.StopAt, 2147483647, delegate(CDouble x)
                         {
                             monu.Upgrade.StopAt = x.ToInt();
                         });
                     }
                 }
                 else
                 {
                     current.Upgrade.StopAtString = GUI.TextField(new Rect(GuiBase.Width(315f), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), current.Upgrade.StopAtString);
                 }
                 if (GUI.Button(new Rect(GuiBase.Width(500f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+"))
                 {
                     current.Upgrade.AddCloneCount(App.State.GameSettings.ClonesToAddCount);
                 }
                 if (GUI.Button(new Rect(GuiBase.Width(560f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "-"))
                 {
                     current.Upgrade.RemoveCloneCount(App.State.GameSettings.ClonesToAddCount);
                 }
                 marginTop += 10;
             }
         }
         marginTop += 35;
     }
 }