コード例 #1
0
ファイル: PivotFighter.cs プロジェクト: DougOz/WeBLSimulator
 public PivotFighter(FighterStats stats, FightPlan fightPlan, string name, TrainingStat trainingStat)
 {
     this.Stats           = stats;
     this.FightPlan       = fightPlan;
     this.Name            = name;
     this.StatAdjustments = GetStatAdjustment(trainingStat);
 }
コード例 #2
0
ファイル: PivotFighter.cs プロジェクト: DougOz/WeBLSimulator
        public static FighterStats GetStatAdjustment(TrainingStat stat)

        {
            FighterStats ret = new FighterStats(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

            switch (stat)
            {
            case TrainingStat.Agility:
                ret.Agility = 1;
                break;

            case TrainingStat.Chin:
                ret.Chin = 1;
                break;

            case TrainingStat.Conditioning:
                ret.Conditioning = 1;
                break;

            case TrainingStat.Speed:
                ret.Speed = 1;
                break;

            case TrainingStat.Strength:
                ret.Strength = 1;
                break;

            case TrainingStat.KOPunch:
                ret.KnockoutPunch = 1;
                break;
            }
            return(ret);
        }
コード例 #3
0
        public List <FighterRoundCompare> CompareDamageToCalculated()
        {
            FighterStats stats1 = Fight.Fighter1.AdjustAll(Fighter1Round.StartEndurance, Fighter1Round.Cuts_StartRound, Resources.FatigueBeforeCut);
            FighterStats stats2 = Fight.Fighter2.AdjustAll(Fighter2Round.StartEndurance, Fighter2Round.Cuts_StartRound, Resources.FatigueBeforeCut);
            RoundDamage  d1     = RoundDamage.CalculateRoundDamage(stats1,
                                                                   Fighter1Round.Tactics,
                                                                   stats2,
                                                                   Fighter2Round.Tactics,
                                                                   Fighter1Round.Tactics.TargetArea);

            RoundDamage d2 = RoundDamage.CalculateRoundDamage(stats2,
                                                              Fighter2Round.Tactics,
                                                              stats1,
                                                              Fighter1Round.Tactics,
                                                              Fighter2Round.Tactics.TargetArea);

            RoundDamage.AdjustForStun(d1, d2);
            List <FighterRoundCompare> ret = new List <Model.FighterRoundCompare>()
            {
                new Model.FighterRoundCompare(Fighter1Round, d2),
                new Model.FighterRoundCompare(Fighter2Round, d1)
            };

            return(ret);
        }
コード例 #4
0
 public FighterRoundStats(FighterStats stats, FighterRoundPlan plan)
 {
     this.OriginalStats   = stats;
     this.AdjustedStats   = stats.Copy();
     this.Plan            = plan;
     this.AdjustedTactics = plan.Copy();
     this.LuckFactor      = 1;
 }
コード例 #5
0
        public static double GetBaseDamage(FighterStats stats, FighterTactics tactics, FighterStats oppStats, FighterTactics oppTactics)
        {
            double ret = tactics.Power * stats.Strength *
                         Math.Sqrt(stats.Speed * tactics.Aggressiveness) /
                         (oppTactics.Defense * oppStats.Agility);

            return(ret);
        }
コード例 #6
0
ファイル: FighterFight.cs プロジェクト: DougOz/WeBLSimulator
 public FighterFight(FighterStats stats, FightPlan fp)
 {
     this.Fighter = new Fighter()
     {
         Stats = stats
     };
     this.FightPlan = fp;
     Reset();
 }
コード例 #7
0
ファイル: PivotFighter.cs プロジェクト: DougOz/WeBLSimulator
        public FighterStats GetStats()
        {
            FighterStats ret = Stats.Copy();

            if (StatAdjustments != null)
            {
                ret.Agility       += StatAdjustments.Agility;
                ret.Chin          += StatAdjustments.Chin;
                ret.Conditioning  += StatAdjustments.Conditioning;
                ret.Height        += StatAdjustments.Height;
                ret.Speed         += StatAdjustments.Speed;
                ret.Strength      += StatAdjustments.Strength;
                ret.KnockoutPunch += StatAdjustments.KnockoutPunch;
            }
            return(ret);
        }
コード例 #8
0
        public static double  GetStunDamage(FighterStats stats, FighterTactics tactics, FighterStats oppStats, FighterTactics oppTactics, TargetArea targetArea)
        {
            double ret = (stats.Strength + (stats.KnockoutPunch * 3)) *
                         tactics.Power * Math.Sqrt(stats.Speed * tactics.Aggressiveness) /
                         (oppTactics.Defense * oppStats.StunDefense);

            if (targetArea == TargetArea.Body)
            {
                ret *= 0.8;
            }
            else if (targetArea == TargetArea.Head)
            {
                ret *= 1.2;
            }
            else if (targetArea == TargetArea.Cut)
            {
                ret *= 0.9;
            }
            return(ret);
        }
コード例 #9
0
        public static RoundDamage CalculateRoundDamage(FighterStats stats, FighterTactics tactics, FighterStats oppStats, FighterTactics oppTactics, TargetArea targetArea, double multiplier = 1)
        {
            RoundDamage ret = new RoundDamage();

            ret.BaseDamage      = GetBaseDamage(stats, tactics, oppStats, oppTactics);
            ret.BaseDamage     *= multiplier;
            ret.EnduranceDamage = ret.BaseDamage;
            if (targetArea == TargetArea.Body)
            {
                ret.EnduranceDamage *= 1.2;
            }
            else if (targetArea == TargetArea.Head)
            {
                ret.EnduranceDamage *= 0.8;
            }
            else if (targetArea == TargetArea.Cut)
            {
                ret.EnduranceDamage *= 0.9;
            }
            ret.StunDamage  = GetStunDamage(stats, tactics, oppStats, oppTactics, targetArea);
            ret.StunDamage *= multiplier;
            ret.StunValue   = ret.StunDamage / oppStats.Chin;
            return(ret);
        }
コード例 #10
0
 public void AdjustEndurance(double endurancePoints)
 {
     this.AdjustedStats = FighterStats.FatigueStats(this.AdjustedStats, endurancePoints);
 }