Ejemplo n.º 1
0
 public void Reset()
 {
     this.selectedBeing = null;
     this.showBaalPower = false;
     this.showInfo      = false;
     this.isFighting    = false;
     this.fightLog      = string.Empty;
     this.showV2        = false;
     this.Battle        = null;
 }
Ejemplo n.º 2
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!");
             }
         }
     }
 }