Exemple #1
0
        public void CheckFighterWarning(FighterFight fighter)
        {
            WarningResult res = CheckWarning(fighter);

            this.IsWarned       = res.IsWarned;
            this.IsDisqualified = res.IsDisqualified;
        }
        public void FightAll()
        {
            this.Results = new PivotFightResultSet[PivotGroup1.Count, PivotGroup2.Count];
            int total     = PivotGroup1.Count * PivotGroup2.Count;
            int processed = 0;

            for (int i = 0; i < PivotGroup1.Count; i++)
            {
                PivotFighter pf1 = PivotGroup1[i];
                FighterFight ff1 = new FighterFight(pf1.GetStats(), pf1.FightPlan);

                for (int j = 0; j < PivotGroup2.Count; j++)
                {
                    PivotFighter pf2 = PivotGroup2[j];
                    FighterFight ff2 = new Model.FighterFight(pf2.GetStats(), pf2.FightPlan);
                    this.Results[i, j] = new PivotFightResultSet(FightTracker.PlayMultiple_ResultSet(this.NumberOfSimsEach, ff1, ff2, this.Options));
                    processed++;
                    Debug.Print(String.Format("Pivot sim: {0} of {1}", processed, total));
                }
            }
            SetBestWorstInRowColumn();
        }
Exemple #3
0
        public FighterRound BeginFighting(FighterFight other, Round round)
        {
            FighterRound ret = new FighterRound(round);

            ret.Tactics               = FighterRoundPlan.Adjusted(this.RoundStats.Plan, this.RoundStats.AdjustedTactics);
            ret.StartEndurance        = this.EndurancePoints;
            ret.StartEndurancePercent = this.EndurancePercent;
            ret.CheckFighterWarning(this);
            this.RoundStats.AdjustDirty(ret.IsWarned);
            if (ret.IsWarned)
            {
                this.Warnings++;
                if (this.Warnings > 1)
                {
                    ret.DeductPointWarning = true;
                }
            }
            ret.DamageDealt = RoundDamage.CalculateRoundDamage(this.RoundStats.AdjustedStats, this.RoundStats.AdjustedTactics,
                                                               other.RoundStats.AdjustedStats, other.RoundStats.AdjustedTactics, this.RoundStats.Plan.TargetArea, this.RoundStats.DamageAdjustment);
            this.RoundStats.SetPunchAccuracy(other.RoundStats);
            return(ret);
        }
Exemple #4
0
        public void MakeAdjustments(FighterFight other, FightOptions options)
        {
            FightingStyle style = this.RoundStats.Plan.Style;

            this.RoundStats.AdjustStyle(style, other.RoundStats);
            this.RoundStats.AdjustHeight(other.RoundStats);
            AdjustFatigueEndurancePreRound();
            this.RoundStats.AdjustCuts(this.Cuts);
            this.RoundStats.AdjustEndurance(this.EndurancePoints);

            if (options.LuckAmount > 0)
            {
                this.RoundStats.SetLuckFactor(options.LuckAmount);
            }
            else
            {
                this.RoundStats.LuckFactor = 1;
            }

            this.RoundStats.FixAdjustments();
            this.RoundStats.SetCutPercent(other.RoundStats);
        }
Exemple #5
0
        public void SetCuts(FighterFight fighter, FighterRound otherRound)
        {
            double cP1        = otherRound.DamageDealt.BaseDamage * otherRound.DamageDealt.BaseDamage / 1000;
            double cutPercent = fighter.RoundStats.CutPercent * cP1;

            cutPercent *= Resources.CutPercentMultiplier;
            if (cutPercent > 0.5)
            {
                cutPercent = 0.5;
            }
            double cutAggPercent = fighter.RoundStats.CutAggravatePercent * cP1;

            cutAggPercent *= Resources.CutPercentMultiplier;
            if (cutAggPercent > 0.5)
            {
                cutAggPercent = 0.5;
            }

            SetCuts(fighter.Cuts, cutPercent, cutAggPercent);
            otherRound.DamageDealt.EnduranceDamage += fighter.Cuts.DamageForRound();
            otherRound.DamageDealt.CutDamage        = fighter.Cuts.DamageForRound();
        }
        public static FightRoundVariables GetVariables(int round, int score, FighterFight fighter, FighterFight other)
        {
            FightRoundVariables ret = new FightRoundVariables()
            {
                Round            = round,
                Score            = score,
                EndurancePercent = fighter.EndurancePercent,
                MyStuns          = fighter.Stuns,
                MyKnockdowns     = fighter.Knockdowns,
                MyCuts           = fighter.Cuts.Sum(s => (int)s.Level),
                HisCuts          = other.Cuts.Sum(s => (int)s.Level),
                HisStuns         = other.Stuns,
                HisKnockdowns    = other.Knockdowns,
                RoundsWon        = fighter.RoundsWon,
                RoundsLost       = other.RoundsWon,
                Endurance        = Convert.ToInt32(fighter.EndurancePoints),
                Warnings         = fighter.Warnings,
                CanTowel         = fighter.CanTowel()
            };

            double otherEndurancePre = (round == 1 || other.EndurancePreRecover == 0) ? other.EndurancePoints : other.EndurancePreRecover;
            double otherEndurance    = otherEndurancePre / (other.RoundStats.AdjustedStats.Conditioning * 10);

            if (otherEndurance < 1d / 3)
            {
                ret.Opponent = OpponentStrength.Exhausted;
            }
            else if (otherEndurance <= 2d / 3)
            {
                ret.Opponent = OpponentStrength.Tired;
            }
            else
            {
                ret.Opponent = OpponentStrength.Strong;
            };
            return(ret);
        }
Exemple #7
0
 public FightTracker(FighterFight fighter1, FighterFight fighter2, FightOptions options)
 {
     this.Fighter1 = fighter1;
     this.Fighter2 = fighter2;
     this.Options  = options;
 }
Exemple #8
0
        public static FightResultSet PlayMultiple_ResultSet(int numberOfTimes, FighterFight f1, FighterFight f2, FightOptions options)
        {
            List <Fight> fights = PlayMultiple(numberOfTimes, f1.Fighter, f2.Fighter, f1.FightPlan, f2.FightPlan, options);

            return(new FightResultSet(fights.Select(f => f.Result)));
        }
Exemple #9
0
        public static WarningResult CheckWarning(FighterFight fight)
        {
            WarningResult ret = CheckWarning(fight.RoundStats.Plan.Dirty, fight.Warnings, fight.RoundStats.Plan.Style, fight.RoundStats.Plan.Defense);

            return(ret);
        }