Beispiel #1
0
        public static bool CheckDqed(int warnings)
        {
            double dQPercent = DqPercent(warnings);
            bool   dQed      = RandomGen.CheckRandom(dQPercent);

            return(dQed);
        }
Beispiel #2
0
        public static WarningResult CheckWarning(bool dirty, int warnings, FightingStyle style, double defense)
        {
            WarningResult ret = new WarningResult();

            if (dirty)
            {
                bool warned = RandomGen.CheckRandom(Resources.Dirty_Warning_Percent);

                if (warned)
                {
                    ret.IsWarned       = true;
                    ret.IsDisqualified = CheckDqed(warnings);
                }
            }
            else
            {
                ret.IsWarned = ret.IsWarned || RandomGen.CheckRandom(Resources.Warning_NoDirty);
            }
            if (style == FightingStyle.Clinch && defense > Resources.Clinch_MaxDefense_NoWarning)
            {
                double percent = defense - Resources.Clinch_MaxDefense_NoWarning;
                percent = Math.Pow(percent, 2) / 100;
                bool warned = RandomGen.CheckRandom(percent);
                if (warned)
                {
                    ret.IsWarned       = true;
                    ret.IsDisqualified = ret.IsDisqualified || CheckDqed(warnings);
                }
            }
            return(ret);
        }
Beispiel #3
0
        public static Cut RandomCut()
        {
            double r = RandomGen.RANDOM_GEN.NextDouble();

            CutType cType = CutType.SwellRight;

            if (r < 0.1)
            {
                cType = CutType.BleedAboveLeft;
            }
            else if (r < 0.2)
            {
                cType = CutType.BleedAboveRight;
            }
            else if (r < 0.3)
            {
                cType = CutType.BleedBelowLeft;
            }
            else if (r < 0.4)
            {
                cType = CutType.BleedBelowRight;
            }
            else if (r < 0.5)
            {
                cType = CutType.InjuredJaw;
            }
            else if (r < 0.6)
            {
                cType = CutType.InjuredNose;
            }
            else if (r < 0.8)
            {
                cType = CutType.SwellLeft;
            }
            CutSeverity severity = CutSeverity.Low;

            if (cType != CutType.SwellLeft && cType != CutType.SwellRight)
            {
                if (RandomGen.CheckRandom(2d / 3))
                {
                    severity = CutSeverity.Low;
                }
                else if (RandomGen.CheckRandom(2d / 3))
                {
                    severity = CutSeverity.Medium;
                }
                else if (RandomGen.CheckRandom(2d / 3))
                {
                    severity = CutSeverity.High;
                }
                else
                {
                    severity = CutSeverity.Critical;
                }
            }
            return(new Cut(cType, severity));
        }
Beispiel #4
0
        public void Aggravate()
        {
            TotalAgg++;
            if (IsBleeding || (this.Type == CutType.InjuredNose && (int)this.Level >= 2))
            {
                RoundDamage += (int)this.Level;
                TotalDamage += (int)this.Level;
                if (CheckTotalDamage())
                {
                    return;
                }
            }

            //     if (this.Level == CutSeverity.Critical) return;
            bool promote = IsSwelling || RandomGen.CheckRandom(0.5);

            if (promote)
            {
                if (IsSwelling)
                {
                    if (this.Level != CutSeverity.Critical)
                    {
                        this.Level++;
                    }
                    else
                    {
                        this.AggravatedTimes++;
                    }
                }
                else
                {
                    this.Level = PromoteNonSwell(this.Level);
                }

                if (IsBleeding || (this.Type == CutType.InjuredNose))
                {
                    RoundDamage += (int)this.Level;
                    TotalDamage += (int)this.Level;
                    CheckTotalDamage();
                }
                if (this.Type == CutType.InjuredJaw && this.Level == CutSeverity.Critical)
                {
                    this.RoundDamage += 10;
                    this.TotalDamage += 10;
                }
            }
        }
Beispiel #5
0
 private void SetCuts(CutList cutList, double cutPercent, double aggPercent)
 {
     cutList.ResetRound();
     foreach (Cut c in cutList)
     {
         if (RandomGen.CheckRandom(aggPercent))
         {
             c.Aggravate();
         }
     }
     while (RandomGen.CheckRandom(cutPercent))
     {
         Cut cut = Cut.RandomCut();
         cutList.AddCut(cut);
     }
     if (cutList.Any(c => c.CausedTko) || cutList.CantSee())
     {
         this.IsTKOedByCut = true;
     }
 }
Beispiel #6
0
        public static CutSeverity PromoteNonSwell(CutSeverity start)
        {
            if (start == CutSeverity.High || start == CutSeverity.Critical)
            {
                return(CutSeverity.Critical);
            }
            if (start == CutSeverity.Medium)
            {
                bool isCritical = RandomGen.CheckRandom(1d / 3);
                return((isCritical) ? CutSeverity.Critical : CutSeverity.High);
            }

            if (RandomGen.CheckRandom(2d / 3))
            {
                return(CutSeverity.Medium);
            }
            else if (RandomGen.CheckRandom(2d / 3))
            {
                return(CutSeverity.High);
            }
            return(CutSeverity.Critical);
        }