internal static Planet FromString(string base64String) { if (string.IsNullOrEmpty(base64String)) { return(new Planet()); } string[] parts = Conv.StringPartsFromBase64(base64String, "Planet"); Planet planet = new Planet(); planet.IsCreated = Conv.getStringFromParts(parts, "a").ToLower().Equals("true"); planet.PowerSurge = Conv.getCDoubleFromParts(parts, "b", false); planet.UBMultiplier = Conv.getCDoubleFromParts(parts, "c", false); planet.UpgradeLevel = Conv.getCDoubleFromParts(parts, "d", false); planet.ShadowCloneCount = Conv.getCDoubleFromParts(parts, "e", false); planet.UltimateBeings = new List <UltimateBeing>(); string stringFromParts = Conv.getStringFromParts(parts, "f"); string[] array = stringFromParts.Split(new char[] { '&' }); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; if (!string.IsNullOrEmpty(text)) { planet.UltimateBeings.Add(UltimateBeing.FromString(text)); } } if (planet.UltimateBeings.Count == 0) { planet.UltimateBeings = UltimateBeing.Initial; } planet.TotalGainedGodPower = Conv.getIntFromParts(parts, "g"); planet.BaalPower = Conv.getIntFromParts(parts, "h"); planet.PowerSurgeBoni = Conv.getIntFromParts(parts, "i"); planet.PowerSurgeMultiplier = Conv.getCDoubleFromParts(parts, "j", true); planet.UltimateBeingsV2 = new List <UltimateBeingV2>(); stringFromParts = Conv.getStringFromParts(parts, "k"); array = stringFromParts.Split(new char[] { '&' }); string[] array3 = array; for (int j = 0; j < array3.Length; j++) { string text2 = array3[j]; if (!string.IsNullOrEmpty(text2)) { planet.UltimateBeingsV2.Add(UltimateBeingV2.FromString(text2)); } } if (planet.UltimateBeingsV2.Count == 0) { planet.UltimateBeingsV2 = UltimateBeingV2.Initial; } planet.UpgradeLevelArtyChallenge = Conv.getCDoubleFromParts(parts, "l", false); return(planet); }
internal static UltimateBeingV2 FromString(string base64String) { if (string.IsNullOrEmpty(base64String)) { return(new UltimateBeingV2(1)); } string[] parts = Conv.StringPartsFromBase64(base64String, "UltimateBeingV2"); UltimateBeingV2 ultimateBeingV = new UltimateBeingV2(Conv.getIntFromParts(parts, "c")); ultimateBeingV.HPPercent = Conv.getCDoubleFromParts(parts, "a", false); ultimateBeingV.TimesDefeated = Conv.getIntFromParts(parts, "b"); ultimateBeingV.IsAvailable = Conv.getStringFromParts(parts, "d").ToLower().Equals("true"); ultimateBeingV.CreationCount = Conv.getCDoubleFromParts(parts, "e", false); ultimateBeingV.isCreating = Conv.getStringFromParts(parts, "f").ToLower().Equals("true"); ultimateBeingV.CurrentCreationDuration = Conv.getCDoubleFromParts(parts, "g", false); ultimateBeingV.IsDefeated = Conv.getStringFromParts(parts, "h").ToLower().Equals("true"); ultimateBeingV.StopAt = Conv.getIntFromParts(parts, "i"); ultimateBeingV.StopAtString = ultimateBeingV.StopAt.ToString(); return(ultimateBeingV); }
public void start(UltimateBeingV2 ub) { this.TurnCount = 1; this.Being = ub; this.Being.DamageReduction = 100; this.LastUsedSkills = new List <SkillUB2>(); this.PlayerHp = App.State.CurrentHealth; this.PlayerEnergy = 1000; this.IsFighting = true; this.DoubleUp = false; this.DamageBlock = false; this.DamageReflect = false; this.HitchanceBonus = 0; this.DodgeChance = 0; this.CounterChance = 0; this.MysticMode = null; this.TransformationAura = null; this.GodSpeedModeDuration = 0; this.Being.PowerUp = false; this.InfoText = string.Empty; this.PlayerSkills = new List <SkillUB2>(); this.PlayerSkills.Add(new SkillUB2 { Name = "Mystic Mode", Desc = "50% more attack and 25% damage reduction for 6 turns", TypeEnum = SkillTypeUBV2.MysticMode, EnergyCost = 30, BuffDuration = 6, Buff = 50 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Transformation aura", Desc = "100 % more attack and 50% damage reduction for 5 turns", TypeEnum = SkillTypeUBV2.TransformationAura, EnergyCost = 80, BuffDuration = 5, Buff = 100 }); this.PlayerSkills.Add(new SkillUB2 { Name = "God Speed", Desc = "Do 2 actions in one turn for the next 4 turns", TypeEnum = SkillTypeUBV2.GodSpeed, EnergyCost = 150, IncreaseActionsDuration = 8 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Elemental manipulation", Desc = "Doubles the damage of the next attack", TypeEnum = SkillTypeUBV2.ElementalManipulation, EnergyCost = 30, DoubleDamage = true }); this.PlayerSkills.Add(new SkillUB2 { Name = "Reflection barrier", Desc = "Reflect the next attack", TypeEnum = SkillTypeUBV2.ReflectionBarrier, EnergyCost = 200, ReflectDamage = true }); this.PlayerSkills.Add(new SkillUB2 { Name = "Clairvoyance", Desc = "65% chance to dodge and counter the next attack", TypeEnum = SkillTypeUBV2.Clairvoyance, EnergyCost = 100, DodgeCounterChance = 65 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Focused breathing", Desc = "Recover 15% of hp", TypeEnum = SkillTypeUBV2.FocusedBreathing, EnergyCost = -60, HealPerc = 15 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Aura Ball", Desc = "Attack with an aura ball", TypeEnum = SkillTypeUBV2.AuraBall, EnergyCost = 20, Damage = 2 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Big Bang", Desc = "Attack with big bang, twice as much damage as aura ball", TypeEnum = SkillTypeUBV2.BigBang, EnergyCost = 40, Damage = 4, HealPerc = -10 }); this.PlayerSkills.Add(new SkillUB2 { Name = "lonioi hero summon", Desc = "Damage depending on your highest god defeated", TypeEnum = SkillTypeUBV2.IonioiHeroSummon, EnergyCost = App.State.Statistic.HighestGodDefeated * 1.8, Damage = App.State.Statistic.HighestGodDefeated / 10 }); Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == ub.CreationNeeded); this.PlayerSkills.Add(new SkillUB2 { Name = "Give " + creation.Name, Desc = "Gives away one " + creation.Name, TypeEnum = SkillTypeUBV2.GiveBaseCreation, EnergyCost = -20 }); this.PlayerSkills.Add(new SkillUB2 { Name = "Give " + ub.CreationName, Desc = "Gives away one " + ub.CreationName, TypeEnum = SkillTypeUBV2.GiveModifiedCreation, EnergyCost = -20 }); foreach (SkillUB2 current in this.PlayerSkills) { if (current.EnergyCost > 0) { current.Desc = current.Desc + "\nEnergy cost: " + current.EnergyCost.ToGuiText(true); } else if (current.EnergyCost < 0) { current.Desc = current.Desc + "\nRecovers " + current.EnergyCost.ToGuiText(true) + " energy"; } if (current.HealPerc < 0) { current.Desc = current.Desc + "\nReduces your hp by " + (current.HealPerc * -1).ToGuiText(true) + " %"; } if (current.Damage > 0) { current.Desc = current.Desc + "\nBase Damage: " + current.Damage.ToGuiText(false); } } }
public void Fight(SkillUB2 skillUsed, bool playerSecondAttack) { string str = string.Empty; int num = 0; int num2 = 0; foreach (SkillUB2 current in this.LastUsedSkills) { if (current.TypeEnum == SkillTypeUBV2.GiveBaseCreation) { num++; } if (current.TypeEnum == SkillTypeUBV2.GiveModifiedCreation) { num2++; } } this.LastUsedSkills.Add(skillUsed); if (skillUsed.TypeEnum == SkillTypeUBV2.GiveBaseCreation) { Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == this.Being.CreationNeeded); if (creation.Count < 1) { this.LastUsedSkills.RemoveAt(this.LastUsedSkills.Count - 1); str = "You did not have any " + creation.Name + "!"; this.UBAttack(playerSecondAttack); } else { if ((this.LastUsedSkills.Count > 2 && this.LastUsedSkills[this.LastUsedSkills.Count - 2].TypeEnum == SkillTypeUBV2.GiveBaseCreation) || (this.LastUsedSkills.Count > 2 && this.LastUsedSkills[this.LastUsedSkills.Count - 2].TypeEnum == SkillTypeUBV2.GiveModifiedCreation)) { this.LastUsedSkills.RemoveAt(this.LastUsedSkills.Count - 1); str = this.Being.Name + " destroyed your " + creation.Name + "! He grew tired of it."; this.UBAttack(playerSecondAttack); } else { this.Being.DamageReduction += 3; if (this.Being.DamageReduction > 100) { this.Being.DamageReduction = 100; } str = this.Being.Name + " ate your " + creation.Name + ". His damage reduction was increased by 3%"; } Creation expr_20B = creation; expr_20B.Count = --expr_20B.Count; } } else if (skillUsed.TypeEnum == SkillTypeUBV2.GiveModifiedCreation) { if (this.Being.CreationCount < 1) { this.LastUsedSkills.RemoveAt(this.LastUsedSkills.Count - 1); str = "You did not have any " + this.Being.CreationName + "!"; this.UBAttack(playerSecondAttack); } else { if (num2 > num * 2) { this.LastUsedSkills.RemoveAt(this.LastUsedSkills.Count - 1); str = this.Being.Name + " destroyed your " + this.Being.CreationName + "! He was suspicious of it!"; this.UBAttack(playerSecondAttack); } else if ((this.LastUsedSkills.Count > 2 && this.LastUsedSkills[this.LastUsedSkills.Count - 2].TypeEnum == SkillTypeUBV2.GiveBaseCreation) || (this.LastUsedSkills.Count > 2 && this.LastUsedSkills[this.LastUsedSkills.Count - 2].TypeEnum == SkillTypeUBV2.GiveModifiedCreation)) { this.LastUsedSkills.RemoveAt(this.LastUsedSkills.Count - 1); str = this.Being.Name + " destroyed your " + this.Being.CreationName + "! He grew tired of it."; this.UBAttack(playerSecondAttack); } else { this.Being.DamageReduction -= 5; if (this.Being.DamageReduction < 0) { this.Being.DamageReduction = 0; } str = this.Being.Name + " ate your " + this.Being.CreationName + ". His damage reduction was reduced by 5%!"; } UltimateBeingV2 expr_402 = this.Being; expr_402.CreationCount = --expr_402.CreationCount; } } else if (skillUsed.TypeEnum == SkillTypeUBV2.AuraBall || skillUsed.TypeEnum == SkillTypeUBV2.IonioiHeroSummon || skillUsed.TypeEnum == SkillTypeUBV2.BigBang) { CDouble cDouble = skillUsed.Damage * (100 - this.Being.DamageReduction) / 100; if (this.DoubleUp) { cDouble *= 2; this.DoubleUp = false; } cDouble = cDouble * this.Damage / 100; cDouble = (double)UnityEngine.Random.Range((float)cDouble.ToInt() * 0.9f, (float)cDouble.ToInt() * 1.1f); cDouble /= 0.5 + (double)(this.Being.Tier / 2); this.Being.HPPercent -= cDouble; this.InfoText = this.InfoText + " and caused " + cDouble.ToGuiText(true) + " % damage."; this.UBAttack(playerSecondAttack); } else { this.UBAttack(playerSecondAttack); } this.InfoText = this.InfoText + "\n" + str; }