Exemple #1
0
        public Statistics(CombatData combatData, AgentData agentData, FightData fightData, List <Player> players, BoonsContainer boons)
        {
            HashSet <long> skillIDs = combatData.GetSkills();

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

            // Important class specific boons
            foreach (Boon boon in boons.BoonsByNature[BoonNature.OffensiveBuffTable])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentOffbuffs.Add(boon);
                }
            }

            foreach (Boon boon in boons.BoonsByNature[BoonNature.DefensiveBuffTable])
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentDefbuffs.Add(boon);
                }
            }

            // All class specific boons
            Dictionary <long, Boon> remainingBuffsByIds = boons.BoonsByNature[BoonNature.GraphOnlyBuff].GroupBy(x => x.ID).ToDictionary(x => x.Key, x => x.ToList().FirstOrDefault());

            foreach (Player player in players)
            {
                PresentPersonalBuffs[player.InstID] = new HashSet <Boon>();
                foreach (AbstractBuffEvent item in combatData.GetBoonDataByDst(player.AgentItem))
                {
                    if (item is BuffApplyEvent && item.To == player.AgentItem && remainingBuffsByIds.TryGetValue(item.BuffID, out Boon boon))
                    {
                        PresentPersonalBuffs[player.InstID].Add(boon);
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Checks the combat data and gets buffs that were present during the fight
        /// </summary>
        private void SetPresentBoons(HashSet <long> skillIDs, List <Player> players, CombatData combatData, BoonsContainer boons)
        {
            // Main boons
            foreach (Boon boon in boons.GetBoonList())
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentBoons.Add(boon);
                }
            }
            // Main Conditions
            foreach (Boon boon in boons.GetCondiBoonList())
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentConditions.Add(boon);
                }
            }

            // Important class specific boons
            foreach (Boon boon in boons.GetOffensiveTableList())
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentOffbuffs.Add(boon);
                }
            }

            foreach (Boon boon in boons.GetDefensiveTableList())
            {
                if (skillIDs.Contains(boon.ID))
                {
                    PresentDefbuffs.Add(boon);
                }
            }

            // All class specific boons
            Dictionary <long, Boon> remainingBuffsByIds = boons.GetRemainingBuffsList().GroupBy(x => x.ID).ToDictionary(x => x.Key, x => x.ToList().FirstOrDefault());

            foreach (Player player in players)
            {
                PresentPersonalBuffs[player.InstID] = new HashSet <Boon>();
                foreach (CombatItem item in combatData.GetBoonDataByDst(player.InstID, player.FirstAware, player.LastAware))
                {
                    if (item.DstInstid == player.InstID && item.IsBuffRemove == ParseEnum.BuffRemove.None && remainingBuffsByIds.TryGetValue(item.SkillID, out Boon boon))
                    {
                        PresentPersonalBuffs[player.InstID].Add(boon);
                    }
                }
            }
        }
 public List <CombatItem> GetBoonDataByDst(ushort key, long start, long end)
 {
     return(CombatData.GetBoonDataByDst(key, start, end));
 }
Exemple #4
0
 public List <CombatItem> GetBoonDataByDst(ushort key)
 {
     return(CombatData.GetBoonDataByDst(key));
 }