private static EXTHealingStatsHealingDistributionDto BuildHealingDistDataMinionsInternal(ParsedEvtcLog log, EXTFinalOutgoingHealingStat outgoingHealingStats, Minions minions, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new EXTHealingStatsHealingDistributionDto();
            IReadOnlyList <AbstractCastEvent>       casting     = minions.GetIntersectingCastEvents(log, phase.Start, phase.End);
            IReadOnlyList <EXTAbstractHealingEvent> healingLogs = minions.EXTHealing.GetOutgoingHealEvents(target, log, phase.Start, phase.End);

            dto.ContributedHealing = healingLogs.Sum(x => x.HealingDone);
            dto.TotalHealing       = outgoingHealingStats.Healing;
            dto.TotalCasting       = casting.Sum(cl => Math.Min(cl.EndTime, phase.End) - Math.Max(cl.Time, phase.Start));
            dto.Distribution       = BuildHealingDistBodyData(log, casting, healingLogs, usedSkills, usedBuffs, phase);
            return(dto);
        }
        private static EXTBarrierStatsBarrierDistributionDto BuildBarrierDistDataMinionsInternal(ParsedEvtcLog log, EXTFinalOutgoingBarrierStat outgoingBarrierStats, Minions minions, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new EXTBarrierStatsBarrierDistributionDto();
            IReadOnlyList <AbstractCastEvent>       casting     = minions.GetIntersectingCastEvents(log, phase.Start, phase.End);
            IReadOnlyList <EXTAbstractBarrierEvent> barrierLogs = minions.EXTBarrier.GetOutgoingBarrierEvents(target, log, phase.Start, phase.End);

            dto.ContributedBarrier = barrierLogs.Sum(x => x.BarrierGiven);
            dto.TotalBarrier       = outgoingBarrierStats.Barrier;
            dto.TotalCasting       = casting.Sum(cl => Math.Min(cl.EndTime, phase.End) - Math.Max(cl.Time, phase.Start));
            dto.Distribution       = BuildBarrierDistBodyData(log, casting, barrierLogs, usedSkills, usedBuffs, phase);
            return(dto);
        }
예제 #3
0
        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);
        }
