Пример #1
0
        private void RecordDamage(LogRecord record)
        {
            var attackName = record.Skill.Name;
            if (!_attacks.ContainsKey(attackName))
                _attacks.Add(attackName, new AttackEntry());

            var attackEntry = _attacks[attackName];
            if (record.Quantity.IsCrit)
                attackEntry.CriticalHits++;
            attackEntry.TotalHits++;
            attackEntry.TotalDamage += record.Quantity.Value;
        }
Пример #2
0
        protected override void ContinueProcessRecord(LogRecord record)
        {
            if (record.Source.Name == Owner && record.Effect.Name == LogEffect.DamageString)
            {
                RecordDamage(record);

                _totalDamage += record.Quantity.Value;
                if (record.Quantity.IsCrit)
                    _critDamage += record.Quantity.Value;
                Dps = _totalDamage/(DateTime.Now - CombatStart).TotalSeconds;
            }
        }
Пример #3
0
        public void ProcessEntry(LogRecord record)
        {
            if (Owner == null)
            {
                if (record.Source.IsPlayer)
                {
                    Owner = record.Source.Name;
                }
                else if (record.Target.IsPlayer)
                {
                    Owner = record.Target.Name;
                }
                else
                {
                    throw new InvalidOperationException("Can't define owner by Source or Target");
                }
            }

            switch (record.Effect.Name)
            {
                case LogEffect.EnterCombatString:
                    CombatStart = DateTime.Now;
                    OnEnterCombat(record);
                    break;
                case LogEffect.DeathString:
                    CombatEnd = DateTime.Now;
                    OnDeath(record);
                    break;
                case LogEffect.ExitCombatString:
                    CombatEnd = DateTime.Now;
                    OnExitCombat(record);
                    break;
            }

            ContinueProcessRecord(record);
        }
Пример #4
0
 protected abstract void OnExitCombat(LogRecord record);
Пример #5
0
 protected abstract void OnEnterCombat(LogRecord record);
Пример #6
0
 protected abstract void OnDeath(LogRecord record);
Пример #7
0
 protected abstract void ContinueProcessRecord(LogRecord record);
Пример #8
0
 protected override void OnExitCombat(LogRecord record)
 {
 }
Пример #9
0
 protected override void OnEnterCombat(LogRecord record)
 {
     ResetStats();
 }
Пример #10
0
 protected override void OnDeath(LogRecord record)
 {
 }