protected void AddTargetsToPhaseAndFit(PhaseData phase, List <int> ids, ParsedEvtcLog log)
 {
     foreach (NPC target in Targets)
     {
         if (ids.Contains(target.ID) && phase.InInterval(Math.Max(target.FirstAware, 0)))
         {
             phase.AddTarget(target);
         }
     }
     phase.OverrideTimes(log);
 }
 protected void AddTargetsToPhase(PhaseData phase, List <ushort> ids, ParsedLog log)
 {
     foreach (Target target in Targets)
     {
         if (ids.Contains(target.ID) && phase.InInterval(Math.Max(log.FightData.ToFightSpace(target.FirstAware), 0)))
         {
             phase.Targets.Add(target);
         }
     }
     phase.OverrideTimes(log);
 }
 protected void AddTargetsToPhase(PhaseData phase, List <ushort> ids, ParsedLog log)
 {
     foreach (Boss target in Targets)
     {
         if (ids.Contains(target.ID) && phase.InInterval(target.FirstAware, log.FightData.FightStart))
         {
             phase.Targets.Add(target);
         }
     }
     phase.OverrideTimes(log.FightData.FightStart);
 }
Example #4
0
        public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases)
        {
            long             start         = 0;
            long             end           = 0;
            long             fightDuration = log.FightData.FightDuration;
            List <PhaseData> phases        = GetInitialPhase(log);
            Target           mainTarget    = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.Deimos);

            if (mainTarget == null)
            {
                throw new InvalidOperationException("Main target of the fight not found");
            }
            phases[0].Targets.Add(mainTarget);
            if (!requirePhases)
            {
                return(phases);
            }
            // Determined + additional data on inst change
            CombatItem invulDei = log.CombatData.GetBoonData(762).Find(x => x.IsBuffRemove == ParseEnum.BuffRemove.None && x.DstInstid == mainTarget.InstID);

            if (invulDei != null)
            {
                end = log.FightData.ToFightSpace(invulDei.Time);
                phases.Add(new PhaseData(start, end));
                start = (_specialSplit > 0 ? log.FightData.ToFightSpace(_specialSplit) : fightDuration);
                //mainTarget.AddCustomCastLog(end, -6, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None, log);
            }
            if (fightDuration - start > 5000 && start >= phases.Last().End)
            {
                phases.Add(new PhaseData(start, fightDuration));
            }
            string[] names = { "100% - 10%", "10% - 0%" };
            for (int i = 1; i < phases.Count; i++)
            {
                phases[i].Name = names[i - 1];
                phases[i].Targets.Add(mainTarget);
            }
            foreach (Target tar in Targets)
            {
                if (tar.ID == (ushort)Thief || tar.ID == (ushort)Drunkard || tar.ID == (ushort)Gambler)
                {
                    string    name     = (tar.ID == (ushort)Thief ? "Thief" : (tar.ID == (ushort)Drunkard ? "Drunkard" : (tar.ID == (ushort)Gambler ? "Gambler" : "")));
                    PhaseData tarPhase = new PhaseData(log.FightData.ToFightSpace(tar.FirstAware) - 1000, log.FightData.ToFightSpace(tar.LastAware) + 1000);
                    tarPhase.Targets.Add(tar);
                    tarPhase.OverrideTimes(log);
                    // override first then add Deimos so that it does not disturb the override process
                    tarPhase.Targets.Add(mainTarget);
                    tarPhase.Name = name;
                    phases.Add(tarPhase);
                }
            }

            /*
             * List<CombatItem> signets = GetFilteredList(log, 38224, mainTarget, true);
             * long sigStart = 0;
             * long sigEnd = 0;
             * int burstID = 1;
             * for (int i = 0; i < signets.Count; i++)
             * {
             *  CombatItem signet = signets[i];
             *  if (signet.IsBuffRemove == ParseEnum.BuffRemove.None)
             *  {
             *      sigStart = log.FightData.ToFightSpace(signet.Time);
             *  }
             *  else
             *  {
             *      sigEnd = log.FightData.ToFightSpace(signet.Time);
             *      PhaseData burstPhase = new PhaseData(sigStart, sigEnd)
             *      {
             *          Name = "Burst " + burstID++
             *      };
             *      burstPhase.Targets.Add(mainTarget);
             *      phases.Add(burstPhase);
             *  }
             * }*/
            phases.Sort((x, y) => x.Start.CompareTo(y.Start));
            phases.RemoveAll(x => x.Targets.Count == 0);
            return(phases);
        }
        public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases)
        {
            long             start         = 0;
            long             end           = 0;
            long             fightDuration = log.FightData.FightEnd;
            List <PhaseData> phases        = GetInitialPhase(log);
            NPC mainTarget = Targets.Find(x => x.ID == (int)ParseEnum.TargetIDS.Deimos);

            if (mainTarget == null)
            {
                throw new InvalidOperationException("Deimos not found");
            }
            phases[0].Targets.Add(mainTarget);
            if (!requirePhases)
            {
                return(phases);
            }
            // Determined + additional data on inst change
            AbstractBuffEvent invulDei = log.CombatData.GetBuffData(762).Find(x => x is BuffApplyEvent && x.To == mainTarget.AgentItem);

            if (invulDei != null)
            {
                end = invulDei.Time;
                phases.Add(new PhaseData(start, end));
                start = _specialSplit > 0 ? _specialSplit : fightDuration;
                //mainTarget.AddCustomCastLog(end, -6, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None, log);
            }
            else if (_specialSplit > 0)
            {
                long specialTime = _specialSplit;
                end = specialTime;
                phases.Add(new PhaseData(start, end));
                start = specialTime;
            }
            if (fightDuration - start > GeneralHelper.PhaseTimeLimit && start >= phases.Last().End)
            {
                phases.Add(new PhaseData(start, fightDuration));
            }
            string[] names = { "100% - 10%", "10% - 0%" };
            for (int i = 1; i < phases.Count; i++)
            {
                phases[i].Name = names[i - 1];
                phases[i].Targets.Add(mainTarget);
            }
            foreach (NPC tar in Targets)
            {
                if (tar.ID == (int)Thief || tar.ID == (int)Drunkard || tar.ID == (int)Gambler)
                {
                    string name     = (tar.ID == (int)Thief ? "Thief" : (tar.ID == (int)Drunkard ? "Drunkard" : (tar.ID == (int)Gambler ? "Gambler" : "")));
                    var    tarPhase = new PhaseData(tar.FirstAware - 1000, Math.Min(tar.LastAware + 1000, fightDuration), name);
                    tarPhase.Targets.Add(tar);
                    tarPhase.OverrideTimes(log);
                    // override first then add Deimos so that it does not disturb the override process
                    tarPhase.Targets.Add(mainTarget);
                    phases.Add(tarPhase);
                }
            }
            List <AbstractBuffEvent> signets = GetFilteredList(log.CombatData, 38224, mainTarget, true);
            long sigStart = 0;
            long sigEnd   = 0;
            int  burstID  = 1;

            for (int i = 0; i < signets.Count; i++)
            {
                AbstractBuffEvent signet = signets[i];
                if (signet is BuffApplyEvent)
                {
                    sigStart = Math.Max(signet.Time + 1, 0);
                }
                else
                {
                    sigEnd = Math.Min(signet.Time - 1, fightDuration);
                    var burstPhase = new PhaseData(sigStart, sigEnd, "Burst " + burstID++);
                    burstPhase.Targets.Add(mainTarget);
                    phases.Add(burstPhase);
                }
            }
            phases.Sort((x, y) => x.Start.CompareTo(y.Start));
            return(phases);
        }