Beispiel #1
0
        private void SimRound(Round round)
        {
            //Adjust the stats of the fighters for endurance/cuts/tactics
            this.Fighter1.MakeAdjustments(this.Fighter2, this.Options);
            this.Fighter2.MakeAdjustments(this.Fighter1, this.Options);

            //run the base calculations for damage
            round.Fighter1Round = Fighter1.BeginFighting(this.Fighter2, round);
            round.Fighter2Round = Fighter2.BeginFighting(this.Fighter1, round);
            round.Fighter1Round.MultiplyDamageLuckFactor(Fighter1.RoundStats.LuckFactor);
            round.Fighter2Round.MultiplyDamageLuckFactor(Fighter2.RoundStats.LuckFactor);

            //Adjust damage if one of the fighters is stunned
            if (round.Fighter1Round.DamageDealt.StunValue > 1.5 && round.Fighter1Round.DamageDealt.StunValue > round.Fighter2Round.DamageDealt.StunValue)
            {
                Fighter2.RoundStats.LuckFactor *= 0.75;
                round.Fighter2Round.MultiplyDamageLuckFactor(0.75);
            }
            else if (round.Fighter2Round.DamageDealt.StunValue > 1.5 && round.Fighter2Round.DamageDealt.StunValue > round.Fighter1Round.DamageDealt.StunValue)
            {
                Fighter1.RoundStats.LuckFactor *= 0.75;
                round.Fighter1Round.MultiplyDamageLuckFactor(0.75);
            }

            round.Fighter1Round.DamageReceived = round.Fighter2Round.DamageDealt;
            round.Fighter2Round.DamageReceived = round.Fighter1Round.DamageDealt;
            round.Fighter1Round.SetCuts(Fighter1, round.Fighter2Round);
            round.Fighter2Round.SetCuts(Fighter2, round.Fighter1Round);
            round.Fighter1Round.SetPunches(Fighter1.RoundStats);
            round.Fighter2Round.SetPunches(Fighter2.RoundStats);

            Fighter1.TotalBaseDamage += round.Fighter1Round.DamageReceived.BaseDamage;
            Fighter2.TotalBaseDamage += round.Fighter2Round.DamageReceived.BaseDamage;

            Fighter1.FatigueRound(round.Fighter2Round.DamageDealt.EnduranceDamage);
            round.Fighter1Round.FatigueStartRound = Fighter1.FatigueLossStartRound;
            round.Fighter1Round.FatigueEndRound   = Fighter1.GetEndOfRoundFatigue();

            Fighter2.FatigueRound(round.Fighter1Round.DamageDealt.EnduranceDamage);
            round.Fighter2Round.FatigueStartRound = Fighter2.FatigueLossStartRound;
            round.Fighter2Round.FatigueEndRound   = Fighter2.GetEndOfRoundFatigue();

            round.Fighter1Round.IsTKOedByEndurance = Fighter1.EndurancePercent < 0;
            round.Fighter2Round.IsTKOedByEndurance = Fighter2.EndurancePercent < 0;

            round.Fighter1Round.Cuts = Fighter1.Cuts.Copy();
            round.Fighter2Round.Cuts = Fighter2.Cuts.Copy();

            round.Fighter1Round.EndEndurancePercent = Fighter1.EndurancePercent;
            round.Fighter2Round.EndEndurancePercent = Fighter2.EndurancePercent;
            round.Fighter1Round.EndEndurance        = Fighter1.EndurancePoints;
            round.Fighter2Round.EndEndurance        = Fighter2.EndurancePoints;

            round.Fighter1TotalScore = this.Fight.Fighter1Score;
            round.Fighter2TotalScore = this.Fight.Fighter2Score;
        }
Beispiel #2
0
 public void Reset()
 {
     if (th1 != null || th2 != null)
     {
         if (th1.IsAlive || th2.IsAlive)
         {
             th1.Abort();
             th2.Abort();
             ThreadIsStarted = false;
         }
     }
     Fighter1.Reset();
     Fighter2.Reset();
 }
Beispiel #3
0
        public override void Fight()
        {
            if (Fighter1.GetType() == typeof(Matador))
            {
                if (Fighter1.Weapons.Count == 0)
                {
                    Fighter1.Damage *= LavaDamageMultiplier;
                    Console.WriteLine($"The lava area multiplies the fist attack of {Fighter1.Name} by {LavaDamageMultiplier}");
                    Thread.Sleep(2000);
                }
                else
                {
                    foreach (var weapon in Fighter1.Weapons)
                    {
                        weapon.Level = MatadorLavaWeaponIncreaser;
                    }
                    Console.WriteLine($"The lava area increases the level of {Fighter1.Name}'s weapons by {MatadorLavaWeaponIncreaser}");
                    Thread.Sleep(2000);
                }
            }

            if (Fighter2.GetType() == typeof(Matador))
            {
                if (Fighter2.Weapons.Count == 0)
                {
                    Fighter1.Damage *= LavaDamageMultiplier;
                    Console.WriteLine($"The lava area multiplies the fist attack of {Fighter2.Name} by {LavaDamageMultiplier}");
                    Thread.Sleep(2000);
                }
                else
                {
                    foreach (var weapon in Fighter2.Weapons)
                    {
                        weapon.Level = MatadorLavaWeaponIncreaser;
                    }
                    Console.WriteLine($"The lava area increases the level of {Fighter2.Name}'s weapons by {MatadorLavaWeaponIncreaser}");
                    Thread.Sleep(2000);
                }
            }

            Console.WriteLine();

            base.Fight();
        }
Beispiel #4
0
        public void UpdatePushCharacterVsCharacter()
        {
            Rect rect1 = Fighter1.Pushbox.Rect;
            Rect rect2 = Fighter2.Pushbox.Rect;

            if (!rect1.Overlaps(rect2))
            {
                return;
            }

            if (Fighter1.Position.x < Fighter2.Position.x)
            {
                Fighter1.ApplyPositionChange((rect1.xMax - rect2.xMin) * -1 / 2, Fighter1.Position.y);
                Fighter2.ApplyPositionChange((rect1.xMax - rect2.xMin) * 1 / 2, Fighter2.Position.y);
            }
            else if (Fighter1.Position.x > Fighter2.Position.x)
            {
                Fighter1.ApplyPositionChange((rect2.xMax - rect1.xMin) * 1 / 2, Fighter1.Position.y);
                Fighter2.ApplyPositionChange((rect2.xMax - rect1.xMin) * -1 / 2, Fighter1.Position.y);
            }
        }
Beispiel #5
0
 private bool playersIsNotDead()
 {
     return(!(Fighter1.isDead() || Fighter2.isDead()));
 }