public static List <int> getBoonStacksList(AbstractBoon boon, List <BoonLog> boon_logs, BossData b_data)
        {
            // Initialise variables
            int        t_prev      = 0;
            int        t_curr      = 0;
            List <int> boon_stacks = new List <int>();

            boon_stacks.Add(0);

            // Loop: fill, update, and add to stacks
            foreach (BoonLog log in boon_logs)
            {
                t_curr = log.getTime();
                boon.addStacksBetween(boon_stacks, t_curr - t_prev);
                boon.update(t_curr - t_prev);
                boon.add(log.getValue());
                if (t_curr != t_prev)
                {
                    boon_stacks.Add(boon.getStackValue());
                }
                else
                {
                    boon_stacks[boon_stacks.Count() - 1] = boon.getStackValue();
                }
                t_prev = t_curr;
            }

            // Fill in remaining stacks
            boon.addStacksBetween(boon_stacks, b_data.getLastAware() - b_data.getFirstAware() - t_prev);
            boon.update(1);
            boon_stacks.Add(boon.getStackValue());
            return(boon_stacks);
        }
Esempio n. 2
0
        private void setFilteredLogs(BossData bossData, List <CombatItem> combatList, AgentData agentData, int instidFilter)
        {
            List <DamageLog> filterDLog = new List <DamageLog>();
            int time_start = bossData.getFirstAware();

            foreach (CombatItem c in combatList)
            {
                if (instid == c.getSrcInstid() || instid == c.getSrcMasterInstid())//selecting player
                {
                    LuckParser.Models.ParseEnums.StateChange state = c.isStateChange();
                    int time = c.getTime() - time_start;
                    if (bossData.getInstid() == c.getDstInstid() && c.getIFF().getEnum() == "FOE")//selecting boss
                    {
                        if (state.getEnum() == "NORMAL" && c.isBuffremove().getID() == 0)
                        {
                            if (c.isBuff() == 1 && c.getBuffDmg() != 0)
                            {
                                filterDLog.Add(new DamageLog(time, c.getBuffDmg(), c.getSkillID(), c.isBuff(),
                                                             c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation()));
                            }
                            else if (c.isBuff() == 0 && c.getValue() != 0)
                            {
                                if (time > 300000)
                                {
                                    int f**k = 0;
                                }
                                filterDLog.Add(new DamageLog(time, c.getValue(), c.getSkillID(), c.isBuff(),
                                                             c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation()));
                            }
                        }
                    }
                }
            }
            damage_logsFiltered = filterDLog;
        }
Esempio n. 3
0
        public int[] getReses(BossData bossData, List <CombatItem> combatList, AgentData agentData)
        {
            int time_start = bossData.getFirstAware();

            int[] reses = { 0, 0 };
            foreach (CastLog log in cast_logs)
            {
                if (log.getID() == 1066)
                {
                    reses[0]++;
                    reses[1] += log.getActDur();
                }
            }
            //foreach (CombatItem c in combatList)
            //{
            //    if (instid == c.getDstInstid()/* || instid == c.getSrcMasterInstid()*/)//selecting player most likyl wrong
            //    {
            //        LuckParser.Models.ParseEnums.StateChange state = c.isStateChange();
            //        int time = c.getTime() - time_start;
            //           if (state.getID() == 0 && time > 0)
            //                {
            //                    if (c.getSkillID() == 1066)
            //                    {
            //                        reses[0]++;
            //                        reses[1] += c.getValue();
            //                    }
            //                }
            //    }
            //}
            return(reses);
        }
