private static DmgDistributionDto BuildDMGDistDataMinionsInternal(ParsedLog 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.GetCastLogs(log, phase.Start, phase.End); List <AbstractDamageEvent> damageLogs = minions.GetDamageLogs(target, log, phase); 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.Distribution = BuildDMGDistBodyData(log, casting, damageLogs, usedSkills, usedBuffs); return(dto); }
public JsonMinions(Minions minions, ParsedLog log, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc) { List <PhaseData> phases = log.FightData.GetPhases(log); bool isNPCMinion = minions.Master is NPC; // Name = minions.Character; // var totalDamage = new List <int>(); var totalShieldDamage = new List <int>(); foreach (PhaseData phase in phases) { int tot = 0; int shdTot = 0; foreach (AbstractDamageEvent de in minions.GetDamageLogs(null, log, phase)) { tot += de.Damage; shdTot = de.ShieldDamage; } totalDamage.Add(tot); totalShieldDamage.Add(shdTot); } TotalDamage = totalDamage; TotalShieldDamage = totalShieldDamage; if (!isNPCMinion) { var totalTargetDamage = new List <int> [log.FightData.Logic.Targets.Count]; var totalTargetShieldDamage = new List <int> [log.FightData.Logic.Targets.Count]; for (int i = 0; i < log.FightData.Logic.Targets.Count; i++) { NPC tar = log.FightData.Logic.Targets[i]; var totalTarDamage = new List <int>(); var totalTarShieldDamage = new List <int>(); foreach (PhaseData phase in phases) { int tot = 0; int shdTot = 0; foreach (AbstractDamageEvent de in minions.GetDamageLogs(tar, log, phase)) { tot += de.Damage; shdTot = de.ShieldDamage; } totalTarDamage.Add(tot); totalTarShieldDamage.Add(shdTot); } totalTargetDamage[i] = totalTarDamage; totalTargetShieldDamage[i] = totalTarShieldDamage; } TotalTargetShieldDamage = totalTargetShieldDamage; TotalTargetDamage = totalTargetDamage; } // var skillByID = minions.GetCastLogs(log, 0, log.FightData.FightEnd).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()); if (skillByID.Any()) { Rotation = JsonRotation.BuildJsonRotationList(skillByID, skillDesc); } // TotalDamageDist = new List <JsonDamageDist> [phases.Count]; for (int i = 0; i < phases.Count; i++) { PhaseData phase = phases[i]; TotalDamageDist[i] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageLogs(null, log, phase).Where(x => !x.HasDowned).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc); } if (!isNPCMinion) { TargetDamageDist = new List <JsonDamageDist> [log.FightData.Logic.Targets.Count][]; for (int i = 0; i < log.FightData.Logic.Targets.Count; i++) { NPC target = log.FightData.Logic.Targets[i]; TargetDamageDist[i] = new List <JsonDamageDist> [phases.Count]; for (int j = 0; j < phases.Count; j++) { PhaseData phase = phases[j]; TargetDamageDist[i][j] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageLogs(target, log, phase).Where(x => !x.HasDowned).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc); } } } }