public List <BoonMap> getboonGen(BossData bossData, SkillData skillData, List <CombatItem> combatList, AgentData agentData, List <int> trgtPID) { List <BoonMap> boonGen = new List <BoonMap>(); int time_start = bossData.getFirstAware(); int fight_duration = bossData.getLastAware() - time_start; int here = 0, there = 0, everywhere = 0, huh = 0; // Initialize Boon Map with every Boon foreach (Boon boon in Boon.getList()) { BoonMap map = new BoonMap(boon.getName(), new List <BoonLog>()); boonGen.Add(map); // boon_map.put(boon.getName(), new ArrayList<BoonLog>()); } foreach (CombatItem c in combatList) { LuckParser.Models.ParseEnums.StateChange state = c.isStateChange(); int time = c.getTime() - time_start; if (instid == c.getSrcInstid() && state.getEnum() == "NORMAL" && time > 0 && time < fight_duration /*|| instid == c.getSrcMasterInstid()*/)//selecting player or minion as caster { here++; foreach (AgentItem item in agentData.getPlayerAgentList()) { //selecting all if (item.getInstid() == c.getDstInstid() /*&& c.getIFF().getEnum() == "FRIEND"*/) //Make sure target is friendly existing Agent { there++; foreach (int id in trgtPID) //Make sure trgt is within paramaters { if (id == c.getDstInstid()) { everywhere++; if (c.isBuffremove().getID() == 0 && c.isBuff() > 0 && c.getBuffDmg() == 0 && c.getValue() > 0) //Buff application { huh++; String skill_name = skillData.getName(c.getSkillID()); int count = 0; foreach (BoonMap bm in boonGen.ToList()) { if (skill_name.Contains(bm.getName())) { List <BoonLog> loglist = bm.getBoonLog(); loglist.Add(new BoonLog(time, c.getValue(), c.getOverstackValue())); bm.setBoonLog(loglist); boonGen[count] = bm; } count++; } } } } } } } } return(boonGen); }
public void findName(SkillData skill_data, int id) { name = ""; skill = null; List <SkillItem> s_list = skill_data.getSkillList(); if (s_list.FirstOrDefault(x => x.getID() == id) != null) { skill = s_list.FirstOrDefault(x => x.getID() == id).GetGW2APISkill(); } if (id == -2) { name = "Weapon Swap"; } if (skill == null) { name = skill_data.getName(id); } else { name = skill.name; } name = name.Replace("\"", ""); }
public void setBoonMap(BossData bossData, SkillData skillData, List <CombatItem> combatList) { // Initialize Boon Map with every Boon foreach (Boon boon in Boon.getMainList()) { BoonMap map = new BoonMap(boon.getName(), new List <BoonLog>()); boon_map.Add(map); // boon_map.put(boon.getName(), new ArrayList<BoonLog>()); } foreach (Boon boon in Boon.getAllProfList()) { BoonMap map = new BoonMap(boon.getName(), new List <BoonLog>()); boon_map.Add(map); // boon_map.put(boon.getName(), new ArrayList<BoonLog>()); } // Fill in Boon Map int time_start = bossData.getFirstAware(); int fight_duration = bossData.getLastAware() - time_start; foreach (CombatItem c in combatList) { if (instid == c.getDstInstid()) { String skill_name = skillData.getName(c.getSkillID()); if (c.isBuff() == 1 && c.getValue() > 0 && c.isBuffremove().getID() == 0) { int count = 0; foreach (BoonMap bm in boon_map.ToList()) { if (skill_name.Contains(bm.getName())) { int time = c.getTime() - time_start; if (time < fight_duration) { List <BoonLog> loglist = bm.getBoonLog(); loglist.Add(new BoonLog(time, c.getValue(), c.getOverstackValue())); bm.setBoonLog(loglist); boon_map[count] = bm; } else { break; } } count++; } } else if (c.isBuffremove().getID() == 1 && c.getValue() > 0)//All { //finding correct boonmap int count = 0; foreach (BoonMap bm in boon_map.ToList()) { if (skill_name.Contains(bm.getName())) { //make sure log is within fight time int time = c.getTime() - time_start; if (time < fight_duration) { List <BoonLog> loglist = bm.getBoonLog(); for (int cnt = loglist.Count() - 1; cnt >= 0; cnt--) { BoonLog curBL = loglist[cnt]; if (curBL.getTime() + curBL.getValue() > time) { int subtract = (curBL.getTime() + curBL.getValue()) - time; loglist[cnt] = new BoonLog(curBL.getTime(), curBL.getValue() - subtract, curBL.getOverstack() + subtract); } } // loglist.Add(new BoonLog(time, c.getValue(), c.getOverstackValue())); bm.setBoonLog(loglist); boon_map[count] = bm; } else { break; } } count++; } } else if (c.isBuffremove().getID() == 2 && c.getValue() > 0)//Single { //finding correct boonmap int count = 0; foreach (BoonMap bm in boon_map.ToList()) { if (skill_name.Contains(bm.getName())) { if (bm.getName().Contains("Fury")) { int stop = 0; } //make sure log is within fight time int time = c.getTime() - time_start; if (time < fight_duration) { List <BoonLog> loglist = bm.getBoonLog(); for (int cnt = loglist.Count() - 1; cnt >= 0; cnt--) { BoonLog curBL = loglist[cnt]; if (curBL.getTime() + curBL.getValue() > time) { int subtract = (curBL.getTime() + curBL.getValue()) - time; loglist[cnt] = new BoonLog(curBL.getTime(), curBL.getValue() - subtract, curBL.getOverstack() + subtract); break; } } // loglist.Add(new BoonLog(time, c.getValue(), c.getOverstackValue())); bm.setBoonLog(loglist); boon_map[count] = bm; break; } else { break; } } count++; } } else if (c.isBuffremove().getID() == 3 && c.getValue() > 0)//Manuel { //finding correct boonmap int count = 0; foreach (BoonMap bm in boon_map.ToList()) { if (skill_name.Contains(bm.getName())) { if (bm.getName().Contains("Fury")) { int stop = 0; } //make sure log is within fight time int time = c.getTime() - time_start; if (time < fight_duration) { List <BoonLog> loglist = bm.getBoonLog(); for (int cnt = loglist.Count() - 1; cnt >= 0; cnt--) { BoonLog curBL = loglist[cnt]; if (curBL.getTime() + curBL.getValue() > time) { int subtract = (curBL.getTime() + curBL.getValue()) - time; loglist[cnt] = new BoonLog(curBL.getTime(), curBL.getValue() - subtract, curBL.getOverstack() + subtract); break; } } // loglist.Add(new BoonLog(time, c.getValue(), c.getOverstackValue())); bm.setBoonLog(loglist); boon_map[count] = bm; break; } else { break; } } count++; } } } } }