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 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);
 }