Example #1
0
        // private getters
        private BoonMap GetBoonMap(ParsedLog log)
        {
            BoonMap boonMap = new BoonMap
            {
                BoonToTrack
            };
            // Fill in Boon Map
            long timeStart  = log.FightData.FightStart;
            long agentStart = Math.Max(FirstAware - log.FightData.FightStart, 0);
            long agentEnd   = Math.Min(LastAware - log.FightData.FightStart, log.FightData.FightDuration);

            foreach (CombatItem c in log.GetBoonDataByDst(InstID))
            {
                long boonId = c.SkillID;
                if (!boonMap.ContainsKey(boonId))
                {
                    continue;
                }
                long           time    = c.Time - timeStart;
                List <BoonLog> loglist = boonMap[boonId];
                if (c.IsStateChange == ParseEnum.StateChange.BuffInitial && c.Value > 0)
                {
                    ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                    loglist.Add(new BoonApplicationLog(0, src, c.Value));
                }
                else if (c.IsStateChange != ParseEnum.StateChange.BuffInitial && time >= agentStart && time < agentEnd)
                {
                    if (c.IsBuffRemove == ParseEnum.BuffRemove.None)
                    {
                        ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                        loglist.Add(new BoonApplicationLog(time, src, c.Value));
                    }
                    else if (c.IsBuffRemove != ParseEnum.BuffRemove.Manual && time < log.FightData.FightDuration - 50)
                    {
                        loglist.Add(new BoonRemovalLog(time, c.DstInstid, c.Value, c.IsBuffRemove));
                    }
                }
            }
            boonMap.Sort();
            return(boonMap);
        }
        protected BoonMap GetBoonMap(ParsedLog log)
        {
            // buff extension ids
            HashSet <long> idsToCheck = new HashSet <long>()
            {
                10236,
                51696,
                29453
            };
            List <CastLog> extensionSkills = new List <CastLog>();

            foreach (Player p in log.PlayerList)
            {
                extensionSkills.AddRange(p.GetCastLogs(log, log.FightData.ToFightSpace(p.FirstAware), log.FightData.ToFightSpace(p.LastAware)).Where(x => idsToCheck.Contains(x.SkillId)));
            }
            //
            BoonMap boonMap = new BoonMap();

            // Fill in Boon Map
            foreach (CombatItem c in log.GetBoonDataByDst(InstID, FirstAware, LastAware))
            {
                long boonId = c.SkillID;
                if (!boonMap.ContainsKey(boonId))
                {
                    if (!Boon.BoonsByIds.ContainsKey(boonId))
                    {
                        continue;
                    }
                    boonMap.Add(Boon.BoonsByIds[boonId]);
                }
                if (c.IsBuffRemove == ParseEnum.BuffRemove.Manual ||
                    (c.IsBuffRemove == ParseEnum.BuffRemove.Single && c.IFF == ParseEnum.IFF.Unknown && c.DstInstid == 0) ||
                    (c.IsBuffRemove != ParseEnum.BuffRemove.None && c.Value <= 50))
                {
                    continue;
                }
                long           time    = log.FightData.ToFightSpace(c.Time);
                List <BoonLog> loglist = boonMap[boonId];
                if (c.IsStateChange == ParseEnum.StateChange.BuffInitial)
                {
                    ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                    loglist.Add(new BoonApplicationLog(time, src, c.Value));
                }
                else if (c.IsStateChange != ParseEnum.StateChange.BuffInitial)
                {
                    if (c.IsBuffRemove == ParseEnum.BuffRemove.None)
                    {
                        ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                        if (c.IsOffcycle > 0)
                        {
                            if (src == 0)
                            {
                                src = TryFindSrc(extensionSkills, time, c.Value, log);
                            }
                            loglist.Add(new BoonExtensionLog(time, c.Value, c.OverstackValue - c.Value, src));
                        }
                        else
                        {
                            loglist.Add(new BoonApplicationLog(time, src, c.Value));
                        }
                    }
                    else if (time < log.FightData.FightDuration - 50)
                    {
                        ushort src = c.DstMasterInstid > 0 ? c.DstMasterInstid : c.DstInstid;
                        loglist.Add(new BoonRemovalLog(time, src, c.Value, c.IsBuffRemove));
                    }
                }
            }
            //boonMap.Sort();
            foreach (var pair in boonMap)
            {
                TrackedBoons.Add(Boon.BoonsByIds[pair.Key]);
            }
            return(boonMap);
        }