예제 #4
0
        internal JsonMinions(Minions minions, ParsedEvtcLog log, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            IReadOnlyList <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>();
            var totalBreakbarDamage = new List <double>();

            foreach (PhaseData phase in phases)
            {
                int tot    = 0;
                int shdTot = 0;
                foreach (AbstractHealthDamageEvent de in minions.GetDamageEvents(null, log, phase.Start, phase.End))
                {
                    tot   += de.HealthDamage;
                    shdTot = de.ShieldDamage;
                }
                totalDamage.Add(tot);
                totalShieldDamage.Add(shdTot);
                totalBreakbarDamage.Add(Math.Round(minions.GetBreakbarDamageEvents(null, log, phase.Start, phase.End).Sum(x => x.BreakbarDamage), 1));
            }
            TotalDamage         = totalDamage;
            TotalShieldDamage   = totalShieldDamage;
            TotalBreakbarDamage = totalBreakbarDamage;
            if (!isNPCMinion)
            {
                var totalTargetDamage         = new IReadOnlyList <int> [log.FightData.Logic.Targets.Count];
                var totalTargetShieldDamage   = new IReadOnlyList <int> [log.FightData.Logic.Targets.Count];
                var totalTargetBreakbarDamage = new IReadOnlyList <double> [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>();
                    var totalTarBreakbarDamage = new List <double>();
                    foreach (PhaseData phase in phases)
                    {
                        int tot    = 0;
                        int shdTot = 0;
                        foreach (AbstractHealthDamageEvent de in minions.GetDamageEvents(tar, log, phase.Start, phase.End))
                        {
                            tot   += de.HealthDamage;
                            shdTot = de.ShieldDamage;
                        }
                        totalTarDamage.Add(tot);
                        totalTarShieldDamage.Add(shdTot);
                        totalTarBreakbarDamage.Add(Math.Round(minions.GetBreakbarDamageEvents(tar, log, phase.Start, phase.End).Sum(x => x.BreakbarDamage), 1));
                    }
                    totalTargetDamage[i]         = totalTarDamage;
                    totalTargetShieldDamage[i]   = totalTarShieldDamage;
                    totalTargetBreakbarDamage[i] = totalTarBreakbarDamage;
                }
                TotalTargetShieldDamage   = totalTargetShieldDamage;
                TotalTargetDamage         = totalTargetDamage;
                TotalTargetBreakbarDamage = totalTargetBreakbarDamage;
            }
            //
            var skillByID = minions.GetIntersectingCastEvents(log, 0, log.FightData.FightEnd).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList());

            if (skillByID.Any())
            {
                Rotation = JsonRotation.BuildJsonRotationList(log, skillByID, skillDesc);
            }
            //
            var totalDamageDist = new IReadOnlyList <JsonDamageDist> [phases.Count];

            for (int i = 0; i < phases.Count; i++)
            {
                PhaseData phase = phases[i];
                totalDamageDist[i] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
            }
            TotalDamageDist = totalDamageDist;
            if (!isNPCMinion)
            {
                var targetDamageDist = new IReadOnlyList <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 IReadOnlyList <JsonDamageDist> [phases.Count];
                    for (int j = 0; j < phases.Count; j++)
                    {
                        PhaseData phase = phases[j];
                        targetDamageDist[i][j] = JsonDamageDist.BuildJsonDamageDistList(minions.GetDamageEvents(target, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
                    }
                }
                TargetDamageDist = targetDamageDist;
            }
        }
        public static JsonMinions BuildJsonMinions(Minions minions, ParsedEvtcLog log, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var jsonMinions = new JsonMinions();
            IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log);
            bool isEnemyMinion = !log.FriendlyAgents.Contains(minions.Master.AgentItem);

            //
            jsonMinions.Name = minions.Character;
            //
            var totalDamage         = new List <int>();
            var totalShieldDamage   = new List <int>();
            var totalBreakbarDamage = new List <double>();

            foreach (PhaseData phase in phases)
            {
                int tot    = 0;
                int shdTot = 0;
                foreach (AbstractHealthDamageEvent de in minions.GetDamageEvents(null, log, phase.Start, phase.End))
                {
                    tot    += de.HealthDamage;
                    shdTot += de.ShieldDamage;
                }
                totalDamage.Add(tot);
                totalShieldDamage.Add(shdTot);
                totalBreakbarDamage.Add(Math.Round(minions.GetBreakbarDamageEvents(null, log, phase.Start, phase.End).Sum(x => x.BreakbarDamage), 1));
            }
            jsonMinions.TotalDamage         = totalDamage;
            jsonMinions.TotalShieldDamage   = totalShieldDamage;
            jsonMinions.TotalBreakbarDamage = totalBreakbarDamage;
            if (!isEnemyMinion)
            {
                var totalTargetDamage         = new IReadOnlyList <int> [log.FightData.Logic.Targets.Count];
                var totalTargetShieldDamage   = new IReadOnlyList <int> [log.FightData.Logic.Targets.Count];
                var totalTargetBreakbarDamage = new IReadOnlyList <double> [log.FightData.Logic.Targets.Count];
                for (int i = 0; i < log.FightData.Logic.Targets.Count; i++)
                {
                    AbstractSingleActor tar    = log.FightData.Logic.Targets[i];
                    var totalTarDamage         = new List <int>();
                    var totalTarShieldDamage   = new List <int>();
                    var totalTarBreakbarDamage = new List <double>();
                    foreach (PhaseData phase in phases)
                    {
                        int tot    = 0;
                        int shdTot = 0;
                        foreach (AbstractHealthDamageEvent de in minions.GetDamageEvents(tar, log, phase.Start, phase.End))
                        {
                            tot    += de.HealthDamage;
                            shdTot += de.ShieldDamage;
                        }
                        totalTarDamage.Add(tot);
                        totalTarShieldDamage.Add(shdTot);
                        totalTarBreakbarDamage.Add(Math.Round(minions.GetBreakbarDamageEvents(tar, log, phase.Start, phase.End).Sum(x => x.BreakbarDamage), 1));
                    }
                    totalTargetDamage[i]         = totalTarDamage;
                    totalTargetShieldDamage[i]   = totalTarShieldDamage;
                    totalTargetBreakbarDamage[i] = totalTarBreakbarDamage;
                }
                jsonMinions.TotalTargetShieldDamage   = totalTargetShieldDamage;
                jsonMinions.TotalTargetDamage         = totalTargetDamage;
                jsonMinions.TotalTargetBreakbarDamage = totalTargetBreakbarDamage;
            }
            //
            var skillByID = minions.GetIntersectingCastEvents(log, 0, log.FightData.FightEnd).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList());

            if (skillByID.Any())
            {
                jsonMinions.Rotation = JsonRotationBuilder.BuildJsonRotationList(log, skillByID, skillDesc);
            }
            //
            var totalDamageDist = new IReadOnlyList <JsonDamageDist> [phases.Count];

            for (int i = 0; i < phases.Count; i++)
            {
                PhaseData phase = phases[i];
                totalDamageDist[i] = JsonDamageDistBuilder.BuildJsonDamageDistList(minions.GetDamageEvents(null, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
            }
            jsonMinions.TotalDamageDist = totalDamageDist;
            if (!isEnemyMinion)
            {
                var targetDamageDist = new IReadOnlyList <JsonDamageDist> [log.FightData.Logic.Targets.Count][];
                for (int i = 0; i < log.FightData.Logic.Targets.Count; i++)
                {
                    AbstractSingleActor target = log.FightData.Logic.Targets[i];
                    targetDamageDist[i] = new IReadOnlyList <JsonDamageDist> [phases.Count];
                    for (int j = 0; j < phases.Count; j++)
                    {
                        PhaseData phase = phases[j];
                        targetDamageDist[i][j] = JsonDamageDistBuilder.BuildJsonDamageDistList(minions.GetDamageEvents(target, log, phase.Start, phase.End).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()), log, skillDesc, buffDesc);
                    }
                }
                jsonMinions.TargetDamageDist = targetDamageDist;
            }
            if (log.CombatData.HasEXTHealing && !isEnemyMinion)
            {
                jsonMinions.EXTHealingStats = EXTJsonMinionsHealingStatsBuilder.BuildMinionsHealingStats(minions, log, skillDesc, buffDesc);
            }
            return(jsonMinions);
        }