public static JsonNPC BuildJsonNPC(AbstractSingleActor npc, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var jsonNPC = new JsonNPC();

            JsonActorBuilder.FillJsonActor(jsonNPC, npc, log, settings, skillDesc, buffDesc);
            IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log);

            //
            jsonNPC.Id = npc.ID;
            IReadOnlyList <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(npc.AgentItem);

            jsonNPC.FirstAware  = (int)npc.FirstAware;
            jsonNPC.LastAware   = (int)npc.LastAware;
            jsonNPC.EnemyPlayer = npc is PlayerNonSquad;
            double hpLeft = 100.0;

            if (log.FightData.Success)
            {
                hpLeft = 0;
            }
            else
            {
                if (hpUpdates.Count > 0)
                {
                    hpLeft = hpUpdates.Last().HPPercent;
                }
            }
            jsonNPC.HealthPercentBurned = 100.0 - hpLeft;
            jsonNPC.FinalHealth         = (int)Math.Round(jsonNPC.TotalHealth * hpLeft / 100.0);
            //
            jsonNPC.Buffs = GetNPCJsonBuffsUptime(npc, log, settings, buffDesc);
            // Breakbar
            if (settings.RawFormatTimelineArrays)
            {
                jsonNPC.BreakbarPercents = npc.GetBreakbarPercentUpdates(log).Select(x => new double[2] {
                    x.Start, x.Value
                }).ToList();
            }
            return(jsonNPC);
        }
Exemple #2
0
 public static List <object[]> BuildBreakbarPercentStates(ParsedEvtcLog log, AbstractSingleActor npc, PhaseData phase)
 {
     return(BuildGraphStates(npc.GetBreakbarPercentUpdates(log), phase, true, 100.0));
 }