Example #3
0
        // private getters
        private BoonMap getBoonMap(ParsedLog log, List <Boon> to_track)
        {
            BoonMap boon_map = new BoonMap();

            boon_map.add(to_track);
            // Fill in Boon Map
            long time_start = log.getBossData().getFirstAware();

            foreach (CombatItem c in log.getBoonData())
            {
                if (!boon_map.ContainsKey(c.getSkillID()))
                {
                    continue;
                }
                long   time = c.getTime() - time_start;
                ushort dst  = c.isBuffremove() == ParseEnum.BuffRemove.None ? c.getDstInstid() : c.getSrcInstid();
                if (agent.getInstid() == dst && time > 0 && time < log.getBossData().getAwareDuration())
                {
                    ushort src = c.getSrcMasterInstid() > 0 ? c.getSrcMasterInstid() : c.getSrcInstid();
                    if (c.isBuffremove() == ParseEnum.BuffRemove.None)
                    {
                        boon_map[c.getSkillID()].Add(new BoonLog(time, src, c.getValue(), 0));
                    }
                    else if (Boon.removePermission(c.getSkillID(), c.isBuffremove(), c.getIFF()))
                    {
                        if (c.isBuffremove() == ParseEnum.BuffRemove.All)//All
                        {
                            List <BoonLog> loglist = boon_map[c.getSkillID()];
                            for (int cnt = loglist.Count() - 1; cnt >= 0; cnt--)
                            {
                                BoonLog curBL = loglist[cnt];
                                if (curBL.getTime() + curBL.getValue() > time)
                                {
                                    long subtract = (curBL.getTime() + curBL.getValue()) - time;
                                    loglist[cnt].addValue(-subtract);
                                    // add removed as overstack
                                    loglist[cnt].addOverstack((ushort)subtract);
                                }
                            }
                        }
                        else if (c.isBuffremove() == ParseEnum.BuffRemove.Single)//Single
                        {
                            List <BoonLog> loglist = boon_map[c.getSkillID()];
                            int            cnt     = loglist.Count() - 1;
                            BoonLog        curBL   = loglist[cnt];
                            if (curBL.getTime() + curBL.getValue() > time)
                            {
                                long subtract = (curBL.getTime() + curBL.getValue()) - time;
                                loglist[cnt].addValue(-subtract);
                                // add removed as overstack
                                loglist[cnt].addOverstack((ushort)subtract);
                            }
                        }
                        else if (c.isBuffremove() == ParseEnum.BuffRemove.Manual)//Manuel
                        {
                            List <BoonLog> loglist = boon_map[c.getSkillID()];
                            for (int cnt = loglist.Count() - 1; cnt >= 0; cnt--)
                            {
                                BoonLog curBL = loglist[cnt];
                                long    ctime = curBL.getTime() + curBL.getValue();
                                if (ctime > time)
                                {
                                    long subtract = (curBL.getTime() + curBL.getValue()) - time;
                                    loglist[cnt].addValue(-subtract);
                                    // add removed as overstack
                                    loglist[cnt].addOverstack((ushort)subtract);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            return(boon_map);
        }
Example #4
0
        protected BoonMap GetBoonMap(ParsedLog log)
        {
            // buff extension ids
            BoonSourceFinder sourceFinder = log.BoonSourceFinder;
            //
            BoonMap boonMap = new BoonMap();

            // Fill in Boon Map
            foreach (CombatItem c in log.CombatData.GetBoonDataByDst(InstID, FirstAware, LastAware))
            {
                long boonId = c.SkillID;
                if (!boonMap.ContainsKey(boonId))
                {
                    if (!log.Boons.BoonsByIds.ContainsKey(boonId))
                    {
                        continue;
                    }
                    boonMap.Add(log.Boons.BoonsByIds[boonId]);
                }
                if (c.IsBuffRemove == ParseEnum.BuffRemove.Manual || // don't check manuals
                    (c.IsBuffRemove == ParseEnum.BuffRemove.Single && c.IFF == ParseEnum.IFF.Unknown && c.DstInstid == 0) || // weird single remove
                    (c.IsBuffRemove == ParseEnum.BuffRemove.Single && c.Value <= 50) ||
                    (c.IsBuffRemove == ParseEnum.BuffRemove.All && c.Value <= 50 && c.BuffDmg <= 50))    // don't take into account low value buff removals, with server delays it can mess up some stuff
                {
                    continue;
                }
                long           time    = log.FightData.ToFightSpace(c.Time);
                List <BoonLog> loglist = boonMap[boonId];
                if (c.IsStateChange == ParseEnum.StateChange.BuffInitial)
                {
                    ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                    loglist.Add(new BoonApplicationLog(time, log.AgentData.GetAgentByInstID(src, c.Time), c.Value));
                }
                else if (c.IsStateChange != ParseEnum.StateChange.BuffInitial)
                {
                    if (c.IsBuffRemove == ParseEnum.BuffRemove.None)
                    {
                        ushort src = c.SrcMasterInstid > 0 ? c.SrcMasterInstid : c.SrcInstid;
                        if (c.IsOffcycle > 0)
                        {
                            if (src == 0)
                            {
                                src = sourceFinder.TryFindSrc(this, time, c.Value, log, boonId);
                            }
                            loglist.Add(new BoonExtensionLog(time, c.Value, c.OverstackValue - c.Value, log.AgentData.GetAgentByInstID(src, c.Time)));
                        }
                        else
                        {
                            loglist.Add(new BoonApplicationLog(time, log.AgentData.GetAgentByInstID(src, c.Time), c.Value));
                        }
                    }
                    else if (time < log.FightData.FightDuration - 50)
                    {
                        ushort src = c.DstMasterInstid > 0 ? c.DstMasterInstid : c.DstInstid;
                        loglist.Add(new BoonRemovalLog(time, log.AgentData.GetAgentByInstID(src, c.Time), c.Value, c.IsBuffRemove));
                    }
                }
            }
            //boonMap.Sort();
            foreach (var pair in boonMap)
            {
                TrackedBoons.Add(log.Boons.BoonsByIds[pair.Key]);
            }
            return(boonMap);
        }