internal FinalGameplayStatsAll(ParsedEvtcLog log, long start, long end, AbstractSingleActor actor) : base(log, start, end, actor, null) { // If dummy actor, stop if (actor.IsFakeActor) { return; } long duration = end - start; foreach (AbstractCastEvent cl in actor.GetCastEvents(log, start, end)) { switch (cl.Status) { case AbstractCastEvent.AnimationStatus.Interrupted: Wasted++; TimeWasted += cl.SavedDuration; break; case AbstractCastEvent.AnimationStatus.Reduced: Saved++; TimeSaved += cl.SavedDuration; break; } if (cl.Skill.IsSwap) { SwapCount++; } } TimeSaved = Math.Round(TimeSaved / 1000.0, ParserHelper.TimeDigit); TimeWasted = -Math.Round(TimeWasted / 1000.0, ParserHelper.TimeDigit); double avgBoons = 0; foreach (long boonDuration in actor.GetBuffPresence(log, start, end).Where(x => log.Buffs.BuffsByIds[x.Key].Classification == BuffClassification.Boon).Select(x => x.Value)) { avgBoons += boonDuration; } AvgBoons = Math.Round(avgBoons / duration, ParserHelper.BuffDigit); long activeDuration = actor.GetActiveDuration(log, start, end); AvgActiveBoons = activeDuration > 0 ? Math.Round(avgBoons / activeDuration, ParserHelper.BuffDigit) : 0.0; double avgCondis = 0; foreach (long conditionDuration in actor.GetBuffPresence(log, start, end).Where(x => log.Buffs.BuffsByIds[x.Key].Classification == BuffClassification.Condition).Select(x => x.Value)) { avgCondis += conditionDuration; } AvgConditions = Math.Round(avgCondis / duration, ParserHelper.BuffDigit); AvgActiveConditions = activeDuration > 0 ? Math.Round(avgCondis / activeDuration, ParserHelper.BuffDigit) : 0.0; if (log.CombatData.HasMovementData && log.FriendlyAgents.Contains(actor.AgentItem) && actor.GetCombatReplayPolledPositions(log).Any(x => x.X > int.MinValue + 1)) { StackDist = GetDistanceToTarget(actor, log, start, end, log.StatisticsHelper.GetStackCenterPositions(log)); DistToCom = GetDistanceToTarget(actor, log, start, end, log.StatisticsHelper.GetStackCommanderPositions(log)); } }
internal FinalDefenses(ParsedEvtcLog log, long start, long end, AbstractSingleActor actor, AbstractSingleActor from) { IReadOnlyList <AbstractHealthDamageEvent> damageLogs = actor.GetDamageTakenEvents(from, log, start, end); DamageTaken = damageLogs.Sum(x => (long)x.HealthDamage); BreakbarDamageTaken = Math.Round(actor.GetBreakbarDamageTakenEvents(from, log, start, end).Sum(x => x.BreakbarDamage), 1); BlockedCount = damageLogs.Count(x => x.IsBlocked); MissedCount = damageLogs.Count(x => x.IsBlind); InvulnedCount = damageLogs.Count(x => x.IsAbsorbed); EvadedCount = damageLogs.Count(x => x.IsEvaded); DodgeCount = actor.GetCastEvents(log, start, end).Count(x => x.SkillId == SkillItem.DodgeId || x.SkillId == SkillItem.MirageCloakDodgeId); DamageBarrier = damageLogs.Sum(x => x.ShieldDamage); InterruptedCount = damageLogs.Count(x => x.HasInterrupted); }
private static long[] GetReses(ParsedEvtcLog log, AbstractSingleActor actor, long start, long end) { IReadOnlyList <AbstractCastEvent> cls = actor.GetCastEvents(log, start, end); long[] reses = { 0, 0 }; foreach (AbstractCastEvent cl in cls) { if (cl.SkillId == SkillItem.ResurrectId) { reses[0]++; reses[1] += cl.ActualDuration; } } return(reses); }