public GeneralStatistics(CombatData combatData, List <Player> players, BuffsContainer boons)
        {
            HashSet <long> skillIDs = combatData.GetSkills();

            // Main boons
            foreach (Buff boon in boons.BuffsByNature[BuffNature.Boon])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentBoons.Add(boon);
                }
            }
            // Main Conditions
            foreach (Buff boon in boons.BuffsByNature[BuffNature.Condition])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentConditions.Add(boon);
                }
            }

            // Important class specific boons
            foreach (Buff boon in boons.BuffsByNature[BuffNature.OffensiveBuffTable])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentOffbuffs.Add(boon);
                }
            }

            foreach (Buff boon in boons.BuffsByNature[BuffNature.DefensiveBuffTable])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentDefbuffs.Add(boon);
                }
            }

            // All class specific boons
            var remainingBuffsByIds = boons.BuffsByNature[BuffNature.GraphOnlyBuff].GroupBy(x => x.ID).ToDictionary(x => x.Key, x => x.ToList().FirstOrDefault());

            foreach (Player player in players)
            {
                PresentPersonalBuffs[player] = new HashSet <Buff>();
                foreach (AbstractBuffEvent item in combatData.GetBuffDataByDst(player.AgentItem))
                {
                    if (item is BuffApplyEvent && item.To == player.AgentItem && remainingBuffsByIds.TryGetValue(item.BuffID, out Buff boon))
                    {
                        PresentPersonalBuffs[player].Add(boon);
                    }
                }
            }
        }
        internal override FightData.CMStatus IsCM(CombatData combatData, AgentData agentData, FightData fightData)
        {
            AbstractSingleActor target = Targets.FirstOrDefault(x => x.ID == (int)ArcDPSEnums.TargetID.Skorvald);

            if (target == null)
            {
                throw new MissingKeyActorsException("Skorvald not found");
            }
            if (combatData.GetBuildEvent().Build >= 106277)
            {
                // Agent check not reliable, produces false positives and regular false negatives

                /*if (agentData.GetNPCsByID(16725).Any() && agentData.GetNPCsByID(11245).Any())
                 * {
                 *  return FightData.CMStatus.CM;
                 * }*/
                // Check some CM skills instead, not perfect but helps,
                // Solar Bolt is the first thing he tries to cast, that looks very consistent
                // If the phase 1 is super fast to the point skorvald does not cast anything, supernova should be there
                // Otherwise we are looking at a super fast phase 1 (< 7 secondes) where the team ggs just before supernova
                // Joining the encounter mid fight may also yield a false negative but at that point the log is incomplete already
                var cmSkills = new HashSet <long>
                {
                    39313, // CM Solar Bolt
                    39225, // CM Supernova
                };
                if (combatData.GetSkills().Intersect(cmSkills).Any())
                {
                    return(FightData.CMStatus.CM);
                }
                return(FightData.CMStatus.NoCM);
            }
            else
            {
                return((target.GetHealth(combatData) == 5551340) ? FightData.CMStatus.CM : FightData.CMStatus.NoCM);
            }
        }
        internal StatisticsHelper(CombatData combatData, IReadOnlyList <Player> players, BuffsContainer buffs)
        {
            IReadOnlyCollection <long> skillIDs = combatData.GetSkills();

            // Main boons
            foreach (Buff boon in buffs.BuffsByNature[BuffNature.Boon])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    _presentBoons.Add(boon);
                }
            }
            // Main Conditions
            foreach (Buff condition in buffs.BuffsByNature[BuffNature.Condition])
            {
                if (skillIDs.Contains(condition.ID))
                {
                    _presentConditions.Add(condition);
                }
            }

            // Important class specific boons
            foreach (Buff offensiveBuff in buffs.BuffsByNature[BuffNature.OffensiveBuffTable])
            {
                if (skillIDs.Contains(offensiveBuff.ID))
                {
                    _presentOffbuffs.Add(offensiveBuff);
                }
            }

            foreach (Buff supportBuff in buffs.BuffsByNature[BuffNature.SupportBuffTable])
            {
                if (skillIDs.Contains(supportBuff.ID))
                {
                    _presentSupbuffs.Add(supportBuff);
                }
            }

            foreach (Buff defensiveBuff in buffs.BuffsByNature[BuffNature.DefensiveBuffTable])
            {
                if (skillIDs.Contains(defensiveBuff.ID))
                {
                    _presentDefbuffs.Add(defensiveBuff);
                }
            }

            foreach (Buff gearBuff in buffs.BuffsByNature[BuffNature.GearBuffTable])
            {
                if (skillIDs.Contains(gearBuff.ID))
                {
                    _presentGearbuffs.Add(gearBuff);
                }
            }

            foreach (Buff fractalInstability in buffs.BuffsBySource[ParserHelper.Source.FractalInstability])
            {
                if (skillIDs.Contains(fractalInstability.ID))
                {
                    _presentFractalInstabilities.Add(fractalInstability);
                }
            }

            // All class specific boons
            var remainingBuffsByIds = buffs.BuffsByNature[BuffNature.GraphOnlyBuff].GroupBy(x => x.ID).ToDictionary(x => x.Key, x => x.ToList().FirstOrDefault());

            foreach (Player player in players)
            {
                _presentRemainingBuffsPerPlayer[player] = new HashSet <Buff>();
                foreach (AbstractBuffEvent item in combatData.GetBuffData(player.AgentItem))
                {
                    if (item is BuffApplyEvent && item.To == player.AgentItem && remainingBuffsByIds.TryGetValue(item.BuffID, out Buff boon))
                    {
                        _presentRemainingBuffsPerPlayer[player].Add(boon);
                    }
                }
            }
        }
 internal override FightData.EncounterMode GetEncounterMode(CombatData combatData, AgentData agentData, FightData fightData)
 {
     return(combatData.GetSkills().Contains(38098) ? FightData.EncounterMode.CM : FightData.EncounterMode.Normal);
 }
Exemple #5
0
 internal override FightData.CMStatus IsCM(CombatData combatData, AgentData agentData, FightData fightData)
 {
     return(combatData.GetSkills().Contains(38098) ? FightData.CMStatus.CM : FightData.CMStatus.NoCM);
 }
Exemple #6
0
 public override int IsCM(CombatData combatData, AgentData agentData, FightData fightData)
 {
     return(combatData.GetSkills().Contains(38098) ? 1 : 0);
 }