Example #1
0
        protected static List <JsonDamageDist>[] BuildDamageTakenDistData(AbstractSingleActor actor, IReadOnlyList <PhaseData> phases, ParsedEvtcLog 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.GetDamageTakenEvents(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
            }
            return(res);
        }
Example #2
0
        public static DmgDistributionDto BuildDMGTakenDistData(ParsedEvtcLog log, AbstractSingleActor p, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new DmgDistributionDto
            {
                Distribution = new List <object[]>()
            };
            FinalDefensesAll incomingDamageStats = p.GetDefenseStats(log, phase.Start, phase.End);
            IReadOnlyList <AbstractHealthDamageEvent> damageLogs = p.GetDamageTakenEvents(null, log, phase.Start, phase.End);
            var damageLogsBySkill = damageLogs.GroupBy(x => x.Skill).ToDictionary(x => x.Key, x => x.ToList());

            dto.ContributedDamage       = incomingDamageStats.DamageTaken;
            dto.ContributedShieldDamage = incomingDamageStats.DamageBarrier;
            foreach (KeyValuePair <SkillItem, List <AbstractHealthDamageEvent> > pair in damageLogsBySkill)
            {
                dto.Distribution.Add(GetDMGDtoItem(pair.Key, pair.Value, null, usedSkills, usedBuffs, log.Buffs, phase));
            }
            return(dto);
        }
        public static DmgDistributionDto BuildDMGTakenDistData(ParsedEvtcLog log, AbstractSingleActor p, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new DmgDistributionDto
            {
                Distribution = new List <object[]>()
            };
            IReadOnlyList <AbstractHealthDamageEvent> damageLogs = p.GetDamageTakenEvents(null, log, phase.Start, phase.End);
            var damageLogsBySkill = damageLogs.GroupBy(x => x.Skill).ToDictionary(x => x.Key, x => x.ToList());

            dto.ContributedDamage       = damageLogs.Sum(x => x.HealthDamage);
            dto.ContributedShieldDamage = damageLogs.Sum(x => x.ShieldDamage);
            var conditionsById = log.StatisticsHelper.PresentConditions.ToDictionary(x => x.ID);

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