Esempio n. 1
0
        // helpers

        public static ActorDetailsDto BuildPlayerData(ParsedLog log, Player player, 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.BuildPlayerFoodData(log, player, usedBuffs),
                Minions    = new List <ActorDetailsDto>(),
                DeathRecap = DeathRecapDto.BuildDeathRecap(log, player)
            };

            for (int i = 0; i < log.FightData.GetPhases(log).Count; i++)
            {
                dto.Rotation.Add(SkillDto.BuildRotationData(log, player, i, usedSkills));
                dto.DmgDistributions.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, null, i, usedSkills, usedBuffs));
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (NPC target in log.FightData.GetPhases(log)[i].Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, target, i, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, player, i, usedSkills, usedBuffs));
                dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, player, i, usedBuffs));
            }
            foreach (KeyValuePair <long, Minions> pair in player.GetMinions(log))
            {
                dto.Minions.Add(BuildPlayerMinionsData(log, player, pair.Value, usedSkills, usedBuffs));
            }

            return(dto);
        }
Esempio n. 2
0
 private static void BuildBoonGraphData(List <BuffChartDataDto> list, List <Buff> listToUse, Dictionary <long, BuffsGraphModel> boonGraphData, PhaseData phase, Dictionary <long, Buff> usedBuffs)
 {
     foreach (Buff buff in listToUse)
     {
         if (boonGraphData.TryGetValue(buff.ID, out BuffsGraphModel bgm))
         {
             BuffChartDataDto graph = BuildBuffGraph(bgm, phase, usedBuffs);
             if (graph != null)
             {
                 list.Add(graph);
             }
         }
         boonGraphData.Remove(buff.ID);
     }
 }
Esempio n. 3
0
        public static ActorDetailsDto BuildTargetData(ParsedLog log, NPC 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[]> >()
            };

            for (int i = 0; i < log.FightData.GetPhases(log).Count; i++)
            {
                if (log.FightData.GetPhases(log)[i].Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetDMGDistData(log, target, i, usedSkills, usedBuffs));
                    dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, target, i, usedSkills, usedBuffs));
                    dto.Rotation.Add(SkillDto.BuildRotationData(log, target, i, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, i, 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, i, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, i, 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);
        }
Esempio n. 4
0
        public static List <BuffChartDataDto> BuildBoonGraphData(ParsedLog log, AbstractSingleActor p, int phaseIndex, Dictionary <long, Buff> usedBuffs)
        {
            var       list          = new List <BuffChartDataDto>();
            PhaseData phase         = log.FightData.GetPhases(log)[phaseIndex];
            var       boonGraphData = p.GetBuffGraphs(log).ToDictionary(x => x.Key, x => x.Value);

            BuildBoonGraphData(list, log.Statistics.PresentBoons, boonGraphData, phase, usedBuffs);
            BuildBoonGraphData(list, log.Statistics.PresentConditions, boonGraphData, phase, usedBuffs);
            BuildBoonGraphData(list, log.Statistics.PresentOffbuffs, boonGraphData, phase, usedBuffs);
            BuildBoonGraphData(list, log.Statistics.PresentDefbuffs, boonGraphData, phase, usedBuffs);
            foreach (BuffsGraphModel bgm in boonGraphData.Values)
            {
                BuffChartDataDto graph = BuildBuffGraph(bgm, phase, usedBuffs);
                if (graph != null)
                {
                    list.Add(graph);
                }
            }
            if (p.GetType() == typeof(Player))
            {
                foreach (NPC mainTarget in log.FightData.GetMainTargets(log))
                {
                    boonGraphData = mainTarget.GetBuffGraphs(log);
                    foreach (BuffsGraphModel bgm in boonGraphData.Values.Reverse().Where(x => x.Buff.Name == "Compromised" || x.Buff.Name == "Unnatural Signet" || x.Buff.Name == "Fractured - Enemy" || x.Buff.Name == "Erratic Energy"))
                    {
                        BuffChartDataDto graph = BuildBuffGraph(bgm, phase, usedBuffs);
                        if (graph != null)
                        {
                            list.Add(graph);
                        }
                    }
                }
            }
            list.Reverse();
            return(list);
        }