Exemple #1
0
        public PhaseDto(PhaseData phase, IReadOnlyList <PhaseData> phases, ParsedEvtcLog log, IReadOnlyDictionary <Spec, IReadOnlyList <Buff> > persBuffDict, IReadOnlyList <DamageModifier> commonDamageModifiers, IReadOnlyList <DamageModifier> itemDamageModifiers, IReadOnlyDictionary <Spec, IReadOnlyList <DamageModifier> > persDamageModDict)
        {
            Name          = phase.Name;
            Duration      = phase.DurationInMS;
            Start         = phase.Start / 1000.0;
            End           = phase.End / 1000.0;
            BreakbarPhase = phase.BreakbarPhase;
            Dummy         = phase.Dummy;
            foreach (AbstractSingleActor target in phase.Targets)
            {
                Targets.Add(log.FightData.Logic.Targets.IndexOf(target));
            }
            PlayerActiveTimes = new List <long>();
            foreach (AbstractSingleActor actor in log.Friendlies)
            {
                PlayerActiveTimes.Add(actor.GetActiveDuration(log, phase.Start, phase.End));
            }
            // add phase markup
            MarkupLines = new List <double>();
            MarkupAreas = new List <AreaLabelDto>();
            if (!BreakbarPhase)
            {
                for (int j = 1; j < phases.Count; j++)
                {
                    PhaseData curPhase = phases[j];
                    if (curPhase.Start < phase.Start || curPhase.End > phase.End ||
                        (curPhase.Start == phase.Start && curPhase.End == phase.End) || !curPhase.CanBeSubPhase)
                    {
                        continue;
                    }
                    if (SubPhases == null)
                    {
                        SubPhases = new List <int>();
                    }
                    SubPhases.Add(j);
                    long start = curPhase.Start - phase.Start;
                    long end   = curPhase.End - phase.Start;
                    if (curPhase.DrawStart)
                    {
                        MarkupLines.Add(start / 1000.0);
                    }

                    if (curPhase.DrawEnd)
                    {
                        MarkupLines.Add(end / 1000.0);
                    }

                    var phaseArea = new AreaLabelDto
                    {
                        Start     = start / 1000.0,
                        End       = end / 1000.0,
                        Label     = curPhase.DrawLabel ? curPhase.Name : null,
                        Highlight = curPhase.DrawArea
                    };
                    MarkupAreas.Add(phaseArea);
                }
            }
            if (MarkupAreas.Count == 0)
            {
                MarkupAreas = null;
            }

            if (MarkupLines.Count == 0)
            {
                MarkupLines = null;
            }
            StatisticsHelper statistics = log.StatisticsHelper;

            DpsStats              = PhaseDto.BuildDPSData(log, phase);
            DpsStatsTargets       = PhaseDto.BuildDPSTargetsData(log, phase);
            OffensiveStatsTargets = PhaseDto.BuildOffensiveStatsTargetsData(log, phase);
            OffensiveStats        = PhaseDto.BuildOffensiveStatsData(log, phase);
            GameplayStats         = PhaseDto.BuildGameplayStatsData(log, phase);
            DefStats              = PhaseDto.BuildDefenseData(log, phase);
            SupportStats          = PhaseDto.BuildSupportData(log, phase);
            //
            BoonStats             = BuffData.BuildBuffUptimeData(log, statistics.PresentBoons, phase);
            OffBuffStats          = BuffData.BuildBuffUptimeData(log, statistics.PresentOffbuffs, phase);
            SupBuffStats          = BuffData.BuildBuffUptimeData(log, statistics.PresentSupbuffs, phase);
            DefBuffStats          = BuffData.BuildBuffUptimeData(log, statistics.PresentDefbuffs, phase);
            PersBuffStats         = BuffData.BuildPersonalBuffUptimeData(log, persBuffDict, phase);
            GearBuffStats         = BuffData.BuildBuffUptimeData(log, statistics.PresentGearbuffs, phase);
            DebuffStats           = BuffData.BuildBuffUptimeData(log, statistics.PresentDebuffs, phase);
            ConditionsStats       = BuffData.BuildBuffUptimeData(log, statistics.PresentConditions, phase);
            BoonGenSelfStats      = BuffData.BuildBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Self);
            BoonGenGroupStats     = BuffData.BuildBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Group);
            BoonGenOGroupStats    = BuffData.BuildBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.OffGroup);
            BoonGenSquadStats     = BuffData.BuildBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Squad);
            OffBuffGenSelfStats   = BuffData.BuildBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Self);
            OffBuffGenGroupStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Group);
            OffBuffGenOGroupStats = BuffData.BuildBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.OffGroup);
            OffBuffGenSquadStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Squad);
            SupBuffGenSelfStats   = BuffData.BuildBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Self);
            SupBuffGenGroupStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Group);
            SupBuffGenOGroupStats = BuffData.BuildBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.OffGroup);
            SupBuffGenSquadStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Squad);
            DefBuffGenSelfStats   = BuffData.BuildBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Self);
            DefBuffGenGroupStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Group);
            DefBuffGenOGroupStats = BuffData.BuildBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.OffGroup);
            DefBuffGenSquadStats  = BuffData.BuildBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Squad);
            //
            BoonActiveStats             = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentBoons, phase);
            OffBuffActiveStats          = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentOffbuffs, phase);
            SupBuffActiveStats          = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentSupbuffs, phase);
            DefBuffActiveStats          = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentDefbuffs, phase);
            PersBuffActiveStats         = BuffData.BuildActivePersonalBuffUptimeData(log, persBuffDict, phase);
            GearBuffActiveStats         = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentGearbuffs, phase);
            DebuffActiveStats           = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentDebuffs, phase);
            ConditionsActiveStats       = BuffData.BuildActiveBuffUptimeData(log, statistics.PresentConditions, phase);
            BoonGenActiveSelfStats      = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Self);
            BoonGenActiveGroupStats     = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Group);
            BoonGenActiveOGroupStats    = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.OffGroup);
            BoonGenActiveSquadStats     = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentBoons, phase, BuffEnum.Squad);
            OffBuffGenActiveSelfStats   = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Self);
            OffBuffGenActiveGroupStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Group);
            OffBuffGenActiveOGroupStats = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.OffGroup);
            OffBuffGenActiveSquadStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentOffbuffs, phase, BuffEnum.Squad);
            SupBuffGenActiveSelfStats   = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Self);
            SupBuffGenActiveGroupStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Group);
            SupBuffGenActiveOGroupStats = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.OffGroup);
            SupBuffGenActiveSquadStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentSupbuffs, phase, BuffEnum.Squad);
            DefBuffGenActiveSelfStats   = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Self);
            DefBuffGenActiveGroupStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Group);
            DefBuffGenActiveOGroupStats = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.OffGroup);
            DefBuffGenActiveSquadStats  = BuffData.BuildActiveBuffGenerationData(log, statistics.PresentDefbuffs, phase, BuffEnum.Squad);
            //
            DmgModifiersCommon = DamageModData.BuildDmgModifiersData(log, phase, commonDamageModifiers);
            DmgModifiersItem   = DamageModData.BuildDmgModifiersData(log, phase, itemDamageModifiers);
            DmgModifiersPers   = DamageModData.BuildPersonalDmgModifiersData(log, phase, persDamageModDict);
            TargetsCondiStats  = new List <List <BuffData> >();
            TargetsCondiTotals = new List <BuffData>();
            TargetsBoonTotals  = new List <BuffData>();
            MechanicStats      = MechanicDto.BuildPlayerMechanicData(log, phase);
            EnemyMechanicStats = MechanicDto.BuildEnemyMechanicData(log, phase);

            foreach (AbstractSingleActor target in phase.Targets)
            {
                TargetsCondiStats.Add(BuffData.BuildTargetCondiData(log, phase.Start, phase.End, target));
                TargetsCondiTotals.Add(BuffData.BuildTargetCondiUptimeData(log, phase, target));
                TargetsBoonTotals.Add(BuffData.BuildTargetBoonData(log, phase, target));
            }
        }
        public PhaseDto(PhaseData phaseData, IReadOnlyList <PhaseData> phases, ParsedEvtcLog log)
        {
            Name          = phaseData.Name;
            Duration      = phaseData.DurationInMS;
            Start         = phaseData.Start / 1000.0;
            End           = phaseData.End / 1000.0;
            BreakbarPhase = phaseData.BreakbarPhase;
            foreach (NPC target in phaseData.Targets)
            {
                Targets.Add(log.FightData.Logic.Targets.IndexOf(target));
            }
            PlayerActiveTimes = new List <long>();
            foreach (Player p in log.PlayerList)
            {
                PlayerActiveTimes.Add(p.GetActiveDuration(log, phaseData.Start, phaseData.End));
            }
            // add phase markup
            MarkupLines = new List <double>();
            MarkupAreas = new List <AreaLabelDto>();
            if (!BreakbarPhase)
            {
                for (int j = 1; j < phases.Count; j++)
                {
                    PhaseData curPhase = phases[j];
                    if (curPhase.Start < phaseData.Start || curPhase.End > phaseData.End ||
                        (curPhase.Start == phaseData.Start && curPhase.End == phaseData.End) || !curPhase.CanBeSubPhase)
                    {
                        continue;
                    }
                    if (SubPhases == null)
                    {
                        SubPhases = new List <int>();
                    }
                    SubPhases.Add(j);
                    long start = curPhase.Start - phaseData.Start;
                    long end   = curPhase.End - phaseData.Start;
                    if (curPhase.DrawStart)
                    {
                        MarkupLines.Add(start / 1000.0);
                    }

                    if (curPhase.DrawEnd)
                    {
                        MarkupLines.Add(end / 1000.0);
                    }

                    var phaseArea = new AreaLabelDto
                    {
                        Start     = start / 1000.0,
                        End       = end / 1000.0,
                        Label     = curPhase.DrawLabel ? curPhase.Name : null,
                        Highlight = curPhase.DrawArea
                    };
                    MarkupAreas.Add(phaseArea);
                }
            }
            if (MarkupAreas.Count == 0)
            {
                MarkupAreas = null;
            }

            if (MarkupLines.Count == 0)
            {
                MarkupLines = null;
            }
        }