public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log)
 {
     foreach (BoonSimulationItemDuration item in _stacks)
     {
         item.SetBoonDistributionItem(distribs, start, end, boonid, log);
     }
 }
Пример #2
0
 protected Dictionary <AgentItem, BoonDistributionItem> GetDistrib(BoonDistribution distribs, long boonid)
 {
     if (!distribs.TryGetValue(boonid, out var distrib))
     {
         distrib = new Dictionary <AgentItem, BoonDistributionItem>();
         distribs.Add(boonid, distrib);
     }
     return(distrib);
 }
        public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log)
        {
            Dictionary <AgentItem, BoonDistributionItem> distrib = GetDistrib(distribs, boonid);
            AgentItem agent = Src;

            if (distrib.TryGetValue(agent, out var toModify))
            {
                toModify.Overstack += GetValue(start, end);
                distrib[agent]      = toModify;
            }
            else
            {
                distrib.Add(agent, new BoonDistributionItem(
                                0,
                                GetValue(start, end), 0, 0, 0, 0));
            }
        }
Пример #4
0
        private void SetBuffs(ParsedLog log)
        {
            // Boons applied to self
            _selfBuffs = new List <Dictionary <long, FinalBuffs> >();
            List <PhaseData> phases = log.FightData.GetPhases(log);

            for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++)
            {
                Dictionary <long, FinalBuffs> final = new Dictionary <long, FinalBuffs>();

                PhaseData phase = phases[phaseIndex];

                BoonDistribution        selfBoons    = GetBoonDistribution(log, phaseIndex);
                Dictionary <long, long> buffPresence = GetBuffPresence(log, phaseIndex);

                long fightDuration = phase.End - phase.Start;
                foreach (Boon boon in TrackedBoons)
                {
                    if (selfBoons.ContainsKey(boon.ID))
                    {
                        FinalBuffs uptime = new FinalBuffs
                        {
                            Uptime          = 0,
                            Generation      = 0,
                            Overstack       = 0,
                            Wasted          = 0,
                            UnknownExtended = 0,
                            ByExtension     = 0,
                            Extended        = 0
                        };
                        final[boon.ID] = uptime;
                        long generation = selfBoons.GetGeneration(boon.ID, AgentItem);
                        if (boon.Type == Boon.BoonType.Duration)
                        {
                            uptime.Uptime          = Math.Round(100.0 * selfBoons.GetUptime(boon.ID) / fightDuration, 3);
                            uptime.Generation      = Math.Round(100.0 * generation / fightDuration, 3);
                            uptime.Overstack       = Math.Round(100.0 * (selfBoons.GetOverstack(boon.ID, AgentItem) + generation) / fightDuration, 3);
                            uptime.Wasted          = Math.Round(100.0 * selfBoons.GetWaste(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.UnknownExtended = Math.Round(100.0 * selfBoons.GetUnknownExtension(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.ByExtension     = Math.Round(100.0 * selfBoons.GetExtension(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.Extended        = Math.Round(100.0 * selfBoons.GetExtended(boon.ID, AgentItem) / fightDuration, 3);
                        }
                        else if (boon.Type == Boon.BoonType.Intensity)
                        {
                            uptime.Uptime          = Math.Round((double)selfBoons.GetUptime(boon.ID) / fightDuration, 3);
                            uptime.Generation      = Math.Round((double)generation / fightDuration, 3);
                            uptime.Overstack       = Math.Round((double)(selfBoons.GetOverstack(boon.ID, AgentItem) + generation) / fightDuration, 3);
                            uptime.Wasted          = Math.Round((double)selfBoons.GetWaste(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.UnknownExtended = Math.Round((double)selfBoons.GetUnknownExtension(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.ByExtension     = Math.Round((double)selfBoons.GetExtension(boon.ID, AgentItem) / fightDuration, 3);
                            uptime.Extended        = Math.Round((double)selfBoons.GetExtended(boon.ID, AgentItem) / fightDuration, 3);
                            if (buffPresence.TryGetValue(boon.ID, out long presenceValueBoon))
                            {
                                uptime.Presence = Math.Round(100.0 * presenceValueBoon / fightDuration, 3);
                            }
                        }
                    }
                }

                _selfBuffs.Add(final);
            }

            // Boons applied to player's group
            var otherPlayersInGroup = log.PlayerList
                                      .Where(p => p.Group == Group && InstID != p.InstID)
                                      .ToList();

            _groupBuffs = GetBoonsForPlayers(otherPlayersInGroup, log);

            // Boons applied to other groups
            var offGroupPlayers = log.PlayerList.Where(p => p.Group != Group).ToList();

            _offGroupBuffs = GetBoonsForPlayers(offGroupPlayers, log);

            // Boons applied to squad
            var otherPlayers = log.PlayerList.Where(p => p.InstID != InstID).ToList();

            _squadBuffs = GetBoonsForPlayers(otherPlayers, log);
        }
Пример #5
0
        public override void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log)
        {
            Dictionary <AgentItem, BoonDistributionItem> distrib = GetDistrib(distribs, boonid);
            long      cDur      = GetClampedDuration(start, end);
            AgentItem agent     = _src;
            AgentItem seedAgent = _seedSrc;

            if (distrib.TryGetValue(agent, out BoonDistributionItem toModify))
            {
                toModify.Value += cDur;
                distrib[agent]  = toModify;
            }
            else
            {
                distrib.Add(agent, new BoonDistributionItem(
                                cDur,
                                0, 0, 0, 0, 0));
            }
            if (_isExtension)
            {
                if (distrib.TryGetValue(agent, out toModify))
                {
                    toModify.Extension += cDur;
                    distrib[agent]      = toModify;
                }
                else
                {
                    distrib.Add(agent, new BoonDistributionItem(
                                    0,
                                    0, 0, 0, cDur, 0));
                }
            }
            if (agent != seedAgent)
            {
                if (distrib.TryGetValue(seedAgent, out toModify))
                {
                    toModify.Extended += cDur;
                    distrib[seedAgent] = toModify;
                }
                else
                {
                    distrib.Add(seedAgent, new BoonDistributionItem(
                                    0,
                                    0, 0, 0, 0, cDur));
                }
            }
            if (agent == GeneralHelper.UnknownAgent)
            {
                if (distrib.TryGetValue(seedAgent, out toModify))
                {
                    toModify.UnknownExtension += cDur;
                    distrib[seedAgent]         = toModify;
                }
                else
                {
                    distrib.Add(seedAgent, new BoonDistributionItem(
                                    0,
                                    0, 0, cDur, 0, 0));
                }
            }
        }
Пример #6
0
 public abstract void SetBoonDistributionItem(BoonDistribution distribs, long start, long end, long boonid, ParsedLog log);