Exemple #1
0
        private void setRotation(ParsedLog log, bool icons)
        {
            List <CastLog> cls = getCastLogs(log, 0, log.getBossData().getAwareDuration());

            foreach (CastLog cl in cls)
            {
                RotationItem rot = new RotationItem();
                rot.findName(log.getSkillData(), cl.getID());
                rot.setDuration(cl.getActDur());
                rot.setEndStatus(cl.endActivation());
                rot.setStartStatus(cl.startActivation());
            }
        }
        /// <summary>
        /// Checks the combat data and gets buffs that were present during the fight
        /// </summary>
        private void setPresentBoons()
        {
            List <SkillItem> s_list = log.getSkillData().getSkillList();

            if (settings.PlayerBoonsUniversal)
            {//Main boons
                foreach (Boon boon in Boon.getBoonList())
                {
                    if (s_list.Exists(x => x.getID() == boon.getID()))
                    {
                        statistics.present_boons.Add(boon);
                    }
                }
            }
            if (settings.PlayerBoonsImpProf)
            {//Important Class specefic boons
                foreach (Boon boon in Boon.getOffensiveTableList())
                {
                    if (s_list.Exists(x => x.getID() == boon.getID()))
                    {
                        statistics.present_offbuffs.Add(boon);
                    }
                }
                foreach (Boon boon in Boon.getDefensiveTableList())
                {
                    if (s_list.Exists(x => x.getID() == boon.getID()))
                    {
                        statistics.present_defbuffs.Add(boon);
                    }
                }
            }
            List <CombatItem> c_list = log.getCombatData().getCombatList();

            foreach (Player p in log.getPlayerList())
            {
                statistics.present_personnal[p.getInstid()] = new List <Boon>();
                if (settings.PlayerBoonsAllProf)
                {//All class specefic boons
                    foreach (Boon boon in Boon.getRemainingBuffsList())
                    {
                        if (c_list.Exists(x => x.getSkillID() == boon.getID() && x.getDstInstid() == p.getInstid()))
                        {
                            statistics.present_personnal[p.getInstid()].Add(boon);
                        }
                    }
                }
            }
        }
        // Private Methods
        private void EstimateWeapons(ParsedLog log)
        {
            string[]         weapons   = new string[4];//first 2 for first set next 2 for second set
            List <SkillItem> s_list    = log.getSkillData().getSkillList();
            List <CastLog>   casting   = getCastLogs(log, 0, log.getBossData().getAwareDuration());
            int            swapped     = 0;//4 for first set and 5 for next
            long           swappedTime = 0;
            List <CastLog> swaps       = casting.Where(x => x.getID() == -2).Take(2).ToList();

            // If the player never swapped, assume they are on their first set
            if (swaps.Count == 0)
            {
                swapped = 4;
            }
            // if the player swapped once, check on which set they started
            else if (swaps.Count == 1)
            {
                swapped = swaps.First().getExpDur() == 4 ? 5 : 4;
            }
            foreach (CastLog cl in casting)
            {
                GW2APISkill apiskill = null;
                SkillItem   skill    = s_list.FirstOrDefault(x => x.getID() == cl.getID());
                if (skill != null)
                {
                    apiskill = skill.GetGW2APISkill();
                }
                if (apiskill != null && cl.getTime() > swappedTime)
                {
                    if (apiskill.type == "Weapon" && apiskill.professions.Count() > 0 && (apiskill.categories == null || (apiskill.categories.Count() == 1 && apiskill.categories[0] == "Phantasm")))
                    {
                        if (apiskill.weapon_type == "Greatsword" || apiskill.weapon_type == "Staff" || apiskill.weapon_type == "Rifle" || apiskill.weapon_type == "Longbow" || apiskill.weapon_type == "Shortbow" || apiskill.weapon_type == "Hammer")
                        {
                            if (swapped == 4 && (weapons[0] == null && weapons[1] == null))
                            {
                                weapons[0] = apiskill.weapon_type;
                                weapons[1] = "2Hand";
                                continue;
                            }
                            else if (swapped == 5 && (weapons[2] == null && weapons[3] == null))
                            {
                                weapons[2] = apiskill.weapon_type;
                                weapons[3] = "2Hand";
                                continue;
                            }
                            continue;
                        }//2 handed
                        if (apiskill.weapon_type == "Focus" || apiskill.weapon_type == "Shield" || apiskill.weapon_type == "Torch" || apiskill.weapon_type == "Warhorn")
                        {
                            if (swapped == 4 && (weapons[1] == null))
                            {
                                weapons[1] = apiskill.weapon_type;
                                continue;
                            }
                            else if (swapped == 5 && (weapons[3] == null))
                            {
                                weapons[3] = apiskill.weapon_type;
                                continue;
                            }
                            continue;
                        }//OffHand
                        if (apiskill.weapon_type == "Axe" || apiskill.weapon_type == "Dagger" || apiskill.weapon_type == "Mace" || apiskill.weapon_type == "Pistol" || apiskill.weapon_type == "Sword" || apiskill.weapon_type == "Scepter")
                        {
                            if (apiskill.slot == "Weapon_1" || apiskill.slot == "Weapon_2" || apiskill.slot == "Weapon_3")
                            {
                                if (swapped == 4 && (weapons[0] == null))
                                {
                                    weapons[0] = apiskill.weapon_type;
                                    continue;
                                }
                                else if (swapped == 5 && (weapons[2] == null))
                                {
                                    weapons[2] = apiskill.weapon_type;
                                    continue;
                                }
                                continue;
                            }
                            if (apiskill.slot == "Weapon_4" || apiskill.slot == "Weapon_5")
                            {
                                if (swapped == 4 && (weapons[1] == null))
                                {
                                    weapons[1] = apiskill.weapon_type;
                                    continue;
                                }
                                else if (swapped == 5 && (weapons[3] == null))
                                {
                                    weapons[3] = apiskill.weapon_type;
                                    continue;
                                }
                                continue;
                            }
                        }// 1 handed
                    }
                }
                else if (cl.getID() == -2)
                {
                    //wepswap
                    swapped     = cl.getExpDur();
                    swappedTime = cl.getTime();
                    continue;
                }
                if (weapons[0] != null && weapons[1] != null && weapons[2] != null && weapons[3] != null)
                {
                    break;
                }
            }
            weapons_array = weapons;
        }