示例#1
0
        public void AddDamage(PlayerDamageEventArgs e)
        {
            TargetTotalDamage target = GetTarget(e.Target);

            if (target == null)
            {
                target = new TargetTotalDamage(e.Target);
                TargetList.Add(target);
            }
            target.AddDamage(e);
        }
示例#2
0
        public void AddDamage(PlayerDamageEventArgs e)
        {
            this.TotalDamage += e.Damage;
            TargetUser user = GetTargetUser(e.NameAfterAdd);

            if (user == null)
            {
                user = new TargetUser(e.NameAfterAdd);
                UserList.Add(user);
            }
            user.Damage += e.Damage;
        }
示例#3
0
文件: Data.cs 项目: wnd2da/aion
        public void AddDamage(PlayerDamageEventArgs e)
        {
            //5초간 딜이 없다면 마지막시간으로
            //int temp = DateTime.Compare(e.Time, lastDataTime);
            int temp = e.Time.Subtract(lastDataTime).Seconds;

#if TICK
            if (temp > 0)
            {
                totalDealTime++;
            }
#else
            if (temp < 5 && temp >= 0)
            {
                TotalDealTime += temp;
            }
            else
            {
                TotalDealTime++;
            }
#endif
            TimeSpan timeSpan = e.Time - lastDataTime;
            lastDataTime = e.Time;

            TotalDamage += e.Damage;
            if (e.Damage > MaxDamage)
            {
                MaxDamage = e.Damage;
            }

            this.TotalDealCount++;
            if (e.Skill != "")
            {
                this.totalSkillDealCount++;
                if (Class == ClassType.NONE)
                {
                    Class = SkillDictionary.GetClass(e.Skill);
                    if (Class == ClassType.NONE)
                    {
                    }
                }
            }
            else
            {
                e.Skill = "평타";
                this.totalNormalDealCount++;
            }


            // NewTotalDealCount TotalNormalCancelCount MaxNormalCancelCount CurrentNormalCancelCount
            // 2013-05-30
            if (e.Skill == "평타")
            {
                NewTotalNormalDamage += e.Damage;
            }
            else
            {
                NewTotalSkillDamage += e.Damage;
            }

            // 2013-05-21
            if (NewTotalDealCount == 0) // 첫타는..
            {
                NewTotalDealCount++;
                if (e.Skill == "평타")
                {
                    NewTotalNormalDealCount++;
                }
                else
                {
                    NewTotalSkillDealCount++;
                }
            }
            else
            {
                if (isLastSkill == true && e.Skill != "평타") //스킬 & 스킬
                {
                    NewTotalDealCount++;
                    CurrentNormalCancelCount = 0;
                    NewTotalSkillDealCount++;
                }
                else if ((isLastSkill == true && e.Skill == "평타") || (isLastSkill == false && e.Skill != "평타")) // 스킬 & 평타
                {
                    NewTotalDealCount++;
                    if (timeSpan.TotalSeconds <= 3)
                    {
                        TotalNormalCancelCount++;
                        CurrentNormalCancelCount++;
                    }
                    else
                    {
                        CurrentNormalCancelCount = 0;
                    }
                    if (e.Skill == "평타")
                    {
                        NewTotalNormalDealCount++;
                    }
                    else
                    {
                        NewTotalSkillDealCount++;
                    }
                }
                else if (isLastSkill == false && e.Skill == "평타") //평타 & 평타
                {
                    if (timeSpan.TotalSeconds > 0)
                    {
                        NewTotalDealCount++;
                        NewTotalNormalDealCount++;
                        CurrentNormalCancelCount = 0;
                    }
                }
            }
            isLastSkill = (e.Skill != "평타");

            MaxNormalCancelCount = (CurrentNormalCancelCount > MaxNormalCancelCount) ? CurrentNormalCancelCount : MaxNormalCancelCount;
            PercentNormalCancel  = (NewTotalDealCount > 1) ? (TotalNormalCancelCount * 100 / (NewTotalDealCount - 1)) : 0;

            SkillEntity skillEntity = null;
            foreach (SkillEntity skill in SkillList)
            {
                if (skill.SkillName == e.Skill)
                {
                    skillEntity = skill;
                    break;
                }
            }
            if (skillEntity == null)
            {
                SkillEntity se = new SkillEntity();
                se.SkillName = e.Skill;
                SkillList.Add(se);
                skillEntity = se;
            }
            skillEntity.TotalDamage += e.Damage;
            skillEntity.Count++;
            if (e.bCritical)
            {
                skillEntity.CriticalCount++;
            }


            this.TotalCriticalDealCount = this.TotalCriticalDealCount + ((e.bCritical) ? 1 : 0);
            DPS           = (TotalDealTime > 0) ? (TotalDamage / this.TotalDealTime) : 0;
            percentSkill  = (TotalDealCount > 0) ? (totalSkillDealCount * 100 / TotalDealCount) : 0;
            percentNormal = (TotalDealCount > 0) ? (totalNormalDealCount * 100 / TotalDealCount) : 0;
            // 2013-05-10 평타는 아예 빼기 때문에 스킬만 계산
            percentCritical = (totalSkillDealCount > 0) ? (TotalCriticalDealCount * 100 / totalSkillDealCount) : 0;

            LogList.Add(e.log);
            LastTarget = e.Target;
        }