public void GetReward(bool won) { bool flag = won; CDouble cDouble = 33; foreach (Fight current in App.State.AllFights) { if (current.IsAvailable) { cDouble *= 2; } } if (App.State.Generator != null && App.State.Generator.IsBuilt) { cDouble += App.State.Generator.DivinitySec; } cDouble *= 2; if (this.currentBattleType == BattleState.BattleType.endless && this.DefeatedEnemyCount > 0) { int num = 0; for (int i = 0; i < this.DefeatedEnemyCount; i++) { num += i * 5; } cDouble *= num; if (this.DefeatedEnemyCount > App.State.Statistic.MostDefeatedShadowClones) { App.State.Statistic.MostDefeatedShadowClones = this.DefeatedEnemyCount; Leaderboards.SubmitStat(LeaderBoardType.MostClonesDefeated, App.State.Statistic.MostDefeatedShadowClones.ToInt(), false); } flag = true; } else if (this.currentBattleType == BattleState.BattleType.gods && this.DefeatedEnemyCount > 0) { cDouble = cDouble * this.DefeatedEnemyCount * 2; flag = true; } else if (this.currentBattleType == BattleState.BattleType.jacky) { cDouble *= 100; if (App.State.AllMights.First((Might x) => x.TypeEnum == Might.MightType.physical_attack).Level >= 100 && won) { Pet pet = App.State.Ext.AllPets.First((Pet x) => x.TypeEnum == PetType.Mole); if (!pet.IsUnlocked) { BattleState.JackyLeeDefeated = true; pet.Unlock(); GuiBase.ShowToast("Contratulations, you just unlocked " + pet.Name + "!"); } } } else if (this.currentBattleType == BattleState.BattleType.cthulhu) { cDouble *= 150; } else if (this.currentBattleType == BattleState.BattleType.doppel) { cDouble *= 250; } else if (this.currentBattleType == BattleState.BattleType.developer && this.DefeatedEnemyCount > 0) { if (this.DefeatedEnemyCount == 1) { cDouble *= 300; } else { cDouble *= 1000; App.State.Statistic.CreatorBeaten = true; } flag = true; } if (flag) { App.State.Money += cDouble; this.BattleRewardText = "You received " + cDouble.ToGuiText(true) + " Divinity!"; } else { this.BattleRewardText = "You lost and got nothing."; } this.ResetSkillCoolDowns(false); }
public static bool operator <=(CDouble leftSide, CDouble rightSide) { return(CDouble.Compare(leftSide, rightSide) <= 0); }
public CDouble GetCrystalsAfterUpgrade(GameState state, CDouble moduleLevel, CDouble countToUse) { int value = this.UpgradeChance(state, moduleLevel, false).ToInt(); return((countToUse * value / 100).Floor()); }
private void UBAttack(bool playerSecondAttack) { if (playerSecondAttack) { return; } int num = UnityEngine.Random.Range(0, 100); if (this.Being.DamageReduction < 75 && num > 80) { this.Being.DamageReduction += 10; this.InfoText = this.InfoText + "\n" + this.Being.Name + " concentrated his power. His damage reduction increased by 10%"; } else if (this.Being.HPPercent < 15 && num > 67) { this.Being.HPPercent += 10; this.InfoText = this.InfoText + "\n" + this.Being.Name + " healed himself for 10% of his hp."; } else if (num > 85 && !this.Being.PowerUp) { this.Being.PowerUp = true; this.InfoText = this.InfoText + "\n" + this.Being.Name + " concentrated his power."; } else { string text = this.Being.SkillName1; CDouble rightSide = 1; if (num > 50) { if (num > 80) { rightSide = 2.5; text = this.Being.SkillName3; } else { rightSide = 1.5; text = this.Being.SkillName2; } } if (this.Being.PowerUp) { rightSide = 2; this.Being.PowerUp = false; } CDouble cDouble = this.Being.BaseCloneDamage / 100 * (100 - this.DamageReduction) * rightSide; cDouble = (double)UnityEngine.Random.Range((float)cDouble.ToInt() * 0.9f, (float)cDouble.ToInt() * 1.1f); CDouble cDouble2 = this.Being.BaseDamage / 100 * (100 - this.DamageReduction) * rightSide; if (!this.DamageReflect) { if (num < this.DodgeChance) { CDouble cDouble3 = 5 * (100 - this.Being.DamageReduction) / 100; if (this.DoubleUp) { cDouble3 *= 2; this.DoubleUp = false; } this.DodgeChance = 0; this.CounterChance = 0; cDouble3 = cDouble3 * this.Damage / 100; cDouble3 = (double)UnityEngine.Random.Range((float)cDouble3.ToInt() * 0.9f, (float)cDouble3.ToInt() * 1.1f); this.Being.HPPercent -= cDouble3; this.InfoText = string.Concat(new string[] { this.InfoText, "\n", this.Being.Name, " used ", text, " and you dodged the attack! \nYou countered for ", cDouble3.ToGuiText(true) }); } else { if (cDouble > App.State.HomePlanet.ShadowCloneCount) { cDouble = App.State.HomePlanet.ShadowCloneCount; cDouble2 *= 2; } else { cDouble2 *= 0.5; } App.State.HomePlanet.ShadowCloneCount -= cDouble.ToInt(); App.State.Clones.RemoveUsedShadowClones(cDouble.ToInt()); App.State.Clones.Count -= cDouble.ToInt(); App.State.Clones.TotalClonesKilled += cDouble.ToInt(); App.State.Statistic.TotalShadowClonesDied += cDouble; this.PlayerHp -= App.State.MaxHealth * cDouble2 / 100; this.InfoText = string.Concat(new string[] { this.InfoText, "\n", this.Being.Name, " used ", text, " and killed ", cDouble.ToGuiText(true), " of your clones!\nYou also lost ", cDouble2.ToGuiText(true), " % of your hp." }); } } else { cDouble2 = cDouble2 * (100 - this.Being.DamageReduction) / 250; if (cDouble2 > 5) { cDouble2 = 5; } this.Being.HPPercent -= cDouble2; this.DamageReflect = false; this.InfoText = string.Concat(new string[] { this.InfoText, "\n", this.Being.Name, " used ", text, " but the damage is reflected back!\n", this.Being.Name, " took ", cDouble2.ToGuiText(true), " % damage." }); } } if (this.PlayerHp <= 0 || App.State.HomePlanet.ShadowCloneCount <= 0) { App.State.CurrentHealth = 0; GuiBase.ShowToast("You lost the fight!"); this.IsFighting = false; } if (this.Being.HPPercent <= 0) { this.Being.IsDefeated = true; this.Being.isCreating = false; this.Being.TimesDefeated++; CDouble multiplier = this.Being.GetMultiplier(App.State.HomePlanet.UBMultiplier); App.State.HomePlanet.UBMultiplier += multiplier; App.State.PremiumBoni.GodPower += this.Being.Tier * 10; App.State.HomePlanet.TotalGainedGodPower += this.Being.Tier * 10; GuiBase.ShowToast(string.Concat(new object[] { "You won the fight and earned ", this.Being.Tier * 10, " God Power!\nYour planet multiplier also increased by ", multiplier.ToGuiText(true) })); if (this.Being.Tier < 5) { App.State.HomePlanet.UltimateBeingsV2[this.Being.Tier].IsAvailable = true; } App.State.PremiumBoni.CheckGP = true; this.IsFighting = false; HeroImage.SetTitle(); } }
public string CalculateResult(GameState state) { StringBuilder stringBuilder = new StringBuilder(); CDouble cDouble = 0; Pet pet = null; foreach (Pet current in this.PetsInCampaign) { if (cDouble == 0 || current.GetTotalGrowth() < cDouble) { cDouble = current.GetTotalGrowth(); pet = current; } } CDouble cDouble2 = 0; CDouble cDouble3 = 0; int num = (this.TotalDuration / 3600000).ToInt(); CDouble cDouble4 = 0; CDouble cDouble5 = 0; CDouble cDouble6 = 0; CDouble cDouble7 = 0; CDouble cDouble8 = 0; CDouble cDouble9 = 0; CDouble cDouble10 = 0; CDouble cDouble11 = 0; stringBuilder.Append("Your pets "); for (int i = 0; i < this.PetsInCampaign.Count; i++) { stringBuilder.Append(this.PetsInCampaign[i]); if (i == this.PetsInCampaign.Count - 2) { stringBuilder.Append(" and "); } else if (i != this.PetsInCampaign.Count - 1) { stringBuilder.Append(", "); } } stringBuilder.Append(" finished their " + this.Type + " Campaign.\n\n"); int num2 = 0; CDouble cDouble12 = 100; foreach (Pet current2 in this.PetsInCampaign) { List <CampaignBoost> campaignBoost = current2.GetCampaignBoost(); foreach (CampaignBoost current3 in campaignBoost) { CDouble rightSide = current3.Value; if (current2.TypeEnum == PetType.Turtle && num == 1) { rightSide = -25; } else if (current2.TypeEnum == PetType.Turtle && num == 12) { rightSide = 25; } if (current3.Type == Campaigns.Level) { cDouble12 += rightSide; } } } foreach (Pet current4 in this.PetsInCampaign) { List <CampaignBoost> campaignBoost2 = current4.GetCampaignBoost(); CDouble leftSide = 100; CDouble leftSide2 = 100; CDouble cDouble13 = 100; CDouble cDouble14 = 100; CDouble cDouble15 = 100; CDouble leftSide3 = 100; foreach (CampaignBoost current5 in campaignBoost2) { CDouble rightSide2 = current5.Value; if (current4.TypeEnum == PetType.Turtle && num == 1) { rightSide2 = -25; } else if (current4.TypeEnum == PetType.Turtle && num == 12) { rightSide2 = 25; } if (current5.Type == Campaigns.Growth) { leftSide += rightSide2; } else if (current5.Type == Campaigns.Divinity) { leftSide2 += rightSide2; } else if (current5.Type == Campaigns.Food) { cDouble13 += rightSide2; } else if (current5.Type == Campaigns.Item) { cDouble14 += rightSide2; } else if (current5.Type == Campaigns.Multiplier) { cDouble15 += rightSide2; } else if (current5.Type == Campaigns.GodPower) { leftSide3 += rightSide2; } } int num3 = UnityEngine.Random.Range(1, 100); if (this.RandomChances.Count > num2) { num3 = this.RandomChances[num2]; } CDouble cDouble16 = 100; if (state.Statistic.UltimatePetChallengesFinished > 0) { cDouble16 = 100 + state.Statistic.UltimatePetChallengesFinished * 5; if (cDouble16 > 200) { cDouble16 = 200; } } switch (this.Type) { case Campaigns.Growth: if (current4 != pet) { CDouble campaignValue = current4.GetCampaignValue(this.Type, num, state); cDouble2 += campaignValue; stringBuilder.Append(string.Concat(new object[] { current4.Name, " increased the growth gain for ", pet, " by ", campaignValue.ToGuiText(false), ".\n" })); } break; case Campaigns.Divinity: { CDouble campaignValue2 = current4.GetCampaignValue(this.Type, num, state); cDouble3 += campaignValue2; stringBuilder.Append(current4.Name + " gained " + campaignValue2.GuiText + " divinity.\n"); break; } case Campaigns.Food: { CDouble cDouble17 = 0; CDouble cDouble18 = 0; CDouble cDouble19 = 0; int num4 = (num * 3 * cDouble13 / 100).ToInt(); num4 = (num4 * cDouble16 / 100).ToInt(); bool flag = num3 <= num4; if (flag) { cDouble19 = 1; } int j = (num * 10 * cDouble13 / 100).ToInt(); j = (j * cDouble16 / 100).ToInt(); while (j > 100) { j -= 100; cDouble18 += 1; } bool flag2 = num3 <= j; if (flag2) { cDouble18 += 1; } int k = (num * 20 * cDouble13 / 100).ToInt(); k = (k * cDouble16 / 100).ToInt(); while (k > 100) { k -= 100; cDouble17 += 1; } bool flag3 = num3 <= k; if (flag2) { cDouble17 += 1; } if (cDouble19 > 0) { cDouble6 += cDouble19; stringBuilder.Append(current4.Name + " found " + cDouble19.GuiText + " mighty food!\n"); } if (cDouble18 > 0) { cDouble5 += cDouble18; stringBuilder.Append(current4.Name + " found " + cDouble18.GuiText + " strong food.\n"); } if (cDouble17 > 0) { cDouble4 += cDouble17; stringBuilder.Append(current4.Name + " found " + cDouble17.GuiText + " puny food.\n"); } if (cDouble17 == 0) { stringBuilder.Append(current4.Name + " didn't find any food...\n"); } break; } case Campaigns.Item: { CDouble campaignValue3 = current4.GetCampaignValue(this.Type, num, state); cDouble8 += campaignValue3; stringBuilder.Append(string.Concat(new object[] { current4.Name, " found ", campaignValue3, " pet stones.\n" })); int num5 = (num * (campaignValue3 / 100) * cDouble14 / 100).ToInt(); bool flag4 = num3 <= num5; int num6 = num5 / 3; bool flag5 = num3 <= num6; bool flag6 = num3 <= num6 * 2; if (flag5) { cDouble9 = ++cDouble9; stringBuilder.Append(current4.Name + " found a lucky draw!\n"); } else if (flag6) { cDouble11 = ++cDouble11; stringBuilder.Append(current4.Name + " found a godly liquid!\n"); } else if (flag4) { cDouble10 = ++cDouble10; stringBuilder.Append(current4.Name + " found a chakra pill!\n"); } break; } case Campaigns.Level: { CDouble campaignValue4 = current4.GetCampaignValue(this.Type, num, state); CDouble cDouble20 = campaignValue4 * cDouble12 / 100; current4.Level += cDouble20; if (cDouble20 > campaignValue4) { stringBuilder.Append(string.Concat(new string[] { current4.Name, " gained ", campaignValue4.GuiText, " and an additional ", (cDouble20 - campaignValue4).GuiText, " levels!\n" })); } else { stringBuilder.Append(current4.Name + " gained " + campaignValue4.GuiText + " levels!\n"); } break; } case Campaigns.Multiplier: { CDouble cDouble21 = 1; if (current4.GetTotalGrowth() > 500) { cDouble21 += 1; } if (current4.GetTotalGrowth() > 1000) { cDouble21 += 1; } if (current4.GetTotalGrowth() > 2500) { cDouble21 += 1; } if (current4.GetTotalGrowth() > 5000) { cDouble21 += 1; } if (current4.GetTotalGrowth() > 10000) { cDouble21 += 1; } if (current4.GetTotalGrowth() > 25000) { cDouble21 += 1; } CDouble cDouble22 = 0.5; if (current4.GetTotalStats() > 10000) { cDouble22 += 0.5; } if (current4.GetTotalStats() > 100000) { cDouble22 += 0.5; } if (current4.GetTotalStats() > 1000000) { cDouble22 += 0.5; } if (current4.GetTotalStats() > 5000000) { cDouble22 += 0.5; } if (current4.GetTotalStats() > 10000000) { cDouble22 += 0.5; } if (current4.GetTotalStats() > 100000000) { cDouble22 += 0.5; } cDouble21 = cDouble21 * num * cDouble15 / 200; cDouble22 = cDouble22 * num * cDouble15 / 500; cDouble22 = cDouble22 * cDouble16 / 100; cDouble21 = cDouble21 * cDouble16 / 100; CDouble petMultiBattle = state.Multiplier.PetMultiBattle; CDouble petMultiMystic = state.Multiplier.PetMultiMystic; CDouble petMultiPhysical = state.Multiplier.PetMultiPhysical; state.Multiplier.PetCampainBoost += cDouble22; state.Multiplier.PetCampainBoostRebirth += cDouble21; state.Multiplier.UpdatePetMultis(state); CDouble cDouble23 = state.Multiplier.PetMultiPhysical - petMultiPhysical; CDouble cDouble24 = state.Multiplier.PetMultiMystic - petMultiMystic; CDouble cDouble25 = state.Multiplier.PetMultiBattle - petMultiBattle; stringBuilder.Append(string.Concat(new string[] { current4.Name, " increased all your pet multipliers by ", cDouble22.ToGuiText(false), " % and added ", cDouble21.GuiText, "% to all pet rebirth multipliers!\n" })); break; } case Campaigns.GodPower: { CDouble campaignValue5 = current4.GetCampaignValue(this.Type, num, state); bool flag7 = num3 <= campaignValue5; if (flag7) { cDouble7 = ++cDouble7; stringBuilder.Append(current4.Name + " found one god power!\n"); } else { stringBuilder.Append(current4.Name + " didn't find any god power...\n"); } break; } } num2++; } if (this.Type == Campaigns.Divinity) { stringBuilder.Append("You received a total of " + cDouble3.GuiText + "!"); state.Money += cDouble3; } else if (this.Type == Campaigns.GodPower) { if (cDouble7 == 0) { stringBuilder.Append("None of your pets found any god power...\n"); } else { if (cDouble7 > 10) { cDouble7 = 10; } state.PremiumBoni.GodPowerFromPets += cDouble7; state.PremiumBoni.GodPower += cDouble7.ToInt(); stringBuilder.Append("Your pets found a total of " + cDouble7.GuiText + " god power!\n"); } } else if (this.Type == Campaigns.Growth) { switch (this.SelectedGrowth) { case Growth.Physical: pet.PhysicalGrowth += cDouble2; stringBuilder.Append(string.Concat(new string[] { "The physical growth for ", pet.Name, " has increased by ", cDouble2.ToGuiText(false), "!" })); break; case Growth.Mystic: pet.MysticGrowth += cDouble2; stringBuilder.Append(string.Concat(new string[] { "The mystic growth for ", pet.Name, " has increased by ", cDouble2.ToGuiText(false), "!" })); break; case Growth.Battle: pet.BattleGrowth += cDouble2; stringBuilder.Append(string.Concat(new string[] { "The battle growth for ", pet.Name, " has increased by ", cDouble2.ToGuiText(false), "!" })); break; case Growth.All: { CDouble cDouble26 = cDouble2 / 3; if (cDouble26 < 0.25) { cDouble26 = 0.25; } cDouble26 = Conv.RoundToOneFourth(cDouble26.Double); pet.PhysicalGrowth += cDouble26; pet.MysticGrowth += cDouble26; pet.BattleGrowth += cDouble26; stringBuilder.Append(string.Concat(new string[] { "The growth of physical, mystic and battle for ", pet.Name, " has increased by ", cDouble26.ToGuiText(false), "!" })); break; } } pet.CalculateValues(); } else if (this.Type == Campaigns.Food) { if (cDouble6 > 0) { state.Ext.MightyFood += cDouble6; stringBuilder.Append("Your pets found a total of " + cDouble6.GuiText + " mighty food!\n"); } if (cDouble5 > 0) { state.Ext.StrongFood += cDouble5; stringBuilder.Append("Your pets found a total of " + cDouble5.GuiText + " strong food!\n"); } if (cDouble4 > 0) { state.Ext.PunyFood += cDouble4; stringBuilder.Append("Your pets found a total of " + cDouble4.GuiText + " puny food!\n"); } if (cDouble4 == 0) { stringBuilder.Append("None of your pets found any food...\n"); } } else if (this.Type == Campaigns.Item) { state.Ext.PetStones += cDouble8; if (state.Statistic.HasStartedUltimatePetChallenge) { CDouble cDouble27 = cDouble8 / 10; if (cDouble27 < 1) { cDouble27 = 1; } stringBuilder.Append(string.Concat(new string[] { "Your pets found a total of ", cDouble27.GuiText, " pet pills. Your pets ate them to increase their multi by ", cDouble27.GuiText, ".\n" })); if (state.Ext.PetPowerMultiCampaigns < 1) { state.Ext.PetPowerMultiCampaigns = 1; } state.Ext.PetPowerMultiCampaigns = state.Ext.PetPowerMultiCampaigns * cDouble27; } stringBuilder.Append("Your pets found a total of " + cDouble8.GuiText + " pet stones.\n"); if (cDouble9 > 0) { stringBuilder.Append("Your pets found a total of " + cDouble9.GuiText + " lucky draws!\n"); state.PremiumBoni.LuckyDraws += cDouble9; } if (cDouble11 > 0) { stringBuilder.Append("Your pets found a total of " + cDouble11.GuiText + " godly liquids!\n"); state.PremiumBoni.GodlyLiquidCount += cDouble11; } if (cDouble10 > 0) { stringBuilder.Append("Your pets found a total of " + cDouble10.GuiText + " chakra pills!\n"); state.PremiumBoni.ChakraPillCount += cDouble10; } } this.CampaingsFinished = ++this.CampaingsFinished; this.Cancel(); return(stringBuilder.ToString()); }
public PBaal() { this.Level = 1; this.AttackBase = new CDouble("99999999999999999999999999999999999999999999999999999999000"); this.currentHealth = this.MaxHealth; }
public void NextTurn(SkillUB2 skillUsed) { if (this.GodSpeedModeDuration > 0 && !this.TurnUsed) { this.TurnUsed = true; this.InfoText = this.InfoText + "\nYou used " + skillUsed.Name; } else { this.InfoText = "Turn " + this.TurnCount.ToGuiText(true) + "\nYou used " + skillUsed.Name; this.TurnUsed = false; this.TurnCount = ++this.TurnCount; } this.PlayerEnergy += 10; if (skillUsed.EnergyCost + 10 >= this.PlayerEnergy) { this.InfoText = string.Concat(new string[] { "Turn ", this.TurnCount.ToGuiText(true), "\nYou didin't have enough energy to use ", skillUsed.Name, " and wasted a turn." }); this.UBAttack(false); return; } this.PlayerEnergy -= skillUsed.EnergyCost; if (this.PlayerEnergy > 1000) { this.PlayerEnergy = 1000; } if (this.MysticMode != null) { this.MysticMode.Duration -= 1L; } if (this.TransformationAura != null) { this.TransformationAura.Duration -= 1L; } if (skillUsed.TypeEnum == SkillTypeUBV2.MysticMode) { this.MysticMode = new DamageChange(skillUsed.Buff.ToInt(), (long)skillUsed.BuffDuration.ToInt()); } if (skillUsed.TypeEnum == SkillTypeUBV2.TransformationAura) { this.TransformationAura = new DamageChange(skillUsed.Buff.ToInt(), (long)skillUsed.BuffDuration.ToInt()); } this.GodSpeedModeDuration = --this.GodSpeedModeDuration; if (this.GodSpeedModeDuration < 0) { this.GodSpeedModeDuration = 0; } if (skillUsed.IncreaseActionsDuration > 0) { this.GodSpeedModeDuration = skillUsed.IncreaseActionsDuration; } if (skillUsed.DoubleDamage) { this.DoubleUp = true; } if (skillUsed.ReflectDamage) { this.DamageReflect = true; } if (skillUsed.DodgeCounterChance > 0) { this.DodgeChance = skillUsed.DodgeCounterChance; this.CounterChance = skillUsed.DodgeCounterChance; } if (skillUsed.HealPerc != 0) { this.PlayerHp += App.State.MaxHealth * skillUsed.HealPerc / 100; if (this.PlayerHp > App.State.MaxHealth) { this.PlayerHp = App.State.MaxHealth; } } this.Fight(skillUsed, this.TurnUsed); }
internal string Fight(GameState gameState, int bpAtk, int bpDef, int powersurge, CDouble shadowCloneCount, bool crystalFactoryAttack = false) { gameState.HomePlanet.BaalPower -= bpAtk + bpDef; int num = gameState.ClonesPlanetMod + bpAtk * 50 + powersurge; int num2 = gameState.ClonesPlanetMod + bpDef * 50 + powersurge; StringBuilder stringBuilder = new StringBuilder(); int num3 = 1; int num4 = 0; if (crystalFactoryAttack) { this.crystalFightBuilder = new StringBuilder(); CultureInfo currentCulture = CultureInfo.CurrentCulture; this.crystalFightBuilder.Append(DateTime.Now.ToString(currentCulture) + "\n"); if (shadowCloneCount == 0) { this.crystalFightBuilder.Append(this.Name + " attacked your crystal factory and you lost the fight!"); } } while (gameState.CurrentHealth > 0 && shadowCloneCount > 0 && this.HPPercent > 0.0) { int num5 = 7000; if (this.Tier == 2) { num5 = 16000; } else if (this.Tier == 3) { num5 = 25000; } else if (this.Tier == 4) { num5 = 40000; } else if (this.Tier == 5) { num5 = 60000; } int num6 = this.skillOrder[(num3 - 1) % 10]; string value = this.SkillName1; if (num6 == 3) { num5 *= 4; value = this.SkillName3; } else if (num6 == 2) { num5 *= 2; value = this.SkillName2; } long num7 = (long)UnityEngine.Random.Range((int)((double)num5 * 0.9), (int)((double)num5 * 1.1)); if (crystalFactoryAttack && gameState.PremiumBoni.CrystalBonusDefender > 0) { num7 = (num7 * (100 - gameState.PremiumBoni.CrystalBonusDefender) / 100).ToLong(); } int num8 = (int)((double)(num7 / 4000L) - shadowCloneCount.Double / 40000.0); if (num8 < 0) { num8 = 0; } num7 = num7 * 100L / (long)num2; if (num7 >= shadowCloneCount) { num7 = (long)shadowCloneCount.ToInt(); num8 = 100; } if (crystalFactoryAttack) { gameState.Ext.Factory.DefenderClones -= num7; } else { gameState.CurrentHealth -= gameState.MaxHealth / 100 * num8; gameState.HomePlanet.ShadowCloneCount -= num7; } shadowCloneCount -= (int)num7; num4 += (int)num7; shadowCloneCount.Round(); gameState.Clones.RemoveUsedShadowClones((int)num7); gameState.Clones.Count -= (int)num7; gameState.Clones.TotalClonesKilled += (int)num7; gameState.Statistic.TotalShadowClonesDied += num7; stringBuilder.Append(num3).Append(". ").Append(this.Name).Append(" uses ").Append(value).Append(", kills ").Append(num7).Append(" Shadow Clones and deals ").Append(num8).Append(" % damage to your hp.\n"); if (gameState.CurrentHealth == 0 || shadowCloneCount <= 0) { stringBuilder.Append("You lost the fight!"); this.crystalFightBuilder.Append(this.Name + " attacked your crystal factory and your defender clones lost the fight!"); } else { double num9 = shadowCloneCount.Double / 20000.0 / (double)this.Tier + 1.0; if (shadowCloneCount <= 100000) { num9 *= 2.0; } else if (shadowCloneCount <= 150000) { num9 *= 1.8; } else if (shadowCloneCount <= 200000) { num9 *= 1.6; } else if (shadowCloneCount <= 250000) { num9 *= 1.4; } else if (shadowCloneCount <= 300000) { num9 *= 1.2; } num9 = num9 * (double)num / 100.0; string str = "Shadow Clones Power Charge"; if (num6 != 1) { num9 *= 1.5; str = "Ultimate Shadow Clone Blast"; } stringBuilder.Append("You used " + str + " and dealt ").Append((int)num9).Append(" % damage to ").Append(this.Name).Append("\n"); if (num9 > this.HPPercent) { num9 = this.HPPercent; } this.HPPercent -= num9; if (this.HPPercent <= 0.0) { Statistic expr_585 = gameState.Statistic; expr_585.UBsDefeated = ++expr_585.UBsDefeated; gameState.HomePlanet.UBMultiplier += this.NextMultiplier; this.TimesDefeated++; gameState.HomePlanet.RecalculateMultiplier(); CDouble cDouble = 100000; foreach (Fight current in gameState.AllFights) { if (current.IsAvailable) { cDouble *= 2; } } if (gameState.Generator != null && gameState.Generator.IsBuilt) { cDouble += gameState.Generator.DivinitySec * 3600; } cDouble = cDouble * this.Tier / 2; gameState.Money += cDouble; this.crystalFightBuilder.Append(string.Concat(new object[] { this.Name, " attacked your defender clones and you won the fight!\nYou lost a total of ", num4, " clones and gained " })).Append(cDouble.ToGuiText(true)).Append(" Divinity, your Planet Stat Multiplier increased by ").Append(this.NextMultiplier.ToGuiText(true)).Append(" %"); stringBuilder.Append("You won the fight!\nYou gained ").Append(cDouble.ToGuiText(true)).Append(" Divinity, your Planet Stat Multiplier increased by ").Append(this.NextMultiplier.ToGuiText(true)).Append(" %"); bool flag = false; if (this.TimesDefeated % 5 == 0 && this.Tier == 1) { flag = true; } else if ((this.TimesDefeated % 5 == 0 && this.Tier == 2) || (this.TimesDefeated % 5 == 3 && this.Tier == 2)) { flag = true; } else if (this.TimesDefeated % 5 != 0 && this.Tier == 3 && this.TimesDefeated % 5 != 3 && this.Tier == 3) { flag = true; } else if (this.TimesDefeated % 5 != 3 && this.Tier == 4) { flag = true; } else if (this.Tier == 5) { flag = true; } Log.Info(string.Concat(new object[] { "times defeated: ", this.TimesDefeated, ", drop GP = ", flag })); if (flag) { gameState.PremiumBoni.GodPower++; gameState.HomePlanet.TotalGainedGodPower++; gameState.PremiumBoni.CheckIfGPIsAdjusted(); stringBuilder.Append(" and got 1 God Power!"); this.crystalFightBuilder.Append("\nYou received 1 God Power."); } if (gameState.IsCrystalFactoryAvailable) { CDouble cDouble2 = this.Tier * 100; gameState.Ext.Factory.Energy += cDouble2; stringBuilder.Append("\nYour crystal factory received " + cDouble2.GuiText + " energy!"); this.crystalFightBuilder.Append("\nYour crystal factory received " + cDouble2.GuiText + " energy!"); } gameState.HomePlanet.InitUBMultipliers(); } } num3++; } if (!crystalFactoryAttack) { return(stringBuilder.ToString()); } return(this.crystalFightBuilder.ToString()); }
public void SetNextMultiplier(CDouble currentMultiplier) { CDouble leftSide = currentMultiplier + 100; this.NextMultiplier = leftSide * this.PowerBoni / 100; }
public void UpdateDuration(long ms) { if (App.State == null) { return; } if (this.CreationDuration == 0) { this.InitDuration(App.State); } if (this.isCreating) { if (App.State.CreatingPowerBase <= 0) { GuiBase.ShowToast("You need more creating power to create a " + this.CreationName); this.isCreating = false; this.GoBackToCreating(); return; } if (this.CurrentCreationDuration <= 0) { Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == this.CreationNeeded); if (creation.count == 0) { this.isCreating = false; GuiBase.ShowToast("You need one " + creation.Name + " to create a " + this.CreationName); this.GoBackToCreating(); return; } Creation expr_EB = creation; expr_EB.count = --expr_EB.count; } CDouble rightSide = App.State.CreationSpeed(ms); this.CurrentCreationDuration += rightSide; CDouble cDouble = (this.CreationDuration - this.CurrentCreationDuration) * 30 / rightSide; string text = "Time to finish: " + Conv.MsToGuiText(cDouble.ToLong(), true); CDouble cDouble2 = this.CreationLoss / this.CreationDuration * rightSide; App.State.CreatingPowerBase -= cDouble2; if (App.State.CreatingPowerBase < 0) { App.State.CreatingPowerBase = 0; } CDouble cDouble3 = cDouble2 * App.State.Multiplier.CurrentMultiCreating * (100 + App.State.PremiumBoni.GpBoniCreating); cDouble3 = App.State.AdditionalMultis(cDouble3); if (this.CreationDuration > 0 && this.CurrentCreationDuration > this.CreationDuration) { this.CurrentCreationDuration = 0; this.CreationCount = ++this.CreationCount; if (this.CreationCount >= this.StopAt && this.StopAt != 0) { this.isCreating = false; this.GoBackToCreating(); } } this.CreationDescription = string.Concat(new string[] { this.CreationDescriptionBase, "\nYou will lose ", cDouble3.ToGuiText(true), " Creating every second while creating this.\n", text }); } if (this.HPPercent < 100) { this.HPPercent += 1.67E-05 * (double)ms; } }
public CDouble GetMultiplier(CDouble currentMultiplier) { return(currentMultiplier * this.Tier); }
public void UpdateDuration(long ms) { if (App.State == null) { return; } if (!this.GodToDefeat.IsDefeated) { this.GodToDefeat.RecoverHealth(ms); } if (!this.IsActive) { return; } if (!this.GodToDefeat.IsDefeated) { this.FightGod(ms); if (this.GodToDefeat.IsDefeated) { this.description = string.Empty; } return; } bool flag = this.NextAtCount != 0 && this.NextAtCount <= this.Count; if (App.State.GameSettings.CreationsNextAtMode == 2) { flag = (this.NextAtCount != 0 && this.NextAtCount <= this.TotalCreated); } if ((App.State.GameSettings.LastCreation != null && App.State.GameSettings.LastCreation.TypeEnum != this.TypeEnum) || App.State.GameSettings.CreationsNextAtMode == 0) { flag = false; } if (flag && this.TypeEnum != Creation.CreationType.Shadow_clone) { foreach (Creation current in App.State.AllCreations) { current.IsActive = false; } Creation lastCreation = this; Creation creation = App.State.AllCreations.First((Creation x) => x.TypeEnum == Creation.CreationType.Shadow_clone); if (this.TypeEnum == Creation.CreationType.Universe) { lastCreation = creation; creation.IsActive = true; } else { Creation creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == this.TypeEnum + 1); if (creation2 != null && creation2.GodToDefeat.IsDefeated) { lastCreation = creation2; creation2.IsActive = true; } else { bool flag2 = false; foreach (Creation current2 in App.State.AllCreations) { if (current2.GodToDefeat.IsDefeated && current2.NextAtCount == 0 && current2.TypeEnum != Creation.CreationType.Shadow_clone) { lastCreation = current2; current2.IsActive = true; flag2 = true; break; } } if (!flag2) { lastCreation = creation; creation.IsActive = true; } } } App.State.GameSettings.LastCreation = lastCreation; return; } if (App.State.GameSettings.CreateShadowClonesIfNotMax && App.State.Clones.Count < App.State.Clones.MaxShadowClones && this.TypeEnum != Creation.CreationType.Shadow_clone) { this.oldActiveCreation = this; Creation creation3 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Shadow_clone); creation3.IsActive = true; return; } if (this.oldActiveCreation != null) { this.IsActive = false; this.oldActiveCreation.IsActive = true; this.oldActiveCreation = null; } int num = this.CheckCountNeeded(); List <CreationCost> list = CreationCost.RequiredCreations(this.TypeEnum, (long)num, false); if (this.CheckPrerequesiteCost(list)) { return; } this.currentDuration += App.State.CreationSpeed(ms); long durationInMS = this.DurationInMS; if (this.currentDuration > durationInMS) { this.currentDuration -= durationInMS; if (this.currentDuration > durationInMS) { this.currentDuration = durationInMS; } using (List <CreationCost> .Enumerator enumerator3 = list.GetEnumerator()) { while (enumerator3.MoveNext()) { CreationCost cost = enumerator3.Current; Creation creation4 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); creation4.Count -= cost.CountNeeded; } } CDouble rightSide = this.CreatingPowerGain() * (100 + (num - 1) * 5) / 100; App.State.CreatingPowerBase += rightSide; this.CanBuy = true; this.Count += num; this.TotalCreated += num; App.State.CheckForAchievement(this); if (this.TypeEnum != Creation.CreationType.Shadow_clone) { App.State.Statistic.TotalCreations += num; } this.FinishUUC(App.State); if (App.State.GameSettings.LastCreation != null && App.State.GameSettings.LastCreation.TypeEnum != this.TypeEnum) { Creation creation5 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == App.State.GameSettings.LastCreation.TypeEnum); this.IsActive = false; creation5.IsActive = true; } } }
public CDouble ApplyTimeMulti(CDouble baseMulti) { long num = this.TimePlayedSinceRebirth / 1000L; if (num == 0L) { return(1); } if (num < 3600L) { baseMulti = baseMulti * num / 7200; if (num < 1800L) { baseMulti /= 2; } if (num < 900L) { baseMulti /= 2; } if (num < 720L) { baseMulti /= 2; } if (num < 600L) { baseMulti /= 2; } if (num < 480L) { baseMulti /= 2; } if (num < 360L) { baseMulti /= 2; } if (num < 300L) { baseMulti /= 3; } if (num < 240L) { baseMulti /= 3; } if (num < 180L) { baseMulti /= 3; } if (num < 120L) { baseMulti /= 3; } if (this.AvgTimeLastRebirths() < 900) { if (this.RandomDividerLastRebirth < 1) { this.RandomDividerLastRebirth = 1; } baseMulti /= this.RandomDividerLastRebirth; } if (baseMulti < 1) { baseMulti = 1; } return(baseMulti); } long value = (num - 3600L) / 1800L + 101L; baseMulti = baseMulti * value / 100; if (baseMulti < 1) { baseMulti = 1; } return(baseMulti); }
public void UpdateData(long timeDifference) { if (!this.IsFighting) { return; } this.totalFightTime += timeDifference; if (this.GearEyesDuration <= 0L) { this.enemyAttackTimer += timeDifference; } this.totalFightTimeMilliSeconds += timeDifference; if (this.enemyAttackTimer >= this.enemyAttackTime) { this.enemyAttackTimer = 0L; CDouble cDouble = this.randomize(this.CurrentEnemy.GetDamage(this.PlayerHp) * this.DamageDecrease / 100); bool flag = false; if (this.DodgeChance > 0) { int num = UnityEngine.Random.Range(0, 100); if (num < this.DodgeChance) { flag = true; } this.DodgeChance = 0; } bool flag2 = false; if (this.CounterChance > 0) { int num2 = UnityEngine.Random.Range(0, 100); if (num2 < this.CounterChance) { flag2 = true; } this.CounterChance = 0; } if (this.currentBattleType == BattleState.BattleType.endless && this.DefeatedEnemyCount > 0) { this.CurrentEnemy.AttackName = this.CurrentEnemy.AttackName.Replace("attacks", "attack"); this.CurrentEnemy.AttackName = this.CurrentEnemy.AttackName.Replace("uses", "use"); } if (flag) { if (this.currentBattleType == BattleState.BattleType.endless && this.DefeatedEnemyCount > 0) { this.EnemyDamageText = this.CurrentEnemy.Name + this.CurrentEnemy.AttackName + "and they miss!"; } else { this.EnemyDamageText = this.CurrentEnemy.Name + this.CurrentEnemy.AttackName + "and misses!"; } } else if (this.DamageBlock) { this.DamageBlock = false; this.EnemyDamageText = this.CurrentEnemy.Name + this.CurrentEnemy.AttackName + "but the damage is nullfied!"; } else if (this.DamageReflect) { this.DamageReflect = false; this.CurrentEnemy.DoDamage(cDouble); this.EnemyDamageText = string.Concat(new string[] { this.CurrentEnemy.Name, this.CurrentEnemy.AttackName, "for ", cDouble.ToGuiText(true), " damage but the damage is reflected back!" }); } else { this.PlayerHp -= cDouble; this.EnemyDamageText = string.Concat(new string[] { this.CurrentEnemy.Name, this.CurrentEnemy.AttackName, "for ", cDouble.ToGuiText(true), " damage." }); if (flag2) { CDouble cDouble2 = this.randomize(this.DamageIncrease * App.State.Attack / 100); this.CurrentEnemy.DoDamage(cDouble2); this.EnemyDamageText = this.EnemyDamageText + " You counter for " + cDouble2.ToGuiText(true) + " back!"; } } if (this.PlayerHp <= 0) { GuiBase.ShowToast("You lose!"); this.IsFighting = false; this.IsBattleFinished = true; this.GetReward(false); } this.EnemyDamageText = this.FightTimeString + this.EnemyDamageText; this.FightingLog.Add(this.EnemyDamageText); this.CurrentEnemy.IncreaseDamage(); this.last3EnemyAttacks[this.currentIntexOfEnemyAttacks] = cDouble; this.currentIntexOfEnemyAttacks++; this.currentIntexOfEnemyAttacks %= 3; } foreach (Skill current in App.State.AllSkills) { current.Extension.CoolDownCurrent -= timeDifference; if (current.Extension.CoolDownCurrent < 0L) { current.Extension.CoolDownCurrent = 0L; } } List <DamageChange> list = new List <DamageChange>(); foreach (DamageChange current2 in this.DamageIncreases) { current2.Duration -= timeDifference; if (current2.Duration > 0L) { list.Add(current2); } } this.DamageIncreases = list; List <DamageChange> list2 = new List <DamageChange>(); foreach (DamageChange current3 in this.DamageDecreases) { current3.Duration -= timeDifference; if (current3.Duration > 0L) { list2.Add(current3); } } this.DamageDecreases = list2; this.GodSpeedModeDuration -= timeDifference; if (this.GodSpeedModeDuration <= 0L) { this.GodSpeedModeDuration = 0L; } this.GearEyesDuration -= timeDifference; if (this.GearEyesDuration <= 0L) { this.GearEyesDuration = 0L; } }
public ShadowClone() { this.maxShadowClones = 1000; }
public CDouble LevelUp(CDouble exp, int levels, bool max = false) { if (this.ExpCostNextLevel == 0 || this.ExpCostNext10Levels == 0 || this.ExpCostNext100Levels == 0 || this.ExpCostNext1000Levels == 0) { this.InitExpCost(); } CDouble cDouble = 0; if (max) { CDouble cDouble2 = exp; while (cDouble2 > this.ExpCostNext1000Levels) { this.Level += 1000; cDouble += this.ExpCostNext1000Levels; cDouble2 -= this.ExpCostNext1000Levels; if (this.ExpModi == 0) { this.InitExpCost(); } } int num = 0; while (true) { CDouble rightSide = this.ExpCost(this.Level + num); if (cDouble + rightSide > cDouble2) { break; } cDouble += rightSide; num++; } this.Level += num; this.InitExpCost(); return(cDouble); } if (levels == 1 && exp >= this.ExpCostNextLevel) { this.Level = ++this.Level; cDouble = this.ExpCostNextLevel; } else if (levels == 10 && exp >= this.ExpCostNext10Levels) { this.Level += levels; cDouble = this.ExpCostNext10Levels; } else if (levels == 100 && exp >= this.ExpCostNext100Levels) { this.Level += levels; cDouble = this.ExpCostNext100Levels; } else if (levels == 1000 && exp >= this.ExpCostNext1000Levels) { this.Level += levels; cDouble = this.ExpCostNext1000Levels; } else if (levels == 10000 && exp >= this.ExpCostNext10000Levels) { this.Level += levels; cDouble = this.ExpCostNext10000Levels; } this.InitExpCost(); return(cDouble); }
public CreationCost(CDouble count, Creation.CreationType type) { this.CountNeeded = count; this.TypeEnum = type; }
public List <CreationCost> RequiredCreations(CDouble level) { CDouble rightSide = 1; if (level > 0) { rightSide = level * 5; } List <CreationCost> list = new List <CreationCost>(); switch (this.TypeEnum) { case Monument.MonumentType.mighty_statue: list.Add(new CreationCost(2000 * rightSide, Creation.CreationType.Stone)); break; case Monument.MonumentType.mystic_garden: list.Add(new CreationCost(250 * rightSide, Creation.CreationType.Water)); list.Add(new CreationCost(100 * rightSide, Creation.CreationType.Plant)); break; case Monument.MonumentType.tomb_of_god: list.Add(new CreationCost(1000 * rightSide, Creation.CreationType.Stone)); list.Add(new CreationCost(1 * rightSide, Creation.CreationType.Human)); break; case Monument.MonumentType.everlasting_lighthouse: list.Add(new CreationCost(250000 * rightSide, Creation.CreationType.Light)); list.Add(new CreationCost(50000 * rightSide, Creation.CreationType.Stone)); break; case Monument.MonumentType.godly_statue: list.Add(new CreationCost(1 * rightSide, Creation.CreationType.Mountain)); list.Add(new CreationCost(100000 * rightSide, Creation.CreationType.Stone)); list.Add(new CreationCost(25000 * rightSide, Creation.CreationType.Water)); break; case Monument.MonumentType.pyramids_of_power: list.Add(new CreationCost(50000 * rightSide, Creation.CreationType.Water)); list.Add(new CreationCost(500000 * rightSide, Creation.CreationType.Stone)); list.Add(new CreationCost(200000 * rightSide, Creation.CreationType.Light)); break; case Monument.MonumentType.temple_of_god: list.Add(new CreationCost(1000000 * rightSide, Creation.CreationType.Stone)); list.Add(new CreationCost(100000 * rightSide, Creation.CreationType.Light)); list.Add(new CreationCost(2000 * rightSide, Creation.CreationType.Plant)); list.Add(new CreationCost(1000 * rightSide, Creation.CreationType.Tree)); list.Add(new CreationCost(60000 * rightSide, Creation.CreationType.Water)); list.Add(new CreationCost(1000 * rightSide, Creation.CreationType.Fish)); break; case Monument.MonumentType.black_hole: { CDouble cDouble = 25 * rightSide; if (App.State != null && App.State.Statistic.BlackHoleChallengesFinished > 0) { CDouble cDouble2 = App.State.Statistic.BlackHoleChallengesFinished * 2; if (cDouble2 > 80) { cDouble2 = 80; } cDouble = cDouble * (100 - cDouble2) / 100; } cDouble.Round(); list.Add(new CreationCost(cDouble, Creation.CreationType.Galaxy)); break; } } return(list); }
internal static void Rebirth() { Monument monument3 = App.State.AllMonuments.FirstOrDefault((Monument x) => x.TypeEnum == Monument.MonumentType.black_hole); if (monument3 != null && monument3.Upgrade.Level > 0) { int num = monument3.Upgrade.Level.ToInt(); if (num > 50) { num = 50; } App.State.PremiumBoni.GodPower += num; App.State.Statistic.GPFromBlackHoleUpgrade += num; GuiBase.ShowBigMessage("You received " + num + " God Power from your black hole upgrades!"); } if (App.State.Statistic.HasStartedNoRbChallenge) { GuiBase.ShowToast("Because of your rebirth, you lost your No Rebirth Challenge!"); App.State.Statistic.HasStartedNoRbChallenge = false; } App.State.Statistic.Last5RebirthTimes.Add(App.State.Statistic.TimePlayedSinceRebirth); if (App.State.Statistic.Last5RebirthTimes.Count > 5) { App.State.Statistic.Last5RebirthTimes.RemoveAt(0); } bool shouldSubmitScore = App.State.ShouldSubmitScore; CDouble cDouble = App.State.Statistic.ApplyTimeMulti(App.State.Multiplier.RebirthMulti * App.State.Statistic.StatisticRebirthMultiplier); if (App.State.Statistic.AvgTimeLastRebirths() < 900 || App.State.Statistic.RandomDividerLastRebirth < 1) { App.State.Statistic.CalcuRandomDivider(); } else { App.State.Statistic.RandomDividerLastRebirth = 1; } bool flag = false; foreach (Creation current in App.State.AllCreations) { if (current.GodToDefeat.IsDefeated) { App.State.Statistic.GodDefeatedBeforeRebirth = current.GodToDefeat.Name; if (current.TypeEnum == Creation.CreationType.Universe) { flag = true; } } } if (flag) { App.State.Statistic.GodDefeatedBeforeRebirth = "P. Baal v " + (App.State.PrinnyBaal.Level - 1); } string base64String = App.State.Statistic.Serialize(); CDouble cDouble2 = App.State.Ext.AfkGame.ExpMulti; CDouble cDouble3 = App.State.Ext.AfkGame.Power.Level / 10000000; if (cDouble3 > 1) { cDouble3 = 1; } cDouble2 += cDouble3; CDouble achievementMultiPhysical = App.State.Multiplier.MultiBoniPhysicalRebirth * cDouble; CDouble achievementMultiMystic = App.State.Multiplier.MultiBoniMysticRebirth * cDouble; CDouble achievementMultiBattle = App.State.Multiplier.MultiBoniBattleRebirth * cDouble; CDouble achievementMultiCreating = App.State.Multiplier.MultiBoniCreatingRebirth * cDouble; int maxShadowClonesRebirth = App.State.Clones.MaxShadowClonesRebirth; int absoluteMaximum = App.State.Clones.AbsoluteMaximum; Premium premiumBoni = App.State.PremiumBoni; AvatarOptions avatar = App.State.Avatar; List <Monument> allMonuments = App.State.AllMonuments; List <GeneratorUpgrade> upgrades = App.State.Generator.Upgrades; PlayerKredProblems kredProblems = App.State.KredProblems; Planet homePlanet = App.State.HomePlanet; long creatingSpeedBoniDuration = App.State.CreatingSpeedBoniDuration; string avatarName = App.State.AvatarName; List <float> randomValues = App.State.Ext.RandomValues; int currentRandomNumber = App.State.Ext.CurrentRandomNumber; Critical crits = App.State.Crits; crits.Eyes = crits.Eyes * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; crits.Feet = crits.Feet * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; crits.Mouth = crits.Mouth * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; crits.Tail = crits.Tail * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; crits.Wings = crits.Wings * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; crits.EyesNoMirror = crits.EyesNoMirror * App.State.PremiumBoni.TbsProgressAfterRebirth / 100; List <Creation> allCreations = App.State.AllCreations; Settings gameSettings = App.State.GameSettings; string kongUserId = App.State.KongUserId; string kongUserName = App.State.KongUserName; string steamId = App.State.SteamId; string steamName = App.State.SteamName; string androidId = App.State.AndroidId; string androidName = App.State.AndroidName; bool isSocialDialogShown = App.State.IsSocialDialogShown; List <Skill> allSkills = App.State.AllSkills; List <Pet> allPets = App.State.Ext.AllPets; foreach (Pet current2 in allPets) { current2.FeedTimer = 43200000L; current2.Exp = 0; current2.Level = 1; current2.ShadowCloneCount = 0; current2.CloneBattle = 1; current2.CloneMystic = 1; current2.ClonePhysical = 1; current2.CalculateValues(); } State2 ext = App.State.Ext; List <Might> allMights = App.State.AllMights; long timeStampGameClosed = App.State.TimeStampGameClosed; long timeStampGameClosedOfflineMS = App.State.TimeStampGameClosedOfflineMS; CDouble cDouble4 = 0; foreach (Crystal current3 in App.State.Ext.Factory.EquippedCrystals) { CDouble cDouble5 = current3.Level; if (current3.Type == ModuleType.Ultimate) { cDouble5 *= 2; } if (current3.Type == ModuleType.God) { cDouble5 *= 3; } cDouble4 += cDouble5; } App.State = new GameState(true, App.State.Statistic.AchievementChallengesFinished.ToInt()); App.State.GameSettings.AutofillDefenders = false; App.State.TimeStampGameClosed = timeStampGameClosed; App.State.TimeStampGameClosedOfflineMS = timeStampGameClosedOfflineMS; App.State.Ext.AfkGame.InitExpCost(); App.State.Ext.SteamCurrency = ext.SteamCurrency; App.State.Ext.SteamCountry = ext.SteamCountry; App.State.Ext.TimeSinceSteam = ext.TimeSinceSteam; App.State.Ext.AdPoints = ext.AdPoints; App.State.Ext.AdsWatched = ext.AdsWatched; App.State.Ext.TotalAdsWatched = ext.TotalAdsWatched; App.State.Ext.ImportedSaveFromKongToSteam = ext.ImportedSaveFromKongToSteam; App.State.Ext.KongConvertId = ext.KongConvertId; App.State.Ext.TwitterClicked = ext.TwitterClicked; App.State.Ext.FacebookClicked = ext.FacebookClicked; App.State.Ext.PetIdInAvatar = ext.PetIdInAvatar; App.State.Ext.Lucky = ext.Lucky; App.State.Ext.RateDialogShown = ext.RateDialogShown; App.State.Ext.PetStonesSpent = ext.PetStonesSpent; App.State.Ext.AfkGame.ExpMulti = cDouble2; App.State.KongUserId = kongUserId; App.State.KongUserName = kongUserName; App.State.SteamId = steamId; App.State.SteamName = steamName; App.State.AndroidId = androidId; App.State.AndroidName = androidName; App.State.IsTutorialShown = true; App.State.IsGuestMsgShown = true; App.State.IsSocialDialogShown = isSocialDialogShown; App.State.Multiplier.AchievementMultiPhysical = achievementMultiPhysical; App.State.Multiplier.AchievementMultiMystic = achievementMultiMystic; App.State.Multiplier.AchievementMultiBattle = achievementMultiBattle; App.State.Multiplier.AchievementMultiCreating = achievementMultiCreating; App.State.Clones.MaxShadowClones = maxShadowClonesRebirth; App.State.Clones.AbsoluteMaximum = absoluteMaximum; App.State.Multiplier.GodMultiFromRebirth = cDouble; App.State.Statistic = Statistic.FromString(base64String); Statistic expr_981 = App.State.Statistic; expr_981.TotalRebirths = ++expr_981.TotalRebirths; App.State.Statistic.TimePlayedSinceRebirth = 0L; App.State.Statistic.BlackHoleGPTimer = 0; App.State.Ext.AfkGame.Exp = App.State.Statistic.TotalRebirths * 30 * App.State.Ext.AfkGame.ExpMulti; App.State.AddMultisFromGod(); App.State.KredProblems = kredProblems; App.State.Crits = crits; App.State.CreatingSpeedBoniDuration = creatingSpeedBoniDuration; int num2 = App.State.Statistic.TotalShadowClonesCreated.ToInt() / 1000; if (num2 > 950) { num2 = 950; } App.State.CloneAttackDivider = 1000 - num2; int num3 = App.State.Statistic.TotalShadowClonesDied.ToInt() / 500; if (num3 > 950) { num3 = 950; } App.State.CloneDefenseDivider = 1000 - num3; App.State.CloneHealthDivider = 1000 - num3; App.State.InitAchievementNames(); App.State.PremiumBoni = premiumBoni; App.State.PremiumBoni.ChakraPillV2InUse = false; App.State.PremiumBoni.GodlyLiquidV2InUse = false; App.State.PremiumBoni.TotalMightIsUnlocked = false; App.State.PremiumBoni.CrystalGPTimeCurrent = 0; App.State.PremiumBoni.CrystalPower += cDouble4; App.State.ShouldSubmitScore = shouldSubmitScore; App.State.GameSettings = gameSettings; App.State.GameSettings.AutoBuyCreations = false; App.State.Avatar = avatar; App.State.Ext.RandomValues = randomValues; App.State.Ext.CurrentRandomNumber = currentRandomNumber; using (List <Creation> .Enumerator enumerator4 = App.State.AllCreations.GetEnumerator()) { while (enumerator4.MoveNext()) { Creation creation = enumerator4.Current; Creation creation3 = allCreations.FirstOrDefault((Creation x) => x.TypeEnum == creation.TypeEnum); if (creation3 != null) { creation.GodToDefeat.IsDefeatedForFirstTime = creation3.GodToDefeat.IsDefeatedForFirstTime; creation.GodToDefeat.IsDefeatedPetChallenge = creation3.GodToDefeat.IsDefeatedPetChallenge; creation.NextAtCount = creation3.NextAtCount; creation.AutoBuy = creation3.AutoBuy; } } } using (List <Skill> .Enumerator enumerator5 = App.State.AllSkills.GetEnumerator()) { while (enumerator5.MoveNext()) { Skill element = enumerator5.Current; Skill skill = allSkills.FirstOrDefault((Skill x) => x.EnumValue == element.EnumValue); if (skill != null) { element.Extension.KeyPress = skill.Extension.KeyPress; element.Extension.UsageCount = skill.Extension.UsageCount; } } } using (List <Monument> .Enumerator enumerator6 = App.State.AllMonuments.GetEnumerator()) { while (enumerator6.MoveNext()) { Monument monument = enumerator6.Current; Monument monument2 = allMonuments.FirstOrDefault((Monument x) => x.TypeEnum == monument.TypeEnum); if (monument2 != null) { monument.StopAtString = monument2.StopAtString; monument.Upgrade.StopAtString = monument2.Upgrade.StopAtString; } } } using (List <GeneratorUpgrade> .Enumerator enumerator7 = App.State.Generator.Upgrades.GetEnumerator()) { while (enumerator7.MoveNext()) { GeneratorUpgrade divGenUpgrade = enumerator7.Current; GeneratorUpgrade generatorUpgrade = upgrades.FirstOrDefault((GeneratorUpgrade x) => x.type == divGenUpgrade.type); if (generatorUpgrade != null) { divGenUpgrade.StopAt = generatorUpgrade.StopAt; } } } using (List <Might> .Enumerator enumerator8 = App.State.AllMights.GetEnumerator()) { while (enumerator8.MoveNext()) { Might might = enumerator8.Current; Might might2 = allMights.FirstOrDefault((Might x) => x.TypeEnum == might.TypeEnum); if (might2 != null) { might.NextAt = might2.NextAt; } } } App.State.Ext.PetPowerMultiCampaigns = ext.PetPowerMultiCampaigns; App.State.Ext.PetPowerMultiGods = ext.PetPowerMultiGods; App.State.Ext.PetStones = ext.PetStones; App.State.Ext.AllCampaigns = ext.AllCampaigns; foreach (PetCampaign current4 in App.State.Ext.AllCampaigns) { current4.Cancel(); } App.State.AvatarName = avatarName; App.State.HomePlanet.IsCreated = homePlanet.IsCreated; App.State.HomePlanet.UpgradeLevel = homePlanet.UpgradeLevel; App.State.HomePlanet.UltimateBeings = UltimateBeing.Initial; App.State.HomePlanet.UltimateBeingsV2 = UltimateBeingV2.Initial; App.State.HomePlanet.UpgradeLevelArtyChallenge = homePlanet.UpgradeLevelArtyChallenge; if (App.State.Statistic.UltimateBaalChallengesFinished > 0 || App.State.Statistic.ArtyChallengesFinished > 0) { App.State.HomePlanet.UltimateBeingsV2[0].IsAvailable = true; App.State.HomePlanet.UltimateBeingsV2[0].TimesDefeated = homePlanet.UltimateBeingsV2[0].TimesDefeated; App.State.HomePlanet.UltimateBeingsV2[1].TimesDefeated = homePlanet.UltimateBeingsV2[1].TimesDefeated; App.State.HomePlanet.UltimateBeingsV2[2].TimesDefeated = homePlanet.UltimateBeingsV2[2].TimesDefeated; App.State.HomePlanet.UltimateBeingsV2[3].TimesDefeated = homePlanet.UltimateBeingsV2[3].TimesDefeated; App.State.HomePlanet.UltimateBeingsV2[4].TimesDefeated = homePlanet.UltimateBeingsV2[4].TimesDefeated; } App.State.HomePlanet.InitUBMultipliers(); App.State.HomePlanet.TotalGainedGodPower = homePlanet.TotalGainedGodPower; using (List <UltimateBeing> .Enumerator enumerator10 = App.State.HomePlanet.UltimateBeings.GetEnumerator()) { while (enumerator10.MoveNext()) { UltimateBeing being = enumerator10.Current; UltimateBeing ultimateBeing = homePlanet.UltimateBeings.FirstOrDefault((UltimateBeing x) => x.Tier == being.Tier); being.IsAvailable = ultimateBeing.IsAvailable; being.ComeBack(); being.HPPercent = 0.0; } } App.State.GameSettings.AutoBuyCreations = false; App.State.GameSettings.AutoBuyCreationsForMonumentsBeforeRebirth = App.State.GameSettings.AutoBuyCreationsForMonuments; App.State.GameSettings.AutoBuyCreationsForMonuments = false; foreach (UltimateBeingV2 current5 in App.State.HomePlanet.UltimateBeingsV2) { current5.IsDefeated = false; } App.State.Ext.AllPets = allPets; if (App.State.PremiumBoni.PetFoodAfterRebirth) { App.State.Ext.PunyFood = ext.PunyFood; App.State.Ext.MightyFood = ext.MightyFood; App.State.Ext.StrongFood = ext.StrongFood; } App.State.Ext.Chocolate = ext.Chocolate; App.State.Statistic.CalculateTotalPetGrowth(App.State.Ext.AllPets); App.SaveGameState(); Creation creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Shadow_clone); App.State.GameSettings.LastCreation = creation2; if (creation2 != null) { creation2.IsActive = true; } if (App.State.Statistic.HasStartedUltimateBaalChallenge && App.State.Statistic.CountRebirthsInUBC) { Statistic expr_133F = App.State.Statistic; expr_133F.RebirthsAfterUBC = ++expr_133F.RebirthsAfterUBC; } if (App.State.Statistic.HasStartedArtyChallenge) { Statistic expr_136D = App.State.Statistic; expr_136D.RebirthsAfterUAC = ++expr_136D.RebirthsAfterUAC; if (App.State.Statistic.RebirthsAfterUAC > 5) { App.State.Statistic.HasStartedArtyChallenge = false; App.State.Statistic.RebirthsAfterUAC = 0; App.State.Statistic.TimeAfterUACStarted = 0; App.State.HomePlanet.IsCreated = true; if (App.State.HomePlanet.UpgradeLevelArtyChallenge > App.State.HomePlanet.UpgradeLevel) { App.State.HomePlanet.UpgradeLevel = App.State.HomePlanet.UpgradeLevelArtyChallenge; } if (App.State.Statistic.UniverseChallengesFinished > 0 && App.State.HomePlanet.UpgradeLevel < App.State.Statistic.UniverseChallengesFinished + 5) { App.State.HomePlanet.UpgradeLevel = App.State.Statistic.UniverseChallengesFinished + 5; } App.State.HomePlanet.UpgradeLevelArtyChallenge = 0; foreach (UltimateBeing current6 in App.State.HomePlanet.UltimateBeings) { if (current6.Tier <= App.State.HomePlanet.UpgradeLevel) { current6.IsAvailable = true; } } Premium premiumBoni2 = App.State.PremiumBoni; App.State.PremiumBoni = Premium.FromString(App.State.Statistic.PremiumStatsBeforeUBCChallenge); App.State.PremiumBoni.AddPremiumAfterChallenge(premiumBoni2); App.State.Statistic.PremiumStatsBeforeUBCChallenge = string.Empty; App.State.Statistic.HighestGodInUAC = 0; App.State.Clones.AbsoluteMaximum = App.State.Statistic.AbsoluteMaxClonesBeforeUBCChallenge.ToInt(); App.State.Clones.MaxShadowClones = App.State.Statistic.MaxClonesBeforeUBCChallenge.ToInt(); string[] array = App.State.Statistic.SkillUsageCountBeforeUAC.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { int num4 = 0; int.TryParse(array[i], out num4); if (App.State.AllSkills.Count > i) { App.State.AllSkills[i].Extension.UsageCount += (long)num4; } } App.State.Statistic.SkillUsageCountBeforeUAC = string.Empty; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); GuiBase.ShowToast("Your Challenge failed! You received back the God Power and God Power upgrades you had before the challenge."); } } Leaderboards.SubmitStat(LeaderBoardType.Rebirths, App.State.Statistic.TotalRebirths.ToInt(), false); SpecialFightUi.SortSkills(); TBSUi.Reset(); PlanetUi.Instance.Reset(); if (!App.State.Statistic.HasStartedUltimateBaalChallenge && !App.State.Statistic.HasStartedArtyChallenge && App.State.Statistic.HighestGodDefeated > 3 && !App.State.IsSocialDialogShown) { MainUi.ShowSocialDialog = true; } MainUi.Instance.Init(true); }
public new void UpdateDuration(long ms) { if (this.Upgrade.UpdateDuration(ms)) { this.AddUpgradeLevel(); } if (App.State == null || this.ShadowCloneCount == 0) { return; } if (this.Level >= this.StopAt && this.StopAt != 0) { CDouble shadowCloneCount = this.ShadowCloneCount; App.State.Clones.RemoveUsedShadowClones(shadowCloneCount); this.ShadowCloneCount = 0; if (this.Upgrade.StopAt > 0 && this.Upgrade.IsAvailable) { this.Upgrade.AddCloneCount(shadowCloneCount); } else { Monument monument = App.State.AllMonuments.FirstOrDefault((Monument x) => x.TypeEnum == this.TypeEnum + 1); if (monument != null && monument.StopAt > 0) { monument.AddCloneCount(shadowCloneCount); } } return; } if (!this.IsPaid) { bool flag = false; StringBuilder stringBuilder = new StringBuilder("You still need:\n"); using (List <CreationCost> .Enumerator enumerator = this.RequiredCreations(this.Level).GetEnumerator()) { while (enumerator.MoveNext()) { CreationCost cost = enumerator.Current; Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); cost.CountNeeded.Round(); creation.count.Round(); if (cost.CountNeeded > creation.Count) { if (App.State.IsBuyUnlocked && App.State.GameSettings.AutoBuyCreationsForMonuments && creation.CanBuy) { CDouble cDouble = cost.CountNeeded - creation.Count; CDouble rightSide = cDouble * creation.BuyCost * (120 - App.State.PremiumBoni.AutoBuyCostReduction) / 100; if (App.State.Money >= rightSide) { App.State.Money -= rightSide; creation.count += cDouble; App.State.Statistic.TotalMoneySpent += rightSide; } else { flag = true; stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n"); } } else { flag = true; stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n"); } } } } if (flag) { stringBuilder.Append("to build ").Append(this.Name).ToString(); if (!App.State.GameSettings.StickyClones) { GuiBase.ShowToast(stringBuilder.ToString()); App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } else { this.MissingItems = "\n\n" + stringBuilder.ToString(); } return; } using (List <CreationCost> .Enumerator enumerator2 = this.RequiredCreations(this.Level).GetEnumerator()) { while (enumerator2.MoveNext()) { CreationCost cost = enumerator2.Current; Creation creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); creation2.Count -= cost.CountNeeded; } } this.IsPaid = true; } this.MissingItems = string.Empty; this.CurrentDuration += (ms * (long)this.ShadowCloneCount.ToInt() * (long)App.State.PremiumBoni.MonumentBuildTimeDivider * (100 + App.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100).ToLong(); if (this.CurrentDuration > this.DurationInMS(1)) { this.CurrentDuration = 0L; this.Level = ++this.Level; this.IsPaid = false; Statistic expr_4D4 = App.State.Statistic; expr_4D4.MonumentsCreated = ++expr_4D4.MonumentsCreated; Leaderboards.SubmitStat(LeaderBoardType.Monuments, App.State.Statistic.MonumentsCreated.ToInt(), false); if (this.TypeEnum == Monument.MonumentType.temple_of_god && this.Level == 1) { GuiBase.ShowContentUnlocked("You can now build a divinity generator!"); } this.AddStatBoni(); if (App.State.GameSettings.StopMonumentBuilding) { App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } if (this.TypeEnum == Monument.MonumentType.temple_of_god) { App.State.Generator.IsAvailable = true; } } }
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; }
public new bool UpdateDuration(long ms) { if (this.ShadowCloneCount == 0) { return(false); } if (this.Level >= this.StopAt && this.StopAt != 0) { CDouble shadowCloneCount = this.ShadowCloneCount; App.State.Clones.RemoveUsedShadowClones(shadowCloneCount); this.ShadowCloneCount = 0; Monument monument = App.State.AllMonuments.FirstOrDefault((Monument x) => x.TypeEnum == this.type + 1); if (monument != null && monument.StopAt > 0) { monument.AddCloneCount(shadowCloneCount); } return(false); } if (!this.IsPaid) { bool flag = false; StringBuilder stringBuilder = new StringBuilder("You still need:\n"); using (List <CreationCost> .Enumerator enumerator = this.RequiredCreations.GetEnumerator()) { while (enumerator.MoveNext()) { CreationCost cost = enumerator.Current; Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); if (cost.CountNeeded > creation.Count) { if (App.State.GameSettings.AutoBuyCreationsForMonuments && creation.CanBuy) { CDouble cDouble = cost.CountNeeded - creation.Count; CDouble rightSide = cDouble * creation.BuyCost * (120 - App.State.PremiumBoni.AutoBuyCostReduction) / 100; if (App.State.Money >= rightSide) { App.State.Money -= rightSide; creation.count += cDouble; App.State.Statistic.TotalMoneySpent += rightSide; } else { flag = true; stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n"); } } else { flag = true; stringBuilder.Append(creation.Name).Append(" x ").Append((cost.CountNeeded - creation.Count).ToGuiText(true)).Append("\n"); } } } } if (flag) { stringBuilder.Append("to upgrade ").Append(EnumName.Name(this.type)).ToString(); if (!App.State.GameSettings.StickyClones) { GuiBase.ShowToast(stringBuilder.ToString()); App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } else { this.MissingItems = "\n\n" + stringBuilder.ToString(); } return(false); } using (List <CreationCost> .Enumerator enumerator2 = this.RequiredCreations.GetEnumerator()) { while (enumerator2.MoveNext()) { CreationCost cost = enumerator2.Current; Creation creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); creation2.Count -= cost.CountNeeded; } } this.IsPaid = true; } this.MissingItems = string.Empty; this.CurrentDuration += (ms * (long)this.ShadowCloneCount.ToInt() * (long)App.State.PremiumBoni.MonumentBuildTimeDivider * (100 + App.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100).ToLong(); if (this.CurrentDuration > this.DurationInMS(1)) { if (App.State.GameSettings.StopMonumentBuilding) { App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } this.IsPaid = false; this.CurrentDuration = 0L; return(true); } return(false); }
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 UpdateDuration(long ms) { if (this.ShadowCloneCount == 0) { return; } this.CurrentDuration += ms * (long)this.ShadowCloneCount.ToInt(); int num = this.DurationInMS(1); if (this.CurrentDuration > (long)num) { this.CurrentDuration = 0L; CDouble cDouble = 0; if (App.State.GameSettings.IgnoreCloneCountOn) { cDouble = App.State.GameSettings.TrainIgnoreCount; } if (cDouble > this.ShadowCloneCount) { cDouble = this.ShadowCloneCount; } bool flag = true; int value = App.State.GameSettings.StopClonesAtSkills; bool flag2 = App.State.GameSettings.IsStopAtOnSkills; if (this is Training) { value = App.State.GameSettings.StopClonesAtTrainings; flag2 = App.State.GameSettings.IsStopAtOnTrainings; } if (this.ShadowCloneCount > cDouble && this.Level >= value && flag2) { flag = false; CDouble cDouble2 = this.ShadowCloneCount; if (!App.State.GameSettings.UseStopAt) { if (this.checkNext() || !App.State.PremiumBoni.ImprovedNextAt) { cDouble2 -= cDouble; this.RemoveCloneCount(cDouble2); if (this is Training) { Training training = App.State.AllTrainings.FirstOrDefault((Training x) => x.EnumValue == this.EnumValue + 1); if (training != null && training.IsAvailable) { training.AddCloneCount(cDouble2); } } else if (this is Skill) { Skill skill = App.State.AllSkills.FirstOrDefault((Skill x) => x.EnumValue == this.EnumValue + 1); if (skill != null && skill.IsAvailable) { skill.AddCloneCount(cDouble2); } } } else { flag = true; } } else { cDouble2 -= cDouble; this.RemoveCloneCount(cDouble2); } } if (flag) { this.Level = ++this.Level; if (this is Training) { App.State.PhysicalPowerBase += this.PowerGain; Statistic expr_255 = App.State.Statistic; expr_255.TotalTrainingLevels = ++expr_255.TotalTrainingLevels; } else if (this is Skill) { App.State.MysticPowerBase += this.PowerGain; Statistic expr_29A = App.State.Statistic; expr_29A.TotalSkillLevels = ++expr_29A.TotalSkillLevels; } } } }
public int CompareTo(CDouble value) { return(CDouble.Compare(this, value)); }
public void CheckForUbAttack() { if (App.State.Statistic.HasStarted1kChallenge) { return; } long num = 0L; long num2 = 600000L; if (App.State.Statistic.NoRbChallengesFinished > 0) { int num3 = App.State.Statistic.NoRbChallengesFinished.ToInt(); if (num3 > 20) { num3 = 20; } num2 = num2 * (long)(100 - num3) / 100L; } UltimateBeing ultimateBeing = null; List <UltimateBeing> list = (from x in App.State.HomePlanet.UltimateBeings orderby x.Tier descending select x).ToList <UltimateBeing>(); foreach (UltimateBeing current in list) { if (current.IsAvailable) { if (current.HPPercent > 0.0) { long num4 = current.TimeUntilComeBack + num2 - current.TimeUntilComeBackBase; if (num == 0L || num > num4) { num = num4; } ultimateBeing = current; } else if (num == 0L || num > current.TimeUntilComeBack + num2) { num = current.TimeUntilComeBack + num2; } } } if (this.LastUBAttack < num2 && num < num2 - this.LastUBAttack) { num = num2 - this.LastUBAttack; } if (num <= 0L && ultimateBeing != null) { string text = ultimateBeing.Fight(App.State, 0, 0, 0, this.DefenderClones, true); this.DefenderClones.Round(); if (text.Contains("lost the fight")) { int value = ultimateBeing.Tier * 10; CDouble cDouble = this.Energy * value / 100; this.Energy -= cDouble; if (cDouble > 0) { text = text + "\nHe stole " + cDouble.GuiText + " energy!\n"; } bool flag = false; string text2 = "He also stole "; if (cDouble > 0) { text2 = "He stole "; } foreach (FactoryModule current2 in this.AllModules) { Crystal crystal = current2.Crystals.FirstOrDefault((Crystal x) => x.Level == 1); if (crystal != null && crystal.Count > 0) { flag = true; CDouble cDouble2 = ultimateBeing.Tier; if (cDouble2 > crystal.Count) { cDouble2 = crystal.Count; } crystal.Count -= cDouble2; text2 = string.Concat(new object[] { text2, cDouble2.GuiText, " ", crystal.Type }); if (cDouble2 == 1) { text2 += " Crystal, "; } else { text2 += " Crystals, "; } } } if (flag) { text2 = Conv.ReplaceLastOccurrence(text2, "Crystals, ", "Crystals of grade 1!"); text2 = Conv.ReplaceLastOccurrence(text2, "Crystal, ", "Crystal of grade 1!"); text += text2; } if (!flag && cDouble == 0) { text = ultimateBeing.Name + " tried to attack, but there was nothing of interest on your planet, so he left.\n\n"; } } this.DefenderFightsText.Append(text + "\n\n"); this.LastUBAttack = 0L; } this.TimeUntilAttack = num; }
public new void UpdateDuration(long ms) { foreach (GeneratorUpgrade current in this.Upgrades) { current.UpdateDuration(ms); } CDouble leftSide = 0; int num = 0; if (this.IsBuilt && this.ShadowCloneCount > 0) { Creation creation = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == Creation.CreationType.Stone); if (creation != null) { CDouble rightSide = ms * (long)App.State.ClonesDifGenMod / 20L; CDouble cDouble = this.ShadowCloneCount * rightSide; if (creation.Count < cDouble) { cDouble = creation.Count; } CDouble cDouble2 = this.Capacity - this.FilledCapacity; CDouble cDouble3 = cDouble * creation.BuyCost; if (cDouble3 > cDouble2) { leftSide = cDouble3 - cDouble2; cDouble3 = cDouble2; } if (leftSide > 0) { cDouble -= leftSide / creation.BuyCost; num = (leftSide / 962500000).ToInt(); } this.FilledCapacity += cDouble3; creation.Count -= cDouble; } } if (this.FilledCapacity > 0) { CDouble cDouble4 = this.ConvertSec * ms / 1000; if (this.FilledCapacity > cDouble4) { this.FilledCapacity -= cDouble4; } else { cDouble4 = this.FilledCapacity; this.FilledCapacity = 0; } CDouble cDouble5 = cDouble4 * this.DivinityEachCapacity; this.DivinitySec = cDouble5 * 1000 / ms; if (num > 400) { num = 400; } cDouble5 = cDouble5 * (num + 100) / 100; this.DivinitySecWithWorker = cDouble5 * 1000 / ms; if (App.State.PremiumBoni.CrystalBonusDivinity > 0) { cDouble5 = cDouble5 * (100 + App.State.PremiumBoni.CrystalBonusDivinity) / 100; this.DivinitySecWithWorkerCrystal = cDouble5 * 1000 / ms; } App.State.Money += cDouble5; } else { this.DivinitySecWithWorker = 0; this.DivinitySec = 0; } if (this.ShadowCloneCount == 0 || this.IsBuilt) { return; } if (!this.IsPaid) { bool flag = false; StringBuilder stringBuilder = new StringBuilder("You still need:\n"); using (List <CreationCost> .Enumerator enumerator2 = this.RequiredCreations.GetEnumerator()) { while (enumerator2.MoveNext()) { CreationCost cost = enumerator2.Current; Creation creation2 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); if (!CreationCost.HasCreations(App.State, cost, App.State.GameSettings.AutoBuyCreationsForDivGen)) { flag = true; stringBuilder.Append(creation2.Name).Append(" x ").Append((cost.CountNeeded - creation2.Count).ToGuiText(true)).Append("\n"); } } } if (flag) { stringBuilder.Append("to build ").Append(this.Name).ToString(); if (!App.State.GameSettings.StickyClones) { GuiBase.ShowToast(stringBuilder.ToString()); App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } else { this.MissingItems = "\n\n" + stringBuilder.ToString(); } return; } using (List <CreationCost> .Enumerator enumerator3 = this.RequiredCreations.GetEnumerator()) { while (enumerator3.MoveNext()) { CreationCost cost = enumerator3.Current; Creation creation3 = App.State.AllCreations.FirstOrDefault((Creation x) => x.TypeEnum == cost.TypeEnum); creation3.Count -= cost.CountNeeded; } } this.IsPaid = true; } this.MissingItems = string.Empty; this.CurrentDuration += (ms * (long)this.ShadowCloneCount.ToInt() * (long)App.State.PremiumBoni.MonumentBuildTimeDivider * (100 + App.State.PremiumBoni.BuildingSpeedUpPercent(true)) / 100).ToLong(); Log.Info(string.Concat(new object[] { this.Name, ", Duration: ", this.CurrentDuration, " / ", this.DurationInMS(1) })); if (this.CurrentDuration > this.DurationInMS(1)) { this.IsPaid = false; this.CurrentDuration = 0L; this.IsBuilt = true; App.State.Clones.RemoveUsedShadowClones(this.ShadowCloneCount); this.ShadowCloneCount = 0; } }
public void GetAttacked(CDouble attackPower, long millisecs) { int value = UnityEngine.Random.Range(1, 100); CDouble cDouble; if (value <= App.State.Crits.CriticalPercent(App.State.GameSettings.TBSEyesIsMirrored)) { attackPower = attackPower * App.State.Crits.CriticalDamage / 100; cDouble = attackPower / 5000 * millisecs; } else { cDouble = (attackPower - this.Defense) / 5000 * millisecs; } this.DamageSec = cDouble * 33; if (cDouble > 0) { this.CurrentHealth -= cDouble; } if (this.CurrentHealth <= 0) { App.State.Title = EnumName.Title(App.State.Avatar.IsFemale, this.TypeEnum); App.State.TitleGod = this.Name; if (App.State.Statistic.HighestGodDefeated < (int)this.TypeEnum) { App.State.Statistic.HighestGodDefeated = (int)this.TypeEnum; } if (App.State.Statistic.HasStartedArtyChallenge && App.State.Statistic.HighestGodInUAC < (int)this.TypeEnum) { App.State.Statistic.HighestGodInUAC = (int)this.TypeEnum; } this.IsDefeated = true; if (this.TypeEnum > God.GodType.Diana || !this.IsDefeatedForFirstTime) { this.IsDefeatedForFirstTime = true; App.State.PremiumBoni.GodPower++; GuiBase.ShowToast("Your god power is increased by 1!"); App.State.PremiumBoni.CheckIfGPIsAdjusted(); } Statistic expr_212 = App.State.Statistic; expr_212.TotalGodsDefeated = ++expr_212.TotalGodsDefeated; StoryUi.SetUnlockedStoryParts(App.State); Leaderboards.SubmitStat(LeaderBoardType.GodsDefeated, App.State.Statistic.TotalGodsDefeated.ToInt(), false); Leaderboards.SubmitStat(LeaderBoardType.HighestGodDefeated, App.State.Statistic.HighestGodDefeated.ToInt(), false); HeroImage.Init(true); if (this.TypeEnum == God.GodType.Diana) { App.State.IsMonumentUnlocked = true; GuiBase.ShowContentUnlocked("You can now build monuments."); } else if (this.TypeEnum == God.GodType.Nephthys) { App.State.IsBuyUnlocked = true; App.State.GameSettings.AutoBuyCreationsForMonuments = App.State.GameSettings.AutoBuyCreationsForMonumentsBeforeRebirth; GuiBase.ShowContentUnlocked("You can now buy creations after you created at least one."); } else if (this.TypeEnum == God.GodType.Poseidon && App.CurrentPlattform == Plattform.Android && !App.State.Ext.RateDialogShown) { App.State.Ext.RateDialogShown = true; GuiBase.ShowDialog("Rate ItRtG", "If you like the game, please rate it on google play. Good ratings helps to get more players, and more players will lead to more success of the game, and more time for me to work on updates or future games.", delegate { App.OpenWebsite("https://play.google.com/store/apps/details?id=de.shugasu.itrtg"); }, delegate { }, "Rate it", "Cancel", true, true); } else if (this.TypeEnum == God.GodType.Freya) { App.State.IsUpgradeUnlocked = true; GuiBase.ShowContentUnlocked("You can now upgrade your monuments!"); } else if (this.TypeEnum == God.GodType.Chronos && App.State.Statistic.HasStartedArtyChallenge) { UpdateStats.SaveToServer(UpdateStats.ServerSaveType.UAChallengeSave2); } else if (this.TypeEnum == God.GodType.Tyrant_Overlord_Baal) { if (App.State.Statistic.HasStartedDoubleRebirthChallenge) { App.State.Statistic.HasStartedDoubleRebirthChallenge = false; if (App.State.Statistic.FastestDRCallenge <= 0 || App.State.Statistic.FastestDRCallenge > App.State.Statistic.TimeAfterDRCStarted) { App.State.Statistic.FastestDRCallenge = App.State.Statistic.TimeAfterDRCStarted; Leaderboards.SubmitStat(LeaderBoardType.FastestDRCallenge, App.State.Statistic.FastestDRCallenge.ToInt() / 1000, false); } App.State.Statistic.TimeAfterDRCStarted = 0; Statistic expr_493 = App.State.Statistic; expr_493.DoubleRebirthChallengesFinished = ++expr_493.DoubleRebirthChallengesFinished; int num = 10; if (App.State.Statistic.DoubleRebirthChallengesFinished > 50) { num += 10; } App.State.PremiumBoni.GodPower += num; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); GuiBase.ShowToast("Your god power is increased by " + num + " because you beat the double rebirth challenge!"); } if (App.State.Statistic.HasStarted1kChallenge) { App.State.Statistic.HasStarted1kChallenge = false; if (App.State.Statistic.Fastest1KCCallenge <= 0 || App.State.Statistic.Fastest1KCCallenge > App.State.Statistic.TimeAfter1KCStarted) { App.State.Statistic.Fastest1KCCallenge = App.State.Statistic.TimeAfter1KCStarted; Leaderboards.SubmitStat(LeaderBoardType.Fastest1KCCallenge, App.State.Statistic.Fastest1KCCallenge.ToInt() / 1000, false); } App.State.Statistic.TimeAfter1KCStarted = 0; Statistic expr_5DA = App.State.Statistic; expr_5DA.OnekChallengesFinished = ++expr_5DA.OnekChallengesFinished; App.State.Clones.MaxShadowClones = App.State.Clones.AbsoluteMaximum; App.State.PremiumBoni.GodPower += 20; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); GuiBase.ShowToast("Your god power is increased by " + 20 + " because you beat the 1k challenge!"); } if (App.State.Statistic.HasStartedUltimatePetChallenge) { App.State.Statistic.HasStartedUltimatePetChallenge = false; if (App.State.Statistic.FastestUPCallenge <= 0 || App.State.Statistic.FastestUPCallenge > App.State.Statistic.TimeAfterUPCStarted) { App.State.Statistic.FastestUPCallenge = App.State.Statistic.TimeAfterUPCStarted; Leaderboards.SubmitStat(LeaderBoardType.FastestUPCallenge, App.State.Statistic.FastestUPCallenge.ToInt() / 1000, false); } App.State.Statistic.TimeAfterUPCStarted = 0; Statistic expr_71F = App.State.Statistic; expr_71F.UltimatePetChallengesFinished = ++expr_71F.UltimatePetChallengesFinished; App.SaveGameState(); GuiBase.ShowToast("You have finished the ultimate pet challenge! The rewards you can get from pet campaigns are increased by 5%!"); } if (App.State.Statistic.HasStartedNoRbChallenge) { App.State.Statistic.HasStartedNoRbChallenge = false; if (App.State.Statistic.FastestNoRbCCallenge <= 0 || App.State.Statistic.FastestNoRbCCallenge > App.State.Statistic.TimeAfterNoRbStarted) { App.State.Statistic.FastestNoRbCCallenge = App.State.Statistic.TimeAfterNoRbStarted; Leaderboards.SubmitStat(LeaderBoardType.FastestNRChallenge, App.State.Statistic.FastestNoRbCCallenge.ToInt() / 1000, false); } App.State.Statistic.TimeAfterNoRbStarted = 0; Statistic expr_809 = App.State.Statistic; expr_809.NoRbChallengesFinished = ++expr_809.NoRbChallengesFinished; App.State.PremiumBoni.GodPower += 250; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); GuiBase.ShowToast("Your god power is increased by " + 250 + " because you beat the no rebirth challenge!"); } if (App.State.Statistic.HasStartedUltimateBaalChallenge) { App.State.Statistic.HasStartedUltimateBaalChallenge = false; if (App.State.Statistic.FastestUBCallenge <= 0 || App.State.Statistic.FastestUBCallenge > App.State.Statistic.TimeAfterUBCStarted) { App.State.Statistic.FastestUBCallenge = App.State.Statistic.TimeAfterUBCStarted; if (App.State.ShouldSubmitScore) { long num2 = 0L; long.TryParse((App.State.Statistic.FastestUBCallenge.Double / 1000.0).ToString(), out num2); if (num2 == 0L) { num2 = App.State.Statistic.FastestUBCallenge.ToLong() / 1000L; } Leaderboards.SubmitStat(LeaderBoardType.FastestUBCallenge, (int)num2, false); } } App.State.Statistic.TimeAfterUBCStarted = 0; Statistic expr_983 = App.State.Statistic; expr_983.UltimateBaalChallengesFinished = ++expr_983.UltimateBaalChallengesFinished; if (App.State.Statistic.MinRebirthsAfterUBC == -1 || App.State.Statistic.MinRebirthsAfterUBC > App.State.Statistic.RebirthsAfterUBC) { App.State.Statistic.MinRebirthsAfterUBC = App.State.Statistic.RebirthsAfterUBC; } App.State.Statistic.RebirthsAfterUBC = 0; App.State.HomePlanet.UltimateBeingsV2[0].IsAvailable = true; Premium premiumBoni = App.State.PremiumBoni; App.State.PremiumBoni = Premium.FromString(App.State.Statistic.PremiumStatsBeforeUBCChallenge); App.State.PremiumBoni.AddPremiumAfterChallenge(premiumBoni); App.State.Statistic.PremiumStatsBeforeUBCChallenge = string.Empty; App.State.Clones.AbsoluteMaximum = App.State.Statistic.AbsoluteMaxClonesBeforeUBCChallenge.ToInt(); App.State.Clones.MaxShadowClones = App.State.Statistic.MaxClonesBeforeUBCChallenge.ToInt(); App.State.PremiumBoni.GodPower += 100; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); GuiBase.ShowToast("Your god power is increased by 100 because you beat the ultimate baal challenge!"); } if (App.State.Statistic.HasStartedArtyChallenge) { App.State.Statistic.HasStartedArtyChallenge = false; long num3 = 0L; if (App.State.Statistic.FastestUACallenge <= 0 || App.State.Statistic.FastestUACallenge > App.State.Statistic.TimeAfterUACStarted) { App.State.Statistic.FastestUACallenge = App.State.Statistic.TimeAfterUACStarted; num3 = (long)(App.State.Statistic.FastestUACallenge.Double / 1000.0); if (App.State.ShouldSubmitScore) { if (num3 == 0L) { num3 = App.State.Statistic.FastestUACallenge.ToLong() / 1000L; } if (num3 > 2000000L || App.State.PremiumBoni.HasPurchasedGodPowerOnce) { Leaderboards.SubmitStat(LeaderBoardType.FastestUACallenge, (int)num3, false); } } } else { num3 = (long)(App.State.Statistic.TimeAfterUACStarted.Double / 1000.0); } App.State.Statistic.TimeAfterUACStarted = 0; Statistic expr_C4C = App.State.Statistic; expr_C4C.ArtyChallengesFinished = ++expr_C4C.ArtyChallengesFinished; App.State.HomePlanet.IsCreated = true; if (App.State.HomePlanet.UpgradeLevelArtyChallenge > App.State.HomePlanet.UpgradeLevel) { App.State.HomePlanet.UpgradeLevel = App.State.HomePlanet.UpgradeLevelArtyChallenge; } if (App.State.Statistic.UniverseChallengesFinished > 0 && App.State.HomePlanet.UpgradeLevel < App.State.Statistic.UniverseChallengesFinished + 5) { App.State.HomePlanet.UpgradeLevel = App.State.Statistic.UniverseChallengesFinished + 5; } App.State.HomePlanet.UpgradeLevelArtyChallenge = 0; foreach (UltimateBeing current in App.State.HomePlanet.UltimateBeings) { if (current.Tier <= App.State.HomePlanet.UpgradeLevel) { current.IsAvailable = true; } } App.State.HomePlanet.UltimateBeingsV2[0].IsAvailable = true; if (App.State.Statistic.MinRebirthsAfterUAC <= 0 || App.State.Statistic.MinRebirthsAfterUAC > App.State.Statistic.RebirthsAfterUAC) { App.State.Statistic.MinRebirthsAfterUAC = App.State.Statistic.RebirthsAfterUAC; } App.State.Statistic.RebirthsAfterUAC = 0; Premium premiumBoni2 = App.State.PremiumBoni; App.State.PremiumBoni = Premium.FromString(App.State.Statistic.PremiumStatsBeforeUBCChallenge); App.State.PremiumBoni.AddPremiumAfterChallenge(premiumBoni2); App.State.Statistic.PremiumStatsBeforeUBCChallenge = string.Empty; App.State.Statistic.HighestGodInUAC = 0; App.State.Clones.AbsoluteMaximum = App.State.Statistic.AbsoluteMaxClonesBeforeUBCChallenge.ToInt(); App.State.Clones.MaxShadowClones = App.State.Statistic.MaxClonesBeforeUBCChallenge.ToInt(); string[] array = App.State.Statistic.SkillUsageCountBeforeUAC.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { int num4 = 0; int.TryParse(array[i], out num4); if (App.State.AllSkills.Count > i) { App.State.AllSkills[i].Extension.UsageCount += (long)num4; } } App.State.Statistic.SkillUsageCountBeforeUAC = string.Empty; App.State.PremiumBoni.GodPower += 200; App.State.PremiumBoni.CheckIfGPIsAdjusted(); App.SaveGameState(); if (num3 < 2000000L) { GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nHowever your time doesn't seem to be legit, you won't get the Pet Token Reward.\nIf you really beat the challenge in this time without cheating, please report to [email protected], so I can look at it."); } else if (App.State.Statistic.ArtyChallengesFinished == 1) { GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nYour god power is increased by 200, you unlocked the turtle with the 'Arty was here' sign and you received the turtle pet!"); } else if (App.State.Statistic.ArtyChallengesFinished == 2) { Premium expr_1032 = App.State.PremiumBoni; expr_1032.PetToken = ++expr_1032.PetToken; GuiBase.ShowBigMessage("Contratulations, you have beaten the Ultimate Arty Challenge!\nYour god power is increased by 200, and you received a pet token!"); } } App.State.PrinnyBaal.IsUnlocked = true; } } Log.Info("CurrentHealth: " + this.CurrentHealth); }
public bool DoDamage(CDouble damage) { this.HP -= damage; return(this.HP <= 0); }
public void UseSkill(Skill skill, bool usedKey = false) { int num = 500; if (usedKey) { num = 800; } foreach (Skill current in App.State.AllSkills) { if (current.Extension.CoolDownCurrent < (long)num) { current.Extension.CoolDownCurrent = (long)num; } } SkillExtension extension = skill.Extension; extension.CoolDownCurrent = extension.CoolDownBase; extension.UsageCount += 1L; if (skill.TypeEnum == Skill.SkillType.time_manipulation) { this.CurrentEnemy.TimeManipulate(); CDouble cDouble = new CDouble(); StringBuilder stringBuilder = new StringBuilder("You use ").Append(skill.Name).Append(" and the damages "); for (int i = 0; i < 3; i++) { if (this.last3EnemyAttacks[i] != null) { cDouble += this.last3EnemyAttacks[i]; stringBuilder.Append(this.last3EnemyAttacks[i].ToGuiText(true)); if (i == 0) { stringBuilder.Append(", "); } if (i == 1) { stringBuilder.Append(" and "); } } } this.PlayerHp += cDouble; this.SkillUseText = this.FightTimeString + stringBuilder.ToString() + " never occurred."; this.FightingLog.Add(this.SkillUseText); return; } if (extension.DamagePercent > 0) { int num2 = extension.DamagePercent; int num3 = extension.Hitcount; if (skill.TypeEnum == Skill.SkillType.unlimited_creation_works) { int num4 = 0; foreach (Creation current2 in App.State.AllCreations) { if (current2.CanBuy) { num4++; } } num2 *= num4; } else if (skill.TypeEnum == Skill.SkillType.ionioi_hero_summon) { num3 = App.State.Statistic.HighestGodDefeated.ToInt(); } if (this.DoubleUp) { this.DoubleUp = false; num2 *= 2; } StringBuilder stringBuilder2 = new StringBuilder("You attack ").Append(this.CurrentEnemy.Name).Append(" with ").Append(skill.Name); int num5 = 0; for (int j = 0; j < num3; j++) { int num6 = UnityEngine.Random.Range(0, 100); if (extension.Hitchance + this.HitchanceBonus > num6) { num5++; } } this.HitchanceBonus = 0; if (num5 > 0) { CDouble cDouble2 = skill.Level; if (cDouble2 > 100000) { int num7 = cDouble2.ToInt() - 100000; if (num7 > 1100000) { cDouble2 = 150000 + (num7 - 1100000) / 100; } else { cDouble2 = 100000 + num7 / 20; } } CDouble cDouble3 = this.randomize(cDouble2 * num2 * this.DamageIncrease * App.State.Attack / 1000000000 * num5); Log.Info("playerDamage: " + cDouble3.ToGuiText(true)); stringBuilder2.Append(" and hit ").Append(num5).Append(" times for ").Append(cDouble3.ToGuiText(true)).Append(" damage total."); this.TotalPlayerDamage += cDouble3; this.SkillUseText = this.FightTimeString + stringBuilder2.ToString(); if (extension.HealPercent != 0) { StringBuilder stringBuilder3 = new StringBuilder(); CDouble cDouble4 = extension.HealPercent * App.State.MaxHealth / 100; if (this.PlayerHp + cDouble4 > this.PlayerMaxHP) { cDouble4 = this.PlayerMaxHP - this.PlayerHp; } this.PlayerHp += cDouble4; if (cDouble4 > 0) { stringBuilder3.Append("\nYou heal yourself for " + cDouble4.ToGuiText(true)).Append("."); } else { stringBuilder3.Append("\nYou damage yourself for " + (cDouble4 * -1).ToGuiText(true)).Append("."); } this.SkillUseText += stringBuilder3.ToString(); } this.FightingLog.Add(this.SkillUseText); if (this.PlayerHp <= 0) { GuiBase.ShowToast("You lose!"); this.IsFighting = false; this.IsBattleFinished = true; this.GetReward(false); return; } if (this.CurrentEnemy.DoDamage(cDouble3)) { this.SkillUseText = "You defeated " + this.CurrentEnemy.Name + "!"; if (this.currentBattleType == BattleState.BattleType.developer) { this.SkillUseText = this.SkillUseText + " " + this.CurrentEnemy.Name + " evolved into "; } this.DefeatedEnemyCount++; Log.Info("AllEnemies.Count: " + this.AllEnemies.Count); if (this.AllEnemies.Count > 0) { this.CurrentEnemy = this.AllEnemies[0]; this.AllEnemies.RemoveAt(0); if (this.currentBattleType == BattleState.BattleType.developer) { this.SkillUseText = this.SkillUseText + this.CurrentEnemy.Name + "!"; } } else if (this.currentBattleType == BattleState.BattleType.gods) { CDouble cDouble5 = new CDouble("99999999999999999999999999999999999999999999999999999999000"); int num8 = 1; for (int k = 0; k < this.DefeatedEnemyCount - 28; k++) { num8++; cDouble5 *= 100; } string name = "P. Baal"; if (num8 > 1) { name = "P. Baal v " + num8; } List <EnemyData.SpecialAttackChance> list = new List <EnemyData.SpecialAttackChance>(); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.doubleDamage, 20)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tripleDamage, 10)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.fiveDamage, 5)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tenDamage, 3)); this.CurrentEnemy = new EnemyData.Enemy(name, string.Empty, cDouble5 * 1000, cDouble5, EnemyData.EnemyType.constantDamage, list); } else if (this.currentBattleType == BattleState.BattleType.endless) { string name2 = this.DefeatedEnemyCount + 1 + " Shadow Clones"; List <EnemyData.SpecialAttackChance> list2 = new List <EnemyData.SpecialAttackChance>(); list2.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.doubleDamage, 2 + this.DefeatedEnemyCount / 2)); list2.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tripleDamage, 1 + this.DefeatedEnemyCount / 3)); list2.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.fiveDamage, 1 + this.DefeatedEnemyCount / 5)); list2.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tenDamage, 1 + this.DefeatedEnemyCount / 10)); CDouble hp = App.State.PowerLevel * 5 * (this.DefeatedEnemyCount + 1); CDouble dam = App.State.PowerLevel / 300 * (this.DefeatedEnemyCount + 1); this.CurrentEnemy = new EnemyData.Enemy(name2, string.Empty, hp, dam, EnemyData.EnemyType.constantDamage, list2); } else { GuiBase.ShowToast("You win!"); this.IsFighting = false; this.IsBattleFinished = true; this.GetReward(true); } this.FightingLog.Add(this.SkillUseText); } } else { stringBuilder2.Append(" and your attack misses!"); this.SkillUseText = this.FightTimeString + stringBuilder2.ToString(); this.FightingLog.Add(this.SkillUseText); } } else { StringBuilder stringBuilder4 = new StringBuilder(this.FightTimeString + "You use " + skill.Name).Append(" "); if (extension.DamageBlock) { this.DamageBlock = true; stringBuilder4.Append("and the next incoming damage will be blocked."); } if (extension.DamageReflect) { this.DamageReflect = true; stringBuilder4.Append("and the next incoming damage will be reflected."); } if (extension.DoubleUp) { this.DoubleUp = true; stringBuilder4.Append("and the next damage you do will be doubled."); } if (extension.GodSpeedModeDuration > 0L) { this.GodSpeedModeDuration = extension.GodSpeedModeDuration; stringBuilder4.Append("and you enter god speed mode for " + extension.GodSpeedModeDuration / 1000L + " seconds."); } if (extension.GearEyesDuration > 0L) { this.GearEyesDuration = extension.GearEyesDuration; stringBuilder4.Append("and the enemy is stopped for " + extension.GearEyesDuration / 1000L + " seconds."); } if (extension.HealPercent != 0) { CDouble cDouble6 = extension.HealPercent * App.State.MaxHealth / 100; if (this.PlayerHp + cDouble6 > this.PlayerMaxHP) { cDouble6 = this.PlayerMaxHP - this.PlayerHp; } this.PlayerHp += cDouble6; if (cDouble6 > 0) { stringBuilder4.Append("and you heal yourself for " + cDouble6.ToGuiText(true)).Append("."); } else { stringBuilder4.Append("and you damage yourself for " + (cDouble6 * -1).ToGuiText(true)).Append("."); } } if (extension.DodgeChance > 0) { this.DodgeChance = extension.DodgeChance; stringBuilder4.Append("and have a ").Append(extension.DodgeChance).Append(" % chance to dodge the next attack."); } if (extension.HitchanceBonus > 0) { this.HitchanceBonus = extension.HitchanceBonus; stringBuilder4.Append("and your next attack skill will have a ").Append(this.HitchanceBonus).Append(" % higher chance to hit."); } if (extension.CounterChance > 0) { this.CounterChance = extension.CounterChance; stringBuilder4.Append("and you have a ").Append(extension.CounterChance).Append(" % chance to counter the next attack."); } if (extension.DamageIncreaseDuration > 0L) { stringBuilder4.Append("and your damage is increased by ").Append(extension.DamageIncreasePercent).Append(" % for ").Append(extension.DamageIncreaseDuration / 1000L).Append(" seconds."); this.DamageIncreases.Add(new DamageChange(extension.DamageIncreasePercent, extension.DamageIncreaseDuration)); } if (extension.DamageDecreaseDuration > 0L) { stringBuilder4.Append("and the damage you receive is decreased by ").Append(extension.DamageDecreasePercent).Append(" % for ").Append(extension.DamageDecreaseDuration / 1000L).Append(" seconds."); this.DamageDecreases.Add(new DamageChange(extension.DamageDecreasePercent, extension.DamageDecreaseDuration)); } this.SkillUseText = stringBuilder4.ToString(); this.SkillUseText = this.SkillUseText.Replace('.', ' ').TrimEnd(new char[0]) + "."; this.FightingLog.Add(this.SkillUseText); } }