protected JsonDamageDist(long id, List <AbstractHealthDamageEvent> list, ParsedEvtcLog log, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc)
 {
     IndirectDamage = list.Exists(x => x is NonDirectHealthDamageEvent);
     if (IndirectDamage)
     {
         if (!buffDesc.ContainsKey("b" + id))
         {
             if (log.Buffs.BuffsByIds.TryGetValue(id, out Buff buff))
             {
                 buffDesc["b" + id] = new JsonLog.BuffDesc(buff, log);
             }
             else
             {
                 SkillItem skill   = list.First().Skill;
                 var       auxBoon = new Buff(skill.Name, id, skill.Icon);
                 buffDesc["b" + id] = new JsonLog.BuffDesc(auxBoon, log);
             }
         }
     }
     else
     {
         if (!skillDesc.ContainsKey("s" + id))
         {
             SkillItem skill = list.First().Skill;
             skillDesc["s" + id] = new JsonLog.SkillDesc(skill, log.LogData.GW2Build, log.SkillData);
         }
     }
     Id  = id;
     Min = int.MaxValue;
     Max = int.MinValue;
     foreach (AbstractHealthDamageEvent dmgEvt in list)
     {
         Hits        += dmgEvt.DoubleProcHit ? 0 : 1;
         TotalDamage += dmgEvt.HealthDamage;
         if (dmgEvt.HasHit)
         {
             Min = Math.Min(Min, dmgEvt.HealthDamage);
             Max = Math.Max(Max, dmgEvt.HealthDamage);
         }
         if (!IndirectDamage)
         {
             if (dmgEvt.HasHit)
             {
                 Flank      += dmgEvt.IsFlanking ? 1 : 0;
                 Glance     += dmgEvt.HasGlanced ? 1 : 0;
                 Crit       += dmgEvt.HasCrit ? 1 : 0;
                 CritDamage += dmgEvt.HasCrit ? dmgEvt.HealthDamage : 0;
             }
             Missed      += dmgEvt.IsBlind ? 1 : 0;
             Evaded      += dmgEvt.IsEvaded ? 1 : 0;
             Blocked     += dmgEvt.IsBlocked ? 1 : 0;
             Interrupted += dmgEvt.HasInterrupted ? 1 : 0;
         }
         ConnectedHits += dmgEvt.HasHit ? 1 : 0;
         Invulned      += dmgEvt.IsAbsorbed ? 1 : 0;
         ShieldDamage  += dmgEvt.ShieldDamage;
     }
     Min = Min == int.MaxValue ? 0 : Min;
     Max = Max == int.MinValue ? 0 : Max;
 }
Exemple #2
0
 internal JsonBuffsUptime(AbstractSingleActor actor, long buffID, ParsedEvtcLog log, RawFormatSettings settings, List <JsonBuffsUptimeData> buffData, Dictionary <string, JsonLog.BuffDesc> buffDesc)
 {
     Id       = buffID;
     BuffData = buffData;
     if (!buffDesc.ContainsKey("b" + buffID))
     {
         buffDesc["b" + buffID] = new JsonLog.BuffDesc(log.Buffs.BuffsByIds[buffID], log);
     }
     if (settings.RawFormatTimelineArrays)
     {
         States = GetBuffStates(actor.GetBuffGraphs(log)[buffID]);
     }
 }