Beispiel #1
0
        protected override void SetCastLogs(ParsedLog log)
        {
            CastLog curCastLog = null;
            long    minTime    = Math.Max(log.FightData.FightStart, AgentItem.FirstAware);
            long    maxTime    = Math.Min(log.FightData.FightEnd, AgentItem.LastAware);

            foreach (CombatItem c in log.GetCastData(AgentItem.InstID))
            {
                if (!(c.Time >= minTime))
                {
                    continue;
                }
                ParseEnum.StateChange state = c.IsStateChange;
                if (state == ParseEnum.StateChange.Normal)
                {
                    if (c.IsActivation.IsCasting() && c.Time <= maxTime)
                    {
                        long time = log.FightData.ToFightSpace(c.Time);
                        curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation);
                        CastLogs.Add(curCastLog);
                    }
                    else
                    {
                        if (curCastLog != null)
                        {
                            if (curCastLog.SkillId == c.SkillID)
                            {
                                curCastLog.SetEndStatus(c.Value, c.IsActivation, log.FightData.FightDuration);
                                curCastLog = null;
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public void AddCustomCastLog(CastLog cl, ParsedLog log)
 {
     if (CastLogs.Count == 0)
     {
         GetCastLogs(log, 0, log.FightData.FightEnd);
     }
     CastLogs.Add(cl);
 }
 public override List <AbstractCastEvent> GetIntersectingCastLogs(ParsedLog log, long start, long end)
 {
     if (CastLogs == null)
     {
         InitCastLogs(log);
     }
     return(CastLogs.Where(x => KeepIntersectingCastLog(x, start, end)).ToList());
 }
 public override List <AbstractCastEvent> GetCastLogs(ParsedLog log, long start, long end)
 {
     if (CastLogs == null)
     {
         InitCastLogs(log);
     }
     return(CastLogs.Where(x => x.Time >= start && x.Time <= end).ToList());
 }
 public override List <AbstractCastEvent> GetCastLogsActDur(ParsedLog log, long start, long end)
 {
     if (CastLogs == null)
     {
         CastLogs = new List <AbstractCastEvent>();
         foreach (NPC minion in MinionList)
         {
             CastLogs.AddRange(minion.GetCastLogs(log, 0, log.FightData.FightEnd));
         }
         CastLogs.Sort((x, y) => x.Time.CompareTo(y.Time));
     }
     return(CastLogs.Where(x => x.Time >= start && x.Time + x.ActualDuration <= end).ToList());
 }
Beispiel #6
0
        protected override void SetCastLogs(ParsedLog log)
        {
            long    agentStart = Math.Max(FirstAware, log.FightData.FightStart);
            long    agentEnd   = Math.Min(LastAware, log.FightData.FightEnd);
            long    timeStart  = log.FightData.FightStart;
            CastLog curCastLog = null;

            foreach (CombatItem c in log.GetCastData(AgentItem.InstID))
            {
                if (!(c.Time > agentStart))
                {
                    continue;
                }
                ParseEnum.StateChange state = c.IsStateChange;
                if (state == ParseEnum.StateChange.Normal)
                {
                    if (c.IsActivation.IsCasting() && c.Time < agentEnd)
                    {
                        long time = c.Time - timeStart;
                        curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation);
                        CastLogs.Add(curCastLog);
                    }
                    else
                    {
                        if (curCastLog != null)
                        {
                            if (curCastLog.SkillId == c.SkillID)
                            {
                                curCastLog.SetEndStatus(c.Value, c.IsActivation);
                                curCastLog = null;
                            }
                        }
                    }
                }
                else if (state == ParseEnum.StateChange.WeaponSwap && c.Time < agentEnd)
                {
                    long    time    = c.Time - timeStart;
                    CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation);
                    CastLogs.Add(swapLog);
                }
            }
        }
Beispiel #7
0
        protected override void SetCastLogs(ParsedLog log)
        {
            CastLog curCastLog = null;

            foreach (CombatItem c in log.GetCastData(AgentItem.InstID))
            {
                if (!(c.Time >= FirstAware))
                {
                    continue;
                }
                ParseEnum.StateChange state = c.IsStateChange;
                if (state == ParseEnum.StateChange.Normal)
                {
                    if (c.IsActivation.IsCasting() && c.Time <= LastAware)
                    {
                        // Missing end activation
                        if (curCastLog != null)
                        {
                            int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : curCastLog.SkillId == SkillItem.WeaponSwapId ? 50 : curCastLog.ExpectedDuration;
                            curCastLog.SetEndStatus(actDur, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                            curCastLog = null;
                        }
                        long time = log.FightData.ToFightSpace(c.Time);
                        curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation);
                        CastLogs.Add(curCastLog);
                    }
                    else
                    {
                        if (curCastLog != null)
                        {
                            if (curCastLog.SkillId == c.SkillID)
                            {
                                int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : curCastLog.SkillId == SkillItem.WeaponSwapId ? 50 : c.Value;
                                curCastLog.SetEndStatus(actDur, c.IsActivation, log.FightData.FightDuration);
                                curCastLog = null;
                            }
                        }
                    }
                }
                else if (state == ParseEnum.StateChange.WeaponSwap && c.Time <= LastAware)
                {
                    long    time    = log.FightData.ToFightSpace(c.Time);
                    CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation);
                    if (CastLogs.Count > 0 && (time - CastLogs.Last().Time) < 10 && CastLogs.Last().SkillId == SkillItem.WeaponSwapId)
                    {
                        CastLogs[CastLogs.Count - 1] = swapLog;
                    }
                    else
                    {
                        CastLogs.Add(swapLog);
                    }
                }
            }
            long cloakStart = 0;

            foreach (long time in log.CombatData.GetBuffs(InstID, 40408, FirstAware, LastAware).Select(x => log.FightData.ToFightSpace(x.Time)))
            {
                if (time - cloakStart > 10)
                {
                    CastLog dodgeLog = new CastLog(time, SkillItem.DodgeId, 0, ParseEnum.Activation.Unknown);
                    dodgeLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                    CastLogs.Add(dodgeLog);
                }
                cloakStart = time;
            }
            CastLogs.Sort((x, y) => x.Time < y.Time ? -1 : 1);
        }