Exemplo n.º 1
0
        internal static void UpdateStats(PlayerSubStats stats, HitRecord record)
        {
            switch (record.Type)
            {
            case Labels.BANE:
                stats.BaneHits++;
                stats.Hits += 1;
                break;

            case Labels.MISS:
                stats.Misses++;
                stats.MeleeAttempts += 1;
                break;

            case Labels.PROC:
            case Labels.DOT:
            case Labels.DD:
            case Labels.HOT:
            case Labels.HEAL:
            case Labels.DS:
                stats.Hits += 1;
                break;

            default:
                stats.Hits += 1;
                stats.MeleeHits++;
                stats.MeleeAttempts += 1;
                break;
            }

            if (record.Total > 0)
            {
                stats.Total += record.Total;
                stats.Max    = Math.Max(stats.Max, record.Total);
            }

            if (record.Total > 0 && record.OverTotal > 0)
            {
                stats.Extra += (record.OverTotal - record.Total);
            }

            LineModifiersParser.Parse(record, stats);
        }
Exemplo n.º 2
0
        internal static void UpdateStats(HitRecord record, Attempt playerStats, Attempt theHit = null)
        {
            if (record.ModifiersMask > -1 && record.Type != Labels.MISS)
            {
                if ((record.ModifiersMask & ASSASSINATE) != 0)
                {
                    playerStats.AssHits++;
                    playerStats.TotalAss += record.Total;

                    if (theHit != null)
                    {
                        theHit.AssHits++;
                    }
                }

                if ((record.ModifiersMask & DOUBLEBOW) != 0)
                {
                    playerStats.DoubleBowHits++;

                    if (theHit != null)
                    {
                        theHit.DoubleBowHits++;
                    }
                }

                if ((record.ModifiersMask & FLURRY) != 0)
                {
                    playerStats.FlurryHits++;

                    if (theHit != null)
                    {
                        theHit.FlurryHits++;
                    }
                }

                if ((record.ModifiersMask & HEADSHOT) != 0)
                {
                    playerStats.HeadHits++;
                    playerStats.TotalHead += record.Total;

                    if (theHit != null)
                    {
                        theHit.HeadHits++;
                    }
                }

                if ((record.ModifiersMask & FINISHING) != 0)
                {
                    playerStats.FinishingHits++;
                    playerStats.TotalFinishing += record.Total;

                    if (theHit != null)
                    {
                        theHit.FinishingHits++;
                    }
                }

                if ((record.ModifiersMask & TWINCAST) != 0)
                {
                    playerStats.TwincastHits++;

                    if (theHit != null)
                    {
                        theHit.TwincastHits++;
                    }
                }
                else
                {
                    playerStats.TotalNonTwincast += record.Total;
                }

                if ((record.ModifiersMask & RAMPAGE) != 0)
                {
                    playerStats.RampageHits++;

                    if (theHit != null)
                    {
                        theHit.RampageHits++;
                    }
                }

                // A Strikethrough Riposte is the attacker attacking through a riposte from the defender
                if (IsRiposte(record.ModifiersMask))
                {
                    playerStats.RiposteHits++;
                    playerStats.TotalRiposte += record.Total;

                    if (theHit != null)
                    {
                        theHit.RiposteHits++;
                    }
                }

                if ((record.ModifiersMask & STRIKETHROUGH) != 0)
                {
                    playerStats.StrikethroughHits++;

                    if (theHit != null)
                    {
                        theHit.StrikethroughHits++;
                    }
                }

                if ((record.ModifiersMask & SLAY) != 0)
                {
                    playerStats.SlayHits++;
                    playerStats.TotalSlay += record.Total;

                    if (theHit != null)
                    {
                        theHit.SlayHits++;
                    }
                }

                if ((record.ModifiersMask & CRIT) != 0)
                {
                    playerStats.CritHits++;

                    if (theHit != null)
                    {
                        theHit.CritHits++;
                    }

                    if ((record.ModifiersMask & LUCKY) == 0)
                    {
                        playerStats.TotalCrit += record.Total;

                        if (theHit != null)
                        {
                            theHit.TotalCrit += record.Total;
                        }

                        if ((record.ModifiersMask & TWINCAST) == 0)
                        {
                            playerStats.NonTwincastCritHits++;
                            playerStats.TotalNonTwincastCrit += record.Total;

                            if (theHit != null)
                            {
                                theHit.NonTwincastCritHits++;
                                theHit.TotalNonTwincastCrit += record.Total;
                            }
                        }
                    }
                }

                if ((record.ModifiersMask & LUCKY) != 0)
                {
                    playerStats.LuckyHits++;
                    playerStats.TotalLucky += record.Total;

                    if (theHit != null)
                    {
                        theHit.LuckyHits++;
                        theHit.TotalLucky += record.Total;
                    }

                    if ((record.ModifiersMask & TWINCAST) == 0)
                    {
                        playerStats.NonTwincastLuckyHits++;
                        playerStats.TotalNonTwincastLucky += record.Total;

                        if (theHit != null)
                        {
                            theHit.NonTwincastLuckyHits++;
                            theHit.TotalNonTwincastLucky += record.Total;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal static void Parse(HitRecord record, Attempt playerStats, Attempt theHit = null)
        {
            if (record.ModifiersMask > -1)
            {
                if ((record.ModifiersMask & RAMPAGE) != 0)
                {
                    playerStats.RampageHits++;

                    if (theHit != null)
                    {
                        theHit.RampageHits++;
                    }
                }

                if ((record.ModifiersMask & STRIKETHROUGH) != 0)
                {
                    playerStats.StrikethroughHits++;

                    if (theHit != null)
                    {
                        theHit.StrikethroughHits++;
                    }
                }

                // A Strikethrough Riposte is the attacker attacking through a riposte from the defender
                if (IsRiposte(record.ModifiersMask))
                {
                    playerStats.RiposteHits++;

                    if (theHit != null)
                    {
                        theHit.RiposteHits++;
                    }
                }

                if ((record.ModifiersMask & TWINCAST) != 0)
                {
                    playerStats.TwincastHits++;

                    if (theHit != null)
                    {
                        theHit.TwincastHits++;
                    }
                }

                if ((record.ModifiersMask & CRIT) != 0)
                {
                    playerStats.CritHits++;

                    if (theHit != null)
                    {
                        theHit.CritHits++;
                    }

                    if ((record.ModifiersMask & LUCKY) == 0)
                    {
                        playerStats.TotalCrit += record.Total;

                        if (theHit != null)
                        {
                            theHit.TotalCrit += record.Total;
                        }
                    }
                }

                if ((record.ModifiersMask & LUCKY) != 0)
                {
                    playerStats.LuckyHits++;
                    playerStats.TotalLucky += record.Total;

                    if (theHit != null)
                    {
                        theHit.LuckyHits++;
                        theHit.TotalLucky += record.Total;
                    }
                }
            }
        }
Exemplo n.º 4
0
        internal static void UpdateStats(PlayerSubStats stats, HitRecord record, bool isPet = false)
        {
            var newMeleeHit = false;

            switch (record.Type)
            {
            case Labels.BANE:
                stats.BaneHits++;
                stats.Hits += 1;
                break;

            case Labels.BLOCK:
                stats.Blocks++;
                stats.MeleeAttempts++;
                break;

            case Labels.DODGE:
                stats.Dodges++;
                stats.MeleeAttempts++;
                break;

            case Labels.MISS:
                stats.Misses++;
                stats.MeleeAttempts++;
                break;

            case Labels.PARRY:
                stats.Parries++;
                stats.MeleeAttempts++;
                break;

            case Labels.INVULNERABLE:
                stats.Invulnerable++;
                stats.MeleeAttempts++;
                break;

            case Labels.PROC:
            case Labels.DOT:
            case Labels.DD:
                stats.SpellHits++;
                stats.Hits++;
                break;

            case Labels.HOT:
            case Labels.HEAL:
            case Labels.DS:
            case Labels.RS:
                stats.Hits += 1;
                break;

            default:
                stats.Hits += 1;
                stats.MeleeAttempts++;
                newMeleeHit = true;
                break;
            }

            if (newMeleeHit)
            {
                // regular hit from a player OR Hits from a pet can do things like Flurry
                if (record.Type == Labels.MELEE)
                {
                    if (RegularMeleeTypes.ContainsKey(record.SubType) || (record.SubType == "Hits" && isPet))
                    {
                        stats.RegularMeleeHits++;
                    }
                    else if (record.SubType == "Shoots")
                    {
                        stats.BowHits++;
                    }
                }

                stats.MeleeHits++;
            }

            if (record.Total > 0)
            {
                stats.Total += record.Total;
                stats.Max    = Math.Max(stats.Max, record.Total);
            }

            if (record.OverTotal > 0)
            {
                stats.Extra += (record.OverTotal - record.Total);
            }

            LineModifiersParser.UpdateStats(record, stats);
        }