コード例 #1
0
ファイル: FightTracker.cs プロジェクト: rumstil/eqlogparser
        private void TrackHeal(LogHealEvent heal)
        {
            // rather than treating ward heals as a separte caster, attribute them to the owner
            if (heal.Source != null && heal.Source.EndsWith("`s ward"))
            {
                heal.Source = heal.Source.Substring(0, heal.Source.Length - 7);
                //heal.Spell = "ward:" + heal.Spell;
            }

            // heals are complicated because they aren't easily attributable to a fight (especially if several fights are in progress)
            // the best compromise is probably to attribute to the most recent active fight (at least for player cast heals)
            // what if a cleric heals someone between fights? (ignore it for now)
            // what about if A,B are fighting but C heals C or D? (check all active fights)
            if (LastFight != null && LastFight.Status == FightStatus.Active)
            {
                for (int i = 0; i < LastFight.Participants.Count; i++)
                {
                    if (LastFight.Participants[i].Name == heal.Target || LastFight.Participants[i].Name == heal.Source)
                    {
                        LastFight.AddHeal(heal);
                        return;
                    }
                }
            }

            foreach (var f in ActiveFights)
            {
                if (f == LastFight)
                {
                    continue;
                }

                //for (int i = 0; i < f.Participants.Count; i++)
                for (int i = f.Participants.Count - 1; i >= 0; i--)
                {
                    if (f.Participants[i].Name == heal.Target || f.Participants[i].Name == heal.Source)
                    {
                        f.AddHeal(heal);
                        return;
                    }
                }
            }

            // finally just attribute it to an active fight if it is cast by a friend
            if (heal.Source != null && Chars.GetType(heal.Source) == CharType.Friend && ActiveFights.Count > 0)
            {
                var f = ActiveFights[^ 1];
コード例 #2
0
        public void AddHeal(LogHealEvent heal)
        {
            var interval = GetTick(heal.Timestamp);

            // ignore any heals on target
            if (heal.Target == Target.Name)
            {
                return;
            }

            // heal source may be null if healer dies
            if (heal.Source != null)
            {
                AddParticipant(heal.Source).AddHeal(heal, interval);
            }

            // only count target if it's not a self heal, because AddHeal has already
            // run both source/target legs internally and we don't want to double count
            if (heal.Source != heal.Target)
            {
                AddParticipant(heal.Target).AddHeal(heal, interval);
            }
        }
コード例 #3
0
        public void AddHeal(LogHealEvent heal, int interval = -1)
        {
            if (FirstAction == null)
            {
                FirstAction = heal.Timestamp;
            }
            LastAction = heal.Timestamp;

            // promised heals appear as self heals
            // we may want to ignore them for self healing stats
            //var promised = heal.Source == Name && heal.Target == Name && heal.Spell != null && heal.Spell.StartsWith("Promised");

            //if (heal.Source == Name && heal.Target == Name)
            //{
            //    SelfHealSum += heal.Amount;
            //}

            if (heal.Source == Name)
            {
                OutboundHealSum     += heal.Amount;
                OutboundFullHealSum += heal.FullAmount;

                var h = Heals.FirstOrDefault(x => x.Target == heal.Target);
                if (h == null)
                {
                    h        = new FightHeal();
                    h.Target = heal.Target;
                    Heals.Add(h);
                }
                h.HitCount   += 1;
                h.HitSum     += heal.Amount;
                h.FullHitSum += heal.FullAmount;

                // should we label unknown heals as lifetap or unknown?
                var spell = AddSpell(heal.Spell ?? "Lifetap", "heal");
                spell.HitCount   += 1;
                spell.HitSum     += heal.Amount;
                spell.FullHitSum += heal.FullAmount;

                if (heal.Mod.HasFlag(LogEventMod.Critical))
                {
                    spell.CritCount += 1;
                    spell.CritSum   += heal.Amount;
                }

                if (heal.Mod.HasFlag(LogEventMod.Twincast))
                {
                    spell.TwinCount += 1;
                }

                if (interval >= 0)
                {
                    while (HPS.Count <= interval)
                    {
                        HPS.Add(0);
                    }
                    HPS[interval] += heal.Amount;
                }
            }

            if (heal.Target == Name)
            {
                InboundHealSum     += heal.Amount;
                InboundFullHealSum += heal.FullAmount;

                if (interval >= 0)
                {
                    while (InboundHPS.Count <= interval)
                    {
                        InboundHPS.Add(0);
                    }
                    InboundHPS[interval] += heal.Amount;
                }
            }
        }