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); }
public void AddDamage(RoundDamage other) { this.StunDamage += other.StunDamage; this.EnduranceDamage += other.EnduranceDamage; this.BaseDamage += other.BaseDamage; this.StunValue += other.StunValue; this.CutDamage += other.CutDamage; }
public static RoundDamage Sum(IEnumerable <RoundDamage> items) { RoundDamage ret = new RoundDamage(); foreach (RoundDamage item in items) { ret.AddDamage(item); } return(ret); }
public static void AdjustForStun(RoundDamage first, RoundDamage second) { if (first.StunValue > DAMAGE_FOR_STUN && first.StunValue > second.StunValue) { second.MultiplyDamage(STUN_MULTIPLIER); } else if (second.StunValue > DAMAGE_FOR_STUN) { first.MultiplyDamage(STUN_MULTIPLIER); } }
public static RoundDamage Diff(RoundDamage first, RoundDamage second) { RoundDamage ret = new Model.RoundDamage() { BaseDamage = first.BaseDamage - second.BaseDamage, CutDamage = first.CutDamage - second.CutDamage, EnduranceDamage = first.EnduranceDamage - second.EnduranceDamage, StunDamage = first.StunDamage - second.StunDamage, StunValue = first.StunValue - second.StunValue }; return(ret); }
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); }
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); }
public FighterRoundCompare(FighterRound round, RoundDamage computed) { this.FighterRound = round; this.Computed = computed; this.Diff = RoundDamage.Diff(Computed, round.DamageReceived); }