private void CalculateDPS() { foreach (Player player in _log.PlayerList) { FinalDPS[] phaseDps = new FinalDPS[_statistics.Phases.Count]; for (int phaseIndex = 0; phaseIndex < _statistics.Phases.Count; phaseIndex++) { phaseDps[phaseIndex] = GetFinalDPS(player, phaseIndex, null); } _statistics.DpsAll[player] = phaseDps; } foreach (Target target in _log.FightData.Logic.Targets) { Dictionary <Player, FinalDPS[]> stats = new Dictionary <Player, FinalDPS[]>(); foreach (Player player in _log.PlayerList) { FinalDPS[] phaseDpsTarget = new FinalDPS[_statistics.Phases.Count]; for (int phaseIndex = 0; phaseIndex < _statistics.Phases.Count; phaseIndex++) { phaseDpsTarget[phaseIndex] = GetFinalDPS(player, phaseIndex, target); } stats[player] = phaseDpsTarget; } _statistics.DpsTarget[target] = stats; FinalDPS[] phaseTargetDps = new FinalDPS[_statistics.Phases.Count]; for (int phaseIndex = 0; phaseIndex < _statistics.Phases.Count; phaseIndex++) { phaseTargetDps[phaseIndex] = GetFinalDPS(target, phaseIndex, null); } _statistics.TargetDps[target] = phaseTargetDps; } }
public static List <List <object> > BuildDPSData(ParsedEvtcLog log, PhaseData phase) { var list = new List <List <object> >(log.Friendlies.Count); foreach (AbstractSingleActor actor in log.Friendlies) { FinalDPS dpsAll = actor.GetDPSStats(log, phase.Start, phase.End); list.Add(GetDPSStatData(dpsAll)); } return(list); }
public static List <List <object> > BuildDPSData(ParsedEvtcLog log, PhaseData phase) { var list = new List <List <object> >(log.PlayerList.Count); foreach (Player player in log.PlayerList) { FinalDPS dpsAll = player.GetDPSStats(log, phase.Start, phase.End); list.Add(GetDPSStatData(dpsAll)); } return(list); }
public static List <object> GetDPSStatData(FinalDPS dpsAll) { var data = new List <object> { dpsAll.Damage, dpsAll.PowerDamage, dpsAll.CondiDamage, }; return(data); }
public static List <List <object> > BuildDPSData(ParsedLog log, int phaseIndex) { var list = new List <List <object> >(log.PlayerList.Count); foreach (Player player in log.PlayerList) { FinalDPS dpsAll = player.GetDPSAll(log, phaseIndex); list.Add(PhaseDto.GetDPSStatData(dpsAll)); } return(list); }
private void CreateDPSTable(int phaseIndex) { PhaseData phase = _phases[phaseIndex]; WriteLine(new[] { "Sub Group", "Profession", "Role", "Name", "Account", "WepSet1_1", "WepSet1_2", "WepSet2_1", "WepSet2_2", "Boss DPS", "Boss DMG", "Boss Power DPS", "Boss Power DMG", "Boss Condi DPS", "Boss Condi DMG", "All DPS", "All DMG", "All Power DPS", "All Power DMG", "All Condi DPS", "All Condi DMG", "Times Downed", "Time Died", "Percent Alive" }); int count = 0; foreach (Player player in _log.PlayerList) { FinalDPS dps = player.GetDPSAll(_log, phaseIndex); FinalDefensesAll defense = player.GetDefenses(_log, phaseIndex); FinalDPS dpsBoss = player.GetDPSTarget(_log, phaseIndex, _legacyTarget); string deathString = defense.DeadCount.ToString(); string deadthTooltip = ""; if (defense.DeadCount > 0) { var deathDuration = TimeSpan.FromMilliseconds(defense.DeadDuration); deadthTooltip = deathDuration.TotalSeconds + " seconds dead, " + (100.0 - Math.Round((deathDuration.TotalMilliseconds / phase.DurationInMS) * 100, 1)) + "% Alive"; } string[] wep = player.GetWeaponsArray(_log); string build = ""; if (player.Condition > 0) { build += " Condi:" + player.Condition; } if (player.Concentration > 0) { build += " Concentration:" + player.Concentration; } if (player.Healing > 0) { build += " Healing:" + player.Healing; } if (player.Toughness > 0) { build += " Toughness:" + player.Toughness; } WriteLine(new[] { player.Group.ToString(), player.Prof, build, player.Character, player.Account, wep[0], wep[1], wep[2], wep[3], dpsBoss.Dps.ToString(), dpsBoss.Damage.ToString(), dpsBoss.PowerDps.ToString(), dpsBoss.PowerDamage.ToString(), dpsBoss.CondiDps.ToString(), dpsBoss.CondiDamage.ToString(), dps.Dps.ToString(), dps.Damage.ToString(), dps.PowerDps.ToString(), dps.PowerDamage.ToString(), dps.CondiDps.ToString(), dps.CondiDamage.ToString(), defense.DownCount.ToString(), deathString, deadthTooltip }); count++; } while (count < 15)//so each graph has equal spacing { NewLine(); count++; } }
private static DmgDistributionDto BuildDMGDistDataInternal(ParsedLog log, FinalDPS dps, AbstractSingleActor p, NPC target, int phaseIndex, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new DmgDistributionDto(); PhaseData phase = log.FightData.GetPhases(log)[phaseIndex]; List <AbstractCastEvent> casting = p.GetCastLogs(log, phase.Start, phase.End); List <AbstractDamageEvent> damageLogs = p.GetJustPlayerDamageLogs(target, log, phase); dto.TotalDamage = dps.Damage; dto.ContributedDamage = damageLogs.Count > 0 ? damageLogs.Sum(x => x.Damage) : 0; dto.ContributedShieldDamage = damageLogs.Count > 0 ? damageLogs.Sum(x => x.ShieldDamage) : 0; dto.Distribution = BuildDMGDistBodyData(log, casting, damageLogs, usedSkills, usedBuffs); return(dto); }
public JsonDPS(FinalDPS stats) { Dps = stats.Dps; Damage = stats.Damage; CondiDps = stats.CondiDps; CondiDamage = stats.CondiDamage; PowerDps = stats.PowerDps; PowerDamage = stats.PowerDamage; ActorDps = stats.ActorDps; ActorDamage = stats.ActorDamage; ActorCondiDps = stats.ActorCondiDps; ActorCondiDamage = stats.ActorCondiDamage; ActorPowerDps = stats.ActorPowerDps; ActorPowerDamage = stats.ActorPowerDamage; }
public int GetTotalDamage(Player p, ParsedLog log, Target t, int phaseIndex) { FinalDPS damageData = p.GetDPSTarget(log, phaseIndex, t); switch (_compareType) { case DamageType.All: return(_dmgSrc == DamageSource.All ? damageData.Damage : damageData.ActorDamage); case DamageType.Condition: return(_dmgSrc == DamageSource.All ? damageData.CondiDamage : damageData.ActorCondiDamage); case DamageType.Power: return(_dmgSrc == DamageSource.All ? damageData.PowerDamage : damageData.ActorPowerDamage); } return(0); }
internal JsonDPS(FinalDPS stats) { Dps = stats.Dps; Damage = stats.Damage; CondiDps = stats.CondiDps; CondiDamage = stats.CondiDamage; PowerDps = stats.PowerDps; PowerDamage = stats.PowerDamage; BreakbarDamage = stats.BreakbarDamage; ActorDps = stats.ActorDps; ActorDamage = stats.ActorDamage; ActorCondiDps = stats.ActorCondiDps; ActorCondiDamage = stats.ActorCondiDamage; ActorPowerDps = stats.ActorPowerDps; ActorPowerDamage = stats.ActorPowerDamage; ActorBreakbarDamage = stats.ActorBreakbarDamage; }
private FinalDPS GetFinalDPS(AbstractPlayer player, int phaseIndex, Boss target) { PhaseData phase = _statistics.Phases[phaseIndex]; double phaseDuration = (phase.GetDuration()) / 1000.0; double damage; double dps = 0.0; FinalDPS final = new FinalDPS(); //DPS damage = player.GetDamageLogs(target, _log, phase.Start, phase.End).Sum(x => x.Damage); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.Dps = (int)dps; final.Damage = (int)damage; //Condi DPS damage = player.GetDamageLogs(target, _log, phase.Start, phase.End).Where(x => x.IsCondi > 0).Sum(x => x.Damage); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.CondiDps = (int)dps; final.CondiDamage = (int)damage; //Power DPS damage = final.Damage - final.CondiDamage; if (phaseDuration > 0) { dps = damage / phaseDuration; } final.PowerDps = (int)dps; final.PowerDamage = (int)damage; final.PlayerPowerDamage = player.GetJustPlayerDamageLogs(target, _log, phase.Start, phase.End).Where(x => x.IsCondi == 0).Sum(x => x.Damage); return(final); }
public static JsonDPS BuildJsonDPS(FinalDPS stats) { var jsonDPS = new JsonDPS(); jsonDPS.Dps = stats.Dps; jsonDPS.Damage = stats.Damage; jsonDPS.CondiDps = stats.CondiDps; jsonDPS.CondiDamage = stats.CondiDamage; jsonDPS.PowerDps = stats.PowerDps; jsonDPS.PowerDamage = stats.PowerDamage; jsonDPS.BreakbarDamage = stats.BreakbarDamage; jsonDPS.ActorDps = stats.ActorDps; jsonDPS.ActorDamage = stats.ActorDamage; jsonDPS.ActorCondiDps = stats.ActorCondiDps; jsonDPS.ActorCondiDamage = stats.ActorCondiDamage; jsonDPS.ActorPowerDps = stats.ActorPowerDps; jsonDPS.ActorPowerDamage = stats.ActorPowerDamage; jsonDPS.ActorBreakbarDamage = stats.ActorBreakbarDamage; return(jsonDPS); }
private FinalDPS GetFinalDPS(AbstractActor player, int phaseIndex, Target target) { PhaseData phase = _statistics.Phases[phaseIndex]; double phaseDuration = (phase.GetDuration()) / 1000.0; int damage; double dps = 0.0; FinalDPS final = new FinalDPS(); //DPS damage = player.GetDamageLogs(target, _log, phase.Start, phase.End).Sum(x => x.Damage); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.Dps = (int)Math.Round(dps); final.Damage = damage; //Condi DPS damage = player.GetDamageLogs(target, _log, phase.Start, phase.End).Sum(x => x.IsCondi ? x.Damage : 0); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.CondiDps = (int)Math.Round(dps); final.CondiDamage = damage; //Power DPS damage = final.Damage - final.CondiDamage; if (phaseDuration > 0) { dps = damage / phaseDuration; } final.PowerDps = (int)Math.Round(dps); final.PowerDamage = damage; return(final); }
public static JsonDPS BuildJsonDPS(FinalDPS stats) { var jsonDPS = new JsonDPS { Dps = stats.Dps, Damage = stats.Damage, CondiDps = stats.CondiDps, CondiDamage = stats.CondiDamage, PowerDps = stats.PowerDps, PowerDamage = stats.PowerDamage, BreakbarDamage = stats.BreakbarDamage, ActorDps = stats.ActorDps, ActorDamage = stats.ActorDamage, ActorCondiDps = stats.ActorCondiDps, ActorCondiDamage = stats.ActorCondiDamage, ActorPowerDps = stats.ActorPowerDps, ActorPowerDamage = stats.ActorPowerDamage, ActorBreakbarDamage = stats.ActorBreakbarDamage }; return(jsonDPS); }
public static DmgDistributionDto BuildTargetDMGDistData(ParsedEvtcLog log, NPC npc, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = npc.GetDPSStats(log, phase.Start, phase.End); return(BuildDMGDistDataInternal(log, dps, npc, null, phase, usedSkills, usedBuffs)); }
internal static DmgDistributionDto BuildPlayerMinionDMGDistData(ParsedEvtcLog log, Player p, Minions minions, NPC target, int phaseIndex, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = p.GetDPSTarget(log, phaseIndex, target); return(BuildDMGDistDataMinionsInternal(log, dps, minions, target, phaseIndex, usedSkills, usedBuffs)); }
internal static DmgDistributionDto BuildTargetMinionDMGDistData(ParsedEvtcLog log, NPC target, Minions minions, int phaseIndex, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = target.GetDPSAll(log, phaseIndex); return(BuildDMGDistDataMinionsInternal(log, dps, minions, null, phaseIndex, usedSkills, usedBuffs)); }
public static DmgDistributionDto BuildTargetMinionDMGDistData(ParsedEvtcLog log, AbstractSingleActor target, Minions minions, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = target.GetDPSStats(log, phase.Start, phase.End); return(BuildDMGDistDataMinionsInternal(log, dps, minions, null, phase, usedSkills, usedBuffs)); }
private static DmgDistributionDto BuildDMGDistDataMinionsInternal(ParsedEvtcLog log, FinalDPS dps, Minions minions, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new DmgDistributionDto(); IReadOnlyList <AbstractCastEvent> casting = minions.GetIntersectingCastEvents(log, phase.Start, phase.End); IReadOnlyList <AbstractHealthDamageEvent> damageLogs = minions.GetDamageEvents(target, log, phase.Start, phase.End); IReadOnlyList <AbstractBreakbarDamageEvent> brkDamageLogs = minions.GetBreakbarDamageEvents(target, log, phase.Start, phase.End); dto.ContributedDamage = damageLogs.Sum(x => x.HealthDamage); dto.ContributedShieldDamage = damageLogs.Sum(x => x.ShieldDamage); dto.ContributedBreakbarDamage = Math.Round(brkDamageLogs.Sum(x => x.BreakbarDamage), 1); dto.TotalDamage = dps.Damage; dto.TotalBreakbarDamage = dps.BreakbarDamage; dto.TotalCasting = casting.Sum(cl => Math.Min(cl.EndTime, phase.End) - Math.Max(cl.Time, phase.Start)); dto.Distribution = BuildDMGDistBodyData(log, casting, damageLogs, usedSkills, usedBuffs, phase); return(dto); }
public static DmgDistributionDto BuildFriendlyDMGDistData(ParsedEvtcLog log, AbstractSingleActor actor, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = actor.GetDPSStats(target, log, phase.Start, phase.End); return(BuildDMGDistDataInternal(log, dps, actor, target, phase, usedSkills, usedBuffs)); }
protected FinalDPS GetFinalDPS(ParsedLog log, PhaseData phase, Target target) { double phaseDuration = (phase.DurationInMS) / 1000.0; int damage; double dps = 0.0; FinalDPS final = new FinalDPS(); //DPS damage = GetDamageLogs(target, log, phase).Sum(x => x.Damage); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.Dps = (int)Math.Round(dps); final.Damage = damage; //Condi DPS damage = GetDamageLogs(target, log, phase).Sum(x => x.IsCondi ? x.Damage : 0); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.CondiDps = (int)Math.Round(dps); final.CondiDamage = damage; //Power DPS damage = final.Damage - final.CondiDamage; if (phaseDuration > 0) { dps = damage / phaseDuration; } final.PowerDps = (int)Math.Round(dps); final.PowerDamage = damage; // Actor DPS damage = GetJustPlayerDamageLogs(target, log, phase).Sum(x => x.Damage); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.ActorDps = (int)Math.Round(dps); final.ActorDamage = damage; //Actor Condi DPS damage = GetJustPlayerDamageLogs(target, log, phase).Sum(x => x.IsCondi ? x.Damage : 0); if (phaseDuration > 0) { dps = damage / phaseDuration; } final.ActorCondiDps = (int)Math.Round(dps); final.ActorCondiDamage = damage; //Actor Power DPS damage = final.ActorDamage - final.ActorCondiDamage; if (phaseDuration > 0) { dps = damage / phaseDuration; } final.ActorPowerDps = (int)Math.Round(dps); final.ActorPowerDamage = damage; return(final); }
public static DmgDistributionDto BuildPlayerMinionDMGDistData(ParsedEvtcLog log, Player p, Minions minions, NPC target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { FinalDPS dps = p.GetDPSStats(target, log, phase.Start, phase.End); return(BuildDMGDistDataMinionsInternal(log, dps, minions, target, phase, usedSkills, usedBuffs)); }
private static DmgDistributionDto BuildDMGDistDataMinionsInternal(ParsedEvtcLog log, FinalDPS dps, Minions minions, NPC target, int phaseIndex, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new DmgDistributionDto(); PhaseData phase = log.FightData.GetPhases(log)[phaseIndex]; List <AbstractCastEvent> casting = minions.GetIntersectingCastLogs(log, phase.Start, phase.End); List <AbstractDamageEvent> damageLogs = minions.GetDamageLogs(target, log, phase.Start, phase.End); dto.ContributedDamage = damageLogs.Count > 0 ? damageLogs.Sum(x => x.Damage) : 0; dto.ContributedShieldDamage = damageLogs.Count > 0 ? damageLogs.Sum(x => x.ShieldDamage) : 0; dto.TotalDamage = dps.Damage; dto.TotalCasting = casting.Sum(cl => Math.Min(cl.EndTime, phase.End) - Math.Max(cl.Time, phase.Start)); dto.Distribution = BuildDMGDistBodyData(log, casting, damageLogs, usedSkills, usedBuffs, phaseIndex); return(dto); }