/// <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); } } } } }
public void calculateConditions() { statistics.bossConditions = new Dictionary <int, Statistics.FinalBossBoon> [phases.Count]; List <Boon> boon_to_track = Boon.getCondiBoonList(); boon_to_track.AddRange(Boon.getBoonList()); for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++) { List <PhaseData> phases = log.getBoss().getPhases(log, settings.ParsePhases); BoonDistribution boonDistribution = log.getBoss().getBoonDistribution(log, phases, boon_to_track, phaseIndex); Dictionary <int, Statistics.FinalBossBoon> rates = new Dictionary <int, Statistics.FinalBossBoon>(); PhaseData phase = phases[phaseIndex]; long fightDuration = phase.getDuration(); foreach (Boon boon in Boon.getCondiBoonList()) { Statistics.FinalBossBoon condition = new Statistics.FinalBossBoon(); rates[boon.getID()] = condition; if (boonDistribution.ContainsKey(boon.getID())) { if (boon.getType() == Boon.BoonType.Duration) { condition.boonType = Boon.BoonType.Duration; condition.uptime = Math.Round(100.0 * boonDistribution.getUptime(boon.getID()) / fightDuration, 1); } else if (boon.getType() == Boon.BoonType.Intensity) { condition.boonType = Boon.BoonType.Intensity; condition.uptime = Math.Round((double)boonDistribution.getUptime(boon.getID()) / fightDuration, 1); } rates[boon.getID()] = condition; } } statistics.bossConditions[phaseIndex] = rates; } }
/// <summary> /// Parses skill related data /// </summary> private void parseSkillData(Stream stream) { var apiController = new GW2APIController(); using (var reader = CreateReader(stream)) { // 4 bytes: player count int skill_count = reader.ReadInt32(); //TempData["Debug"] += "Skill Count:" + skill_count.ToString(); // 68 bytes: each skill for (int i = 0; i < skill_count; i++) { // 4 bytes: skill ID int skill_id = reader.ReadInt32(); // 64 bytes: name var name = ParseHelper.getString(stream, 64); if (skill_id != 0 && int.TryParse(name, out int n) && n == skill_id) { //was it a known boon? foreach (Boon b in Boon.getBoonList()) { if (skill_id == b.getID()) { name = b.getName(); } } } //Save var skill = new SkillItem(skill_id, name); skill.SetGW2APISkill(apiController); skill_data.addItem(skill); } } }