Example #1
0
        private static DmgDistributionDto BuildDMGDistDataInternal(ParsedEvtcLog log, FinalDPS dps, AbstractSingleActor p, 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    = p.GetIntersectingCastLogs(log, phase.Start, phase.End);
            List <AbstractDamageEvent> damageLogs = p.GetJustActorDamageLogs(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);
        }
Example #2
0
        protected JsonActor(AbstractSingleActor actor, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            List <PhaseData> phases = log.FightData.GetPhases(log);

            //
            Name          = actor.Character;
            Toughness     = actor.Toughness;
            Healing       = actor.Healing;
            Concentration = actor.Concentration;
            Condition     = actor.Condition;
            HitboxHeight  = actor.HitboxHeight;
            HitboxWidth   = actor.HitboxWidth;
            InstanceID    = actor.InstID;
            //
            DpsAll   = actor.GetDPSAll(log).Select(x => new JsonStatistics.JsonDPS(x)).ToArray();
            StatsAll = actor.GetGameplayStats(log).Select(x => new JsonStatistics.JsonGameplayStatsAll(x)).ToArray();
            Defenses = actor.GetDefenses(log).Select(x => new JsonStatistics.JsonDefensesAll(x)).ToArray();
            //
            Dictionary <long, Minions> minionsList = actor.GetMinions(log);

            if (minionsList.Values.Any())
            {
                Minions = minionsList.Values.Select(x => new JsonMinions(x, log, skillDesc, buffDesc)).ToList();
            }
            //
            var skillByID = actor.GetIntersectingCastLogs(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);
            }
            //
            if (settings.RawFormatTimelineArrays)
            {
                Damage1S = new List <int> [phases.Count];
                for (int i = 0; i < phases.Count; i++)
                {
                    Damage1S[i] = actor.Get1SDamageList(log, i, phases[i], null);
                }
            }
            //
            TotalDamageDist  = BuildDamageDistData(actor, null, phases, log, skillDesc, buffDesc);
            TotalDamageTaken = BuildDamageTakenDistData(actor, null, phases, log, skillDesc, buffDesc);
            //
            if (settings.RawFormatTimelineArrays)
            {
                Dictionary <long, BuffsGraphModel> buffGraphs = actor.GetBuffGraphs(log);
                BoonsStates      = JsonBuffsUptime.GetBuffStates(buffGraphs[Buff.NumberOfBoonsID]);
                ConditionsStates = JsonBuffsUptime.GetBuffStates(buffGraphs[Buff.NumberOfConditionsID]);
                if (buffGraphs.TryGetValue(Buff.NumberOfActiveCombatMinions, out BuffsGraphModel states))
                {
                    ActiveCombatMinions = JsonBuffsUptime.GetBuffStates(states);
                }
            }
            // Health
            List <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(actor.AgentItem);

            if (settings.RawFormatTimelineArrays)
            {
                HealthPercents = hpUpdates.Select(x => new double[2] {
                    x.Time, x.HPPercent
                }).ToList();
            }
        }