Ejemplo n.º 1
0
        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);
        }