Esempio n. 4
0
        public int[] getCleanses(BossData bossData, List <CombatItem> combatList, AgentData agentData)
        {
            int time_start = bossData.getFirstAware();

            int[] cleanse = { 0, 0 };
            foreach (CombatItem c in combatList.Where(x => x.isStateChange().getID() == 0))
            {
                if (c.isActivation().getID() == 0)
                {
                    if (instid == c.getSrcInstid() && c.getIFF().getEnum() == "FRIEND" && c.isBuffremove().getID() == 1 /*|| instid == c.getSrcMasterInstid()*/)//selecting player as remover could be wrong
                    {
                        int time = c.getTime() - time_start;
                        if (time > 0)
                        {
                            if (Boon.getCondiList().Contains(c.getSkillID()))
                            {
                                cleanse[0]++;
                                cleanse[1] += c.getBuffDmg();
                            }
                        }
                    }
                }
            }
            return(cleanse);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        // Private Methods
        private void setDamageLogs(BossData bossData, List <CombatItem> combatList, AgentData agentData)
        {
            int  time_start  = bossData.getFirstAware();
            bool combatStart = false;
            bool combatEnd   = false;

            foreach (CombatItem c in combatList)
            {
                if (combatStart == false)
                {
                    if (bossData.getInstid() == c.getSrcInstid() && c.isStateChange().getID() == 1)
                    {//Make sure combat has started
                        combatStart = true;
                    }
                }
                if (combatEnd == false && combatStart == true)
                {
                    if (bossData.getInstid() == c.getSrcInstid() && c.isStateChange().getID() == 2)
                    {//Make sure combat had ended
                        combatEnd = true;
                    }
                }

                if (instid == c.getSrcInstid() || instid == c.getSrcMasterInstid())    //selecting player or minion as caster
                {
                    LuckParser.Models.ParseEnums.StateChange state = c.isStateChange();
                    int time = c.getTime() - time_start;
                    foreach (AgentItem item in agentData.getNPCAgentList())
                    {    //selecting all
                        if (item.getInstid() == c.getDstInstid())
                        {
                            if (c.getIFF().getEnum() == "FOE")
                            {
                                if (state.getID() == 0 && c.isBuffremove().getID() == 0)
                                {
                                    if (c.isBuff() == 1 && c.getBuffDmg() != 0)    //condi
                                    {
                                        damage_logs.Add(new DamageLog(time, (int)c.getSrcAgent(), c.getBuffDmg(), c.getSkillID(), c.isBuff(),
                                                                      c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation()));
                                    }
                                    else if (c.isBuff() == 0 && c.getValue() != 0)    //power
                                    {
                                        damage_logs.Add(new DamageLog(time, (int)c.getSrcAgent(), c.getValue(), c.getSkillID(), c.isBuff(),
                                                                      c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation()));
                                    }
                                    else if (c.getResult().getID() == 5 || c.getResult().getID() == 6 || c.getResult().getID() == 7)
                                    {    //Hits that where blinded, invulned, interupts
                                        damage_logs.Add(new DamageLog(time, (int)c.getSrcAgent(), c.getValue(), c.getSkillID(), c.isBuff(),
                                                                      c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation()));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        private void setCastLogs(BossData bossData, List <CombatItem> combatList, AgentData agentData)
        {
            int     time_start = bossData.getFirstAware();
            CastLog curCastLog = null;

            foreach (CombatItem c in combatList)
            {
                LuckParser.Models.ParseEnums.StateChange state = c.isStateChange();
                if (state.getID() == 0)
                {
                    if (instid == c.getSrcInstid())//selecting player as caster
                    {
                        if (c.isActivation().getID() > 0)
                        {
                            if (c.isActivation().getID() < 3)
                            {
                                int time = c.getTime() - time_start;
                                curCastLog = new CastLog(time, c.getSkillID(), c.getValue(), c.isActivation());
                            }
                            else
                            {
                                if (curCastLog != null)
                                {
                                    if (curCastLog.getID() == c.getSkillID())
                                    {
                                        curCastLog = new CastLog(curCastLog.getTime(), curCastLog.getID(), curCastLog.getExpDur(), curCastLog.startActivation(), c.getValue(), c.isActivation());
                                        cast_logs.Add(curCastLog);
                                        curCastLog = null;
                                    }
                                }
                            }
                        }
                    }
                }
                else if (state.getID() == 11)       //Weapon swap
                {
                    if (instid == c.getSrcInstid()) //selecting player as caster
                    {
                        if ((int)c.getDstAgent() == 4 || (int)c.getDstAgent() == 5)
                        {
                            int time = c.getTime() - time_start;
                            curCastLog = new CastLog(time, -2, (int)c.getDstAgent(), c.isActivation());
                            cast_logs.Add(curCastLog);
                            curCastLog = null;
                        }
                    }
                }
            }
        }
        public static String getBoonDuration(List <Point> boon_intervals, BossData b_data)
        {
            // Calculate average duration
            double average_duration = 0.0;

            foreach (Point p in boon_intervals)
            {
                average_duration = average_duration + (p.Y - p.X);
            }
            double number = 100 * (average_duration / (b_data.getLastAware() - b_data.getFirstAware()));

            if (number > 100)
            {
                int stop = 0;
            }
            return(String.Format("{0:0}%", number));
        }
        public static double[] getBoonUptime(AbstractBoon boon, List <BoonLog> boon_logs, BossData b_data, int players)
        {
            double fight_duration = b_data.getLastAware() - b_data.getFirstAware();
            double boonDur        = 0.00;
            double os             = 0.00;

            if (players <= 0)
            {
                players = 1;
            }
            foreach (BoonLog bl in boon_logs)
            {
                boonDur = boonDur + bl.getValue();
                os      = os + bl.getOverstack();
            }
            double[] doubles = { (boonDur - os) / (fight_duration * players), boonDur / (fight_duration * players) };

            return(doubles);
        }
Esempio n. 10
0
        public void setDamagetaken(BossData bossData, List <CombatItem> combatList, AgentData agentData, MechanicData m_data)
        {
            int time_start = bossData.getFirstAware();


            foreach (CombatItem c in combatList)
            {
                if (instid == c.getDstInstid())  //selecting player as target
                {
                    LuckParser.Models.ParseEnums.StateChange state = c.isStateChange();
                    int time = c.getTime() - time_start;
                    foreach (AgentItem item in agentData.getNPCAgentList())
                    {//selecting all
                        if (item.getInstid() == c.getSrcInstid() && c.getIFF().getEnum() == "FOE")
                        {
                            if (state.getID() == 0)
                            {
                                if (c.isBuff() == 1 && c.getBuffDmg() != 0)
                                {
                                    //inco,ing condi dmg not working or just not present?
                                    // damagetaken.Add(c.getBuffDmg());
                                }
                                else if (c.isBuff() == 0 && c.getValue() != 0)
                                {
                                    damagetaken.Add(c.getValue());
                                    damageTaken_logs.Add(new DamageLog(time, c.getValue(), c.getSkillID(), c.isBuff(),
                                                                       c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation(), c.isShields()));
                                }
                                else if (c.isBuff() == 0 && c.getValue() == 0)
                                {
                                    damageTaken_logs.Add(new DamageLog(time, c.getBuffDmg(), c.getSkillID(), c.isBuff(),
                                                                       c.getResult(), c.isNinety(), c.isMoving(), c.isFlanking(), c.isActivation(), c.isShields()));
                                }
                            }
                        }
                    }
                }
            }
        }
        public static List <Point> getBoonIntervalsList(AbstractBoon boon, List <BoonLog> boon_logs, BossData b_data)//Needs boonremoval added
        {
            // Initialise variables
            int          t_prev         = 0;
            int          t_curr         = 0;
            List <Point> boon_intervals = new List <Point>();

            // Loop: update then add durations
            foreach (BoonLog log in boon_logs)
            {
                t_curr = log.getTime();
                boon.update(t_curr - t_prev);
                boon.add(log.getValue());
                int duration = t_curr + boon.getStackValue();//this may overload
                if (duration < 0)
                {
                    duration = Int32.MaxValue;
                }

                boon_intervals.Add(new Point(t_curr, duration));
            }

            // Merge intervals
            boon_intervals = Utility.mergeIntervals(boon_intervals);

            // Trim duration overflow
            int fight_duration = b_data.getLastAware() - b_data.getFirstAware();
            int last           = boon_intervals.Count() - 1;

            if (boon_intervals[last].Y > fight_duration)
            {
                Point mod = boon_intervals[last];
                mod.Y = fight_duration;
                boon_intervals[last] = mod;
            }

            return(boon_intervals);
        }
Esempio n. 12
0
        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++;
                        }
                    }
                }
            }
        }