예제 #1
0
        protected JsonActor(AbstractSingleActor actor, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            IReadOnlyList <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   = phases.Select(phase => new JsonStatistics.JsonDPS(actor.GetDPSStats(log, phase.Start, phase.End))).ToArray();
            StatsAll = phases.Select(phase => new JsonStatistics.JsonGameplayStatsAll(actor.GetGameplayStats(log, phase.Start, phase.End))).ToArray();
            Defenses = phases.Select(phase => new JsonStatistics.JsonDefensesAll(actor.GetDefenseStats(log, phase.Start, phase.End))).ToArray();
            //
            IReadOnlyDictionary <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.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);
            }
            //
            if (settings.RawFormatTimelineArrays)
            {
                var damage1S          = new IReadOnlyList <int> [phases.Count];
                var powerDamage1S     = new IReadOnlyList <int> [phases.Count];
                var conditionDamage1S = new IReadOnlyList <int> [phases.Count];
                var breakbarDamage1S  = new IReadOnlyList <double> [phases.Count];
                for (int i = 0; i < phases.Count; i++)
                {
                    PhaseData phase = phases[i];
                    damage1S[i]          = actor.Get1SDamageList(log, phase.Start, phase.End, null, ParserHelper.DamageType.All);
                    powerDamage1S[i]     = actor.Get1SDamageList(log, phase.Start, phase.End, null, ParserHelper.DamageType.Power);
                    conditionDamage1S[i] = actor.Get1SDamageList(log, phase.Start, phase.End, null, ParserHelper.DamageType.Condition);
                    breakbarDamage1S[i]  = actor.Get1SBreakbarDamageList(log, phase.Start, phase.End, null);
                }
                Damage1S          = damage1S;
                PowerDamage1S     = powerDamage1S;
                ConditionDamage1S = conditionDamage1S;
                BreakbarDamage1S  = breakbarDamage1S;
            }
            if (!log.CombatData.HasBreakbarDamageData)
            {
                BreakbarDamage1S = null;
            }
            //
            TotalDamageDist  = BuildDamageDistData(actor, phases, log, skillDesc, buffDesc);
            TotalDamageTaken = BuildDamageTakenDistData(actor, 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
                HealthPercents = actor.GetHealthUpdates(log).Select(x => new double[2] {
                    x.Start, x.Value
                }).ToList();
                BarrierPercents = actor.GetBarrierUpdates(log).Select(x => new double[2] {
                    x.Start, x.Value
                }).ToList();
            }
        }
예제 #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();
            }
        }