protected static List <JsonDamageDist>[] BuildDamageTakenDistData(AbstractSingleActor actor, NPC target, List <PhaseData> phases, ParsedLog log, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var res = new List <JsonDamageDist> [phases.Count];

            for (int i = 0; i < phases.Count; i++)
            {
                PhaseData phase = phases[i];
                res[i] = JsonDamageDist.BuildJsonDamageDistList(actor.GetDamageTakenLogs(target, log, phase.Start, phase.End).Where(x => !x.HasDowned).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
            }
            return(res);
        }
Exemple #2
0
        internal static DmgDistributionDto BuildDMGTakenDistData(ParsedEvtcLog log, AbstractSingleActor p, int phaseIndex, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new DmgDistributionDto
            {
                Distribution = new List <object[]>()
            };
            PhaseData phase = log.FightData.GetPhases(log)[phaseIndex];
            List <AbstractDamageEvent> damageLogs = p.GetDamageTakenLogs(null, log, phase.Start, phase.End);
            var damageLogsBySkill = damageLogs.GroupBy(x => x.Skill).ToDictionary(x => x.Key, x => x.ToList());

            dto.ContributedDamage       = damageLogs.Count > 0 ? damageLogs.Sum(x => x.Damage) : 0;
            dto.ContributedShieldDamage = damageLogs.Count > 0 ? damageLogs.Sum(x => x.ShieldDamage) : 0;
            var conditionsById = log.Statistics.PresentConditions.ToDictionary(x => x.ID);

            foreach (KeyValuePair <SkillItem, List <AbstractDamageEvent> > entry in damageLogsBySkill)
            {
                dto.Distribution.Add(GetDMGDtoItem(entry, null, usedSkills, usedBuffs, log.Buffs, phase));
            }
            return(dto);
        }