Exemplo n.º 1
0
 public FighterRoundStats(FighterStats stats, FighterRoundPlan plan)
 {
     this.OriginalStats   = stats;
     this.AdjustedStats   = stats.Copy();
     this.Plan            = plan;
     this.AdjustedTactics = plan.Copy();
     this.LuckFactor      = 1;
 }
Exemplo n.º 2
0
        public void SetStartRoundStatsAndGetPlan(FightRoundVariables variables)
        {
            this.RoundStats.AdjustedStats             = this.RoundStats.OriginalStats.Copy();
            this.RoundStats.LuckFactor                = 1;
            this.RoundStats.DamageAdjustment          = 1;
            this.RoundStats.AdditionalFatigue         = FatigueLossPerRound;
            this.RoundStats.AdditionalEnduranceDamage = 0;
            // this.RoundStats.StunDefense = this.RoundStats.OriginalStats.Chin + this.RoundStats.OriginalStats.Agility - 10;
            FighterRoundPlan plan = this.FightPlan.GetPlan(variables);

            this.PlanLineHits.Add(plan.HitLineNumber);
            this.RoundStats.Plan            = plan;
            this.RoundStats.AdjustedTactics = plan.Copy();
        }
Exemplo n.º 3
0
        private FighterRoundPlan EvaluatePlan(FightRoundVariables frv)
        {
            if (WeblScript == null)
            {
                WeblScript = new WeblScript();
            }
            ScriptVariables  variables = frv.ToScriptVariables();
            ParseResult      res       = WeblScript.ParseAndEvaluate(this.FightPlanText, variables);
            FighterRoundPlan roundPlan = FighterRoundPlan.Parse(res.Text);

            if (res.Cheat)
            {
                roundPlan.Dirty = true;
            }
            roundPlan.HitLineNumber = res.LineNumber;
            return(roundPlan);
        }
Exemplo n.º 4
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);
        }