Esempio n. 1
0
        /*public void AddCustomCastLog(long time, long skillID, int expDur, ParseEnum.Activation startActivation, int actDur, ParseEnum.Activation endActivation, ParsedLog log)
         * {
         *  if (CastLogs.Count == 0)
         *  {
         *      GetCastLogs(log, 0, log.FightData.FightEnd);
         *  }
         *  CastLogs.Add(new CastLog(time, skillID, expDur, startActivation, actDur, endActivation, Agent, InstID));
         * }*/

        private void SetAvgBoonsConditions(ParsedLog log)
        {
            _avgBoons      = new List <double>();
            _avgConditions = new List <double>();
            for (int phaseIndex = 0; phaseIndex < log.FightData.GetPhases(log).Count; phaseIndex++)
            {
                PhaseData phase   = log.FightData.GetPhases(log)[phaseIndex];
                double    avgBoon = 0;
                foreach (long duration in GetBuffPresence(log, phaseIndex).Where(x => log.Boons.BoonsByIds[x.Key].Nature == Boon.BoonNature.Boon).Select(x => x.Value))
                {
                    avgBoon += duration;
                }
                avgBoon /= phase.DurationInMS;
                _avgBoons.Add(Math.Round(avgBoon, GeneralHelper.BoonDigit));

                double avgCondi = 0;
                foreach (long duration in GetBuffPresence(log, phaseIndex).Where(x => log.Boons.BoonsByIds[x.Key].Nature == Boon.BoonNature.Condition).Select(x => x.Value))
                {
                    avgCondi += duration;
                }
                avgCondi /= phase.DurationInMS;
                _avgConditions.Add(Math.Round(avgCondi, GeneralHelper.BoonDigit));
            }
        }
Esempio n. 2
0
 public List <AbstractDamageEvent> GetJustPlayerDamageLogs(AbstractActor target, ParsedLog log, PhaseData phase)
 {
     if (!_selfDamageLogsPerPhasePerTarget.TryGetValue(phase, out Dictionary <AbstractActor, List <AbstractDamageEvent> > targetDict))
     {
         targetDict = new Dictionary <AbstractActor, List <AbstractDamageEvent> >();
         _selfDamageLogsPerPhasePerTarget[phase] = targetDict;
     }
     if (!targetDict.TryGetValue(target ?? GeneralHelper.NullActor, out List <AbstractDamageEvent> dls))
     {
         dls = GetDamageLogs(target, log, phase).Where(x => x.From == AgentItem).ToList();
         targetDict[target ?? GeneralHelper.NullActor] = dls;
     }
     return(dls);
 }
Esempio n. 3
0
        protected FinalDPS GetFinalDPS(ParsedLog log, PhaseData phase, Target target)
        {
            double   phaseDuration = (phase.DurationInMS) / 1000.0;
            int      damage;
            double   dps   = 0.0;
            FinalDPS final = new FinalDPS();

            //DPS
            damage = GetDamageLogs(target, log, phase).Sum(x => x.Damage);

            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.Dps    = (int)Math.Round(dps);
            final.Damage = damage;
            //Condi DPS
            damage = GetDamageLogs(target, log, phase).Sum(x => x.IsCondi(log) ? x.Damage : 0);

            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.CondiDps    = (int)Math.Round(dps);
            final.CondiDamage = damage;
            //Power DPS
            damage = final.Damage - final.CondiDamage;
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.PowerDps    = (int)Math.Round(dps);
            final.PowerDamage = damage;
            // Actor DPS
            damage = GetJustPlayerDamageLogs(target, log, phase).Sum(x => x.Damage);

            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.ActorDps    = (int)Math.Round(dps);
            final.ActorDamage = damage;
            //Actor Condi DPS
            damage = GetJustPlayerDamageLogs(target, log, phase).Sum(x => x.IsCondi(log) ? x.Damage : 0);

            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.ActorCondiDps    = (int)Math.Round(dps);
            final.ActorCondiDamage = damage;
            //Actor Power DPS
            damage = final.ActorDamage - final.ActorCondiDamage;
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }
            final.ActorPowerDps    = (int)Math.Round(dps);
            final.ActorPowerDamage = damage;
            return(final);
        }
Esempio n. 4
0
 public List <AbstractDamageEvent> GetDamageLogs(AbstractActor target, ParsedLog log, PhaseData phase)
 {
     if (!_damageLogsPerPhasePerTarget.TryGetValue(phase, out Dictionary <AbstractActor, List <AbstractDamageEvent> > targetDict))
     {
         targetDict = new Dictionary <AbstractActor, List <AbstractDamageEvent> >();
         _damageLogsPerPhasePerTarget[phase] = targetDict;
     }
     if (!targetDict.TryGetValue(target ?? GeneralHelper.NullActor, out List <AbstractDamageEvent> dls))
     {
         dls = GetDamageLogs(target, log, phase.Start, phase.End);
         targetDict[target ?? GeneralHelper.NullActor] = dls;
     }
     return(dls);
 }
Esempio n. 5
0
        public List <AbstractDamageEvent> GetDamageLogs(Player p, ParsedLog log, Target t, PhaseData phase)
        {
            switch (_srcType)
            {
            case DamageType.All:
                return(_dmgSrc == DamageSource.All ? p.GetDamageLogs(t, log, phase) : p.GetJustPlayerDamageLogs(t, log, phase));

            case DamageType.Condition:
                return((_dmgSrc == DamageSource.All ? p.GetDamageLogs(t, log, phase) : p.GetJustPlayerDamageLogs(t, log, phase)).Where(x => x.IsCondi(log)).ToList());

            case DamageType.Power:
            default:
                return((_dmgSrc == DamageSource.All ? p.GetDamageLogs(t, log, phase) : p.GetJustPlayerDamageLogs(t, log, phase)).Where(x => !x.IsCondi(log)).ToList());
            }
        }