예제 #1
0
        private void FightGod(long ms)
        {
            this.pierceModi--;
            bool isPierce = false;

            if (this.pierceModi < (int)this.TypeEnum)
            {
                isPierce        = true;
                this.pierceModi = 28;
            }
            if (App.State.GetAttacked(this.GodToDefeat.Attack, ms, isPierce))
            {
                this.IsActive = false;
                GodUi.EnableCreating();
            }
            else if (App.State.Statistic.HasStartedUltimatePetChallenge)
            {
                CDouble cDouble = App.State.Ext.GetTotalPetPower(true) / 3;
                this.GodToDefeat.GetAttacked(cDouble, ms);
                CDouble leftSide  = (this.GodToDefeat.Attack - cDouble) / 5000 * ms;
                CDouble rightSide = leftSide / App.State.Ext.PetPowerMultiCampaigns / App.State.Ext.PetPowerMultiGods;
                if (cDouble == 0)
                {
                    this.IsActive = false;
                    GodUi.EnableCreating();
                }
                foreach (Pet current in App.State.Ext.AllPets)
                {
                    if (current.CurrentHealth > 0 && !current.IsInCampaign)
                    {
                        current.CurrentHealth -= rightSide;
                        if (current.CurrentHealth < 0)
                        {
                            current.CurrentHealth  = 0;
                            current.ZeroHealthTime = 60000L;
                        }
                        break;
                    }
                }
                if (this.GodToDefeat.IsDefeated && !this.GodToDefeat.IsDefeatedPetChallenge)
                {
                    this.GodToDefeat.IsDefeatedPetChallenge = true;
                    App.State.Ext.PetPowerMultiGods         = App.State.Ext.PetPowerMultiGods * 4;
                }
            }
            else
            {
                this.GodToDefeat.GetAttacked(App.State.Attack, ms);
            }
            if (this.GodToDefeat.IsDefeated)
            {
                this.IsActive = false;
                GodUi.EnableCreating();
            }
        }
 public void Fight(long ms)
 {
     this.RecoverHealth(ms);
     if (!this.IsFighting || !this.IsUnlocked)
     {
         return;
     }
     if (App.State.GetAttacked(this.Attack, ms, true))
     {
         this.IsFighting = false;
         GodUi.EnableCreating();
     }
     else
     {
         this.GetAttacked(App.State.Attack, ms);
     }
 }
        public void GetAttacked(CDouble attackPower, long millisecs)
        {
            int     value   = UnityEngine.Random.Range(1, 100);
            CDouble cDouble = new 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)
            {
                if (App.State.Statistic.HighestGodDefeated < this.Level + 28)
                {
                    App.State.Statistic.HighestGodDefeated = this.Level + 28;
                }
                App.State.PremiumBoni.GodPower++;
                App.State.HomePlanet.BaalPower += this.Level;
                GuiBase.ShowToast("Your god power is increased by 1, you also received " + this.Level + " Baal Power!");
                App.State.PremiumBoni.CheckIfGPIsAdjusted();
                this.IsFighting = false;
                GodUi.EnableCreating();
                Statistic expr_1AF = App.State.Statistic;
                expr_1AF.TotalGodsDefeated = ++expr_1AF.TotalGodsDefeated;
                Leaderboards.SubmitStat(LeaderBoardType.GodsDefeated, App.State.Statistic.TotalGodsDefeated.ToInt(), false);
                Leaderboards.SubmitStat(LeaderBoardType.HighestGodDefeated, App.State.Statistic.HighestGodDefeated.ToInt(), false);
                this.IncreaseLevel();
            }
            Log.Info("CurrentHealth: " + this.CurrentHealth);
        }