Esempio n. 1
0
        // helpers

        internal static ActorDetailsDto BuildPlayerData(ParsedEvtcLog log, Player player, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions        = new List <DmgDistributionDto>(),
                DmgDistributionsTargets = new List <List <DmgDistributionDto> >(),
                DmgDistributionsTaken   = new List <DmgDistributionDto>(),
                BoonGraph  = new List <List <BuffChartDataDto> >(),
                Rotation   = new List <List <object[]> >(),
                Food       = FoodDto.BuildPlayerFoodData(log, player, usedBuffs),
                Minions    = new List <ActorDetailsDto>(),
                DeathRecap = DeathRecapDto.BuildDeathRecap(log, player)
            };

            for (int i = 0; i < log.FightData.GetPhases(log).Count; i++)
            {
                dto.Rotation.Add(SkillDto.BuildRotationData(log, player, i, usedSkills));
                dto.DmgDistributions.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, null, i, usedSkills, usedBuffs));
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (NPC target in log.FightData.GetPhases(log)[i].Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, target, i, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, player, i, usedSkills, usedBuffs));
                dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, player, i, usedBuffs));
            }
            foreach (KeyValuePair <long, Minions> pair in player.GetMinions(log))
            {
                dto.Minions.Add(BuildPlayerMinionsData(log, player, pair.Value, usedSkills, usedBuffs));
            }

            return(dto);
        }
Esempio n. 2
0
        // helpers

        public static ActorDetailsDto BuildPlayerData(ParsedEvtcLog log, AbstractSingleActor actor, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions        = new List <DmgDistributionDto>(),
                DmgDistributionsTargets = new List <List <DmgDistributionDto> >(),
                DmgDistributionsTaken   = new List <DmgDistributionDto>(),
                BoonGraph  = new List <List <BuffChartDataDto> >(),
                Rotation   = new List <List <object[]> >(),
                Food       = FoodDto.BuildFoodData(log, actor, usedBuffs),
                Minions    = new List <ActorDetailsDto>(),
                DeathRecap = DeathRecapDto.BuildDeathRecap(log, actor)
            };

            foreach (PhaseData phase in log.FightData.GetPhases(log))
            {
                dto.Rotation.Add(SkillDto.BuildRotationData(log, actor, phase, usedSkills));
                dto.DmgDistributions.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, null, phase, usedSkills, usedBuffs));
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (AbstractSingleActor target in phase.Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, target, phase, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, actor, phase, usedSkills, usedBuffs));
                dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, actor, phase, usedBuffs));
            }
            foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log))
            {
                dto.Minions.Add(BuildFriendlyMinionsData(log, actor, pair.Value, usedSkills, usedBuffs));
            }

            return(dto);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        private static DmgDistributionDto BuildDMGDistDataInternal(ParsedEvtcLog log, FinalDPS dps, AbstractSingleActor p, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new DmgDistributionDto();
            IReadOnlyList <AbstractCastEvent>         casting    = p.GetIntersectingCastEvents(log, phase.Start, phase.End);
            IReadOnlyList <AbstractHealthDamageEvent> damageLogs = p.GetJustActorDamageEvents(target, log, phase.Start, phase.End);

            dto.ContributedDamage         = dps.ActorDamage;
            dto.ContributedShieldDamage   = dps.ActorBarrierDamage;
            dto.ContributedBreakbarDamage = dps.ActorBreakbarDamage;
            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);
        }
        private static DmgDistributionDto BuildDMGDistDataMinionsInternal(ParsedEvtcLog log, FinalDPS dps, Minions minions, NPC 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);
        }
Esempio n. 6
0
        public static ActorDetailsDto BuildTargetData(ParsedEvtcLog log, AbstractSingleActor target, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs, bool cr)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions      = new List <DmgDistributionDto>(),
                DmgDistributionsTaken = new List <DmgDistributionDto>(),
                BoonGraph             = new List <List <BuffChartDataDto> >(),
                Rotation = new List <List <object[]> >()
            };
            IReadOnlyList <PhaseData> phases = log.FightData.GetPhases(log);

            for (int i = 0; i < phases.Count; i++)
            {
                PhaseData phase = phases[i];
                if (phase.Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetDMGDistData(log, target, phase, usedSkills, usedBuffs));
                    dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, target, phase, usedSkills, usedBuffs));
                    dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs));
                }
                // rotation + buff graph for CR
                else if (i == 0 && cr)
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                    dto.DmgDistributionsTaken.Add(new DmgDistributionDto());
                    dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs));
                }
                else
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                    dto.DmgDistributionsTaken.Add(new DmgDistributionDto());
                    dto.Rotation.Add(new List <object[]>());
                    dto.BoonGraph.Add(new List <BuffChartDataDto>());
                }
            }

            dto.Minions = new List <ActorDetailsDto>();
            foreach (KeyValuePair <long, Minions> pair in target.GetMinions(log))
            {
                dto.Minions.Add(BuildTargetsMinionsData(log, target, pair.Value, usedSkills, usedBuffs));
            }
            return(dto);
        }
Esempio n. 7
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);
        }
Esempio n. 9
0
        private static ActorDetailsDto BuildPlayerMinionsData(ParsedEvtcLog log, Player player, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions        = new List <DmgDistributionDto>(),
                DmgDistributionsTargets = new List <List <DmgDistributionDto> >()
            };

            for (int i = 0; i < log.FightData.GetPhases(log).Count; i++)
            {
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (NPC target in log.FightData.GetPhases(log)[i].Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildPlayerMinionDMGDistData(log, player, minion, target, i, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributions.Add(DmgDistributionDto.BuildPlayerMinionDMGDistData(log, player, minion, null, i, usedSkills, usedBuffs));
            }
            return(dto);
        }
Esempio n. 10
0
        private static ActorDetailsDto BuildTargetsMinionsData(ParsedEvtcLog log, NPC target, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions = new List <DmgDistributionDto>()
            };

            for (int i = 0; i < log.FightData.GetPhases(log).Count; i++)
            {
                if (log.FightData.GetPhases(log)[i].Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetMinionDMGDistData(log, target, minion, i, usedSkills, usedBuffs));
                }
                else
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                }
            }
            return(dto);
        }
Esempio n. 11
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);
        }
Esempio n. 12
0
        private static ActorDetailsDto BuildFriendlyMinionsData(ParsedEvtcLog log, AbstractSingleActor actor, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions        = new List <DmgDistributionDto>(),
                DmgDistributionsTargets = new List <List <DmgDistributionDto> >()
            };

            foreach (PhaseData phase in log.FightData.GetPhases(log))
            {
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (AbstractSingleActor target in phase.Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildFriendlyMinionDMGDistData(log, actor, minion, target, phase, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributions.Add(DmgDistributionDto.BuildFriendlyMinionDMGDistData(log, actor, minion, null, phase, usedSkills, usedBuffs));
            }
            return(dto);
        }
Esempio n. 13
0
        private static ActorDetailsDto BuildTargetsMinionsData(ParsedEvtcLog log, AbstractSingleActor target, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions = new List <DmgDistributionDto>()
            };

            foreach (PhaseData phase in log.FightData.GetPhases(log))
            {
                if (phase.Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetMinionDMGDistData(log, target, minion, phase, usedSkills, usedBuffs));
                }
                else
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                }
            }
            return(dto);
        }