// helpers public static ActorDetailsDto BuildPlayerData(ParsedEvtcLog log, AbstractSingleActor actor, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new ActorDetailsDto { DmgDistributions = new List <DmgDistributionDto>(), DmgDistributionsTargets = new List <List <DmgDistributionDto> >(), DmgDistributionsTaken = new List <DmgDistributionDto>(), BoonGraph = new List <List <BuffChartDataDto> >(), Rotation = new List <List <object[]> >(), Food = FoodDto.BuildFoodData(log, actor, usedBuffs), Minions = new List <ActorDetailsDto>(), DeathRecap = DeathRecapDto.BuildDeathRecap(log, actor) }; foreach (PhaseData phase in log.FightData.GetPhases(log)) { dto.Rotation.Add(SkillDto.BuildRotationData(log, actor, phase, usedSkills)); dto.DmgDistributions.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, null, phase, usedSkills, usedBuffs)); var dmgTargetsDto = new List <DmgDistributionDto>(); foreach (AbstractSingleActor target in phase.Targets) { dmgTargetsDto.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, target, phase, usedSkills, usedBuffs)); } dto.DmgDistributionsTargets.Add(dmgTargetsDto); dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, actor, phase, usedSkills, usedBuffs)); dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, actor, phase, usedBuffs)); } foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { dto.Minions.Add(BuildFriendlyMinionsData(log, actor, pair.Value, usedSkills, usedBuffs)); } return(dto); }
// helpers public static EXTBarrierStatsPlayerDetailsDto BuildPlayerBarrierData(ParsedEvtcLog log, AbstractSingleActor actor, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new EXTBarrierStatsPlayerDetailsDto { BarrierDistributions = new List <EXTBarrierStatsBarrierDistributionDto>(), BarrierDistributionsTargets = new List <List <EXTBarrierStatsBarrierDistributionDto> >(), IncomingBarrierDistributions = new List <EXTBarrierStatsBarrierDistributionDto>(), Minions = new List <EXTBarrierStatsPlayerDetailsDto>(), }; foreach (PhaseData phase in log.FightData.GetPhases(log)) { dto.BarrierDistributions.Add(EXTBarrierStatsBarrierDistributionDto.BuildFriendlyBarrierDistData(log, actor, null, phase, usedSkills, usedBuffs)); var dmgTargetsDto = new List <EXTBarrierStatsBarrierDistributionDto>(); foreach (AbstractSingleActor target in log.Friendlies) { dmgTargetsDto.Add(EXTBarrierStatsBarrierDistributionDto.BuildFriendlyBarrierDistData(log, actor, target, phase, usedSkills, usedBuffs)); } dto.BarrierDistributionsTargets.Add(dmgTargetsDto); dto.IncomingBarrierDistributions.Add(EXTBarrierStatsBarrierDistributionDto.BuildIncomingBarrierDistData(log, actor, phase, usedSkills, usedBuffs)); } foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { dto.Minions.Add(BuildFriendlyMinionsHealingData(log, actor, pair.Value, usedSkills, usedBuffs)); } return(dto); }
protected JsonActor(AbstractSingleActor actor, ParsedLog log, 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 JsonDPS(x)).ToArray(); StatsAll = actor.GetGameplayStats(log).Select(x => new JsonGameplayStatsAll(x)).ToArray(); Defenses = actor.GetDefenses(log).Select(x => new 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.GetCastLogs(log, 0, log.FightData.FightEnd).GroupBy(x => x.SkillId).ToDictionary(x => x.Key, x => x.ToList()); if (skillByID.Any()) { Rotation = JsonRotation.BuildJsonRotationList(skillByID, skillDesc); } // if (log.ParserSettings.RawTimelineArrays) { 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 (log.ParserSettings.RawTimelineArrays) { BoonsStates = JsonBuffsUptime.GetBuffStates(actor.GetBuffGraphs(log)[ProfHelper.NumberOfBoonsID]); ConditionsStates = JsonBuffsUptime.GetBuffStates(actor.GetBuffGraphs(log)[ProfHelper.NumberOfConditionsID]); } // Health List <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(actor.AgentItem); if (log.ParserSettings.RawTimelineArrays) { HealthPercents = hpUpdates.Select(x => new double[2] { x.Time, x.HPPercent }).ToList(); } }
private void AddToDictionary(AbstractSingleActor actor) { _agentToActorDictionary[actor.AgentItem] = actor; foreach (Minions minions in actor.GetMinions(this).Values) { foreach (NPC npc in minions.MinionList) { AddToDictionary(npc); } } }
protected ActorDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details) { Name = actor.Character; Tough = actor.Toughness; Details = details; UniqueID = actor.UniqueID; foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
public static ActorDetailsDto BuildTargetData(ParsedEvtcLog log, AbstractSingleActor target, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs, bool cr) { var dto = new ActorDetailsDto { DmgDistributions = new List <DmgDistributionDto>(), DmgDistributionsTaken = new List <DmgDistributionDto>(), BoonGraph = new List <List <BuffChartDataDto> >(), Rotation = new List <List <object[]> >() }; IReadOnlyList <PhaseData> phases = log.FightData.GetPhases(log); for (int i = 0; i < phases.Count; i++) { PhaseData phase = phases[i]; if (phase.Targets.Contains(target)) { dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetDMGDistData(log, target, phase, usedSkills, usedBuffs)); dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, target, phase, usedSkills, usedBuffs)); dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills)); dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs)); } // rotation + buff graph for CR else if (i == 0 && cr) { dto.DmgDistributions.Add(new DmgDistributionDto()); dto.DmgDistributionsTaken.Add(new DmgDistributionDto()); dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills)); dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs)); } else { dto.DmgDistributions.Add(new DmgDistributionDto()); dto.DmgDistributionsTaken.Add(new DmgDistributionDto()); dto.Rotation.Add(new List <object[]>()); dto.BoonGraph.Add(new List <BuffChartDataDto>()); } } dto.Minions = new List <ActorDetailsDto>(); foreach (KeyValuePair <long, Minions> pair in target.GetMinions(log)) { dto.Minions.Add(BuildTargetsMinionsData(log, target, pair.Value, usedSkills, usedBuffs)); } return(dto); }
protected ActorDto(AbstractSingleActor actor, ParsedLog log, bool cr, ActorDetailsDto details) { Name = actor.Character; Tough = actor.Toughness; Details = details; if (cr) { CombatReplayID = actor.CombatReplayID; } foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
protected ActorDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details) { Health = actor.GetHealth(log.CombatData); Condi = actor.Condition; Conc = actor.Concentration; Heal = actor.Healing; Icon = actor.GetIcon(); Name = actor.Character; Tough = actor.Toughness; Details = details; UniqueID = actor.UniqueID; foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
public static void FillJsonActor(JsonActor jsonActor, AbstractSingleActor actor, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.SkillDesc> skillDesc, Dictionary <string, JsonLog.BuffDesc> buffDesc) { IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log); // jsonActor.Name = actor.Character; jsonActor.TotalHealth = actor.GetHealth(log.CombatData); jsonActor.Toughness = actor.Toughness; jsonActor.Healing = actor.Healing; jsonActor.Concentration = actor.Concentration; jsonActor.Condition = actor.Condition; jsonActor.HitboxHeight = actor.HitboxHeight; jsonActor.HitboxWidth = actor.HitboxWidth; jsonActor.InstanceID = actor.AgentItem.InstID; jsonActor.IsFake = actor.IsFakeActor; // jsonActor.DpsAll = phases.Select(phase => JsonStatisticsBuilder.BuildJsonDPS(actor.GetDPSStats(log, phase.Start, phase.End))).ToArray(); jsonActor.StatsAll = phases.Select(phase => JsonStatisticsBuilder.BuildJsonGameplayStatsAll(actor.GetGameplayStats(log, phase.Start, phase.End))).ToArray(); jsonActor.Defenses = phases.Select(phase => JsonStatisticsBuilder.BuildJsonDefensesAll(actor.GetDefenseStats(log, phase.Start, phase.End))).ToArray(); // IReadOnlyDictionary <long, Minions> minionsList = actor.GetMinions(log); if (minionsList.Values.Any()) { jsonActor.Minions = minionsList.Values.Select(x => JsonMinionsBuilder.BuildJsonMinions(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()) { jsonActor.Rotation = JsonRotationBuilder.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); } jsonActor.Damage1S = damage1S; jsonActor.PowerDamage1S = powerDamage1S; jsonActor.ConditionDamage1S = conditionDamage1S; jsonActor.BreakbarDamage1S = breakbarDamage1S; } if (!log.CombatData.HasBreakbarDamageData) { jsonActor.BreakbarDamage1S = null; } // jsonActor.TotalDamageDist = BuildDamageDistData(actor, phases, log, skillDesc, buffDesc); jsonActor.TotalDamageTaken = BuildDamageTakenDistData(actor, phases, log, skillDesc, buffDesc); // if (settings.RawFormatTimelineArrays) { Dictionary <long, BuffsGraphModel> buffGraphs = actor.GetBuffGraphs(log); jsonActor.BoonsStates = JsonBuffsUptimeBuilder.GetBuffStates(buffGraphs[Buff.NumberOfBoonsID]); jsonActor.ConditionsStates = JsonBuffsUptimeBuilder.GetBuffStates(buffGraphs[Buff.NumberOfConditionsID]); if (buffGraphs.TryGetValue(Buff.NumberOfActiveCombatMinionsID, out BuffsGraphModel states)) { jsonActor.ActiveCombatMinions = JsonBuffsUptimeBuilder.GetBuffStates(states); } // Health jsonActor.HealthPercents = actor.GetHealthUpdates(log).Select(x => new double[2] { x.Start, x.Value }).ToList(); jsonActor.BarrierPercents = actor.GetBarrierUpdates(log).Select(x => new double[2] { x.Start, x.Value }).ToList(); } if (log.CanCombatReplay) { jsonActor.CombatReplayData = JsonActorCombatReplayDataBuilder.BuildJsonActorCombatReplayDataBuilder(actor, log, settings); } }