Пример #1
0
        public void AddHeal(RecoverEventArgs e)
        {
            this.HealAmount += e.Amount;
            if (Class == ClassType.NONE)
            {
                Class = SkillDictionary.GetClass(e.Skill);
            }
            this.HealLogList.Add(e.log);
            HealSkillEntity entity = null;

            foreach (HealSkillEntity hse in HealList)
            {
                if (hse.Target == e.Name)
                {
                    entity = hse;
                    break;
                }
            }
            if (entity == null)
            {
                entity        = new HealSkillEntity();
                entity.Target = e.Name;
                this.HealList.Add(entity);
            }
            entity.TotalRecover += e.Amount;
            entity.Count++;
        }
Пример #2
0
        public void AddRecover(RecoverEventArgs e)
        {
            List <HPMPWhoEntity> whoList = null;

            if (e.IsHP)
            {
                this.HPRecover += e.Amount;
                HPRecoverLogList.Add(e.log);
                whoList = HPWhoList;
            }
            else
            {
                this.MPRecover += e.Amount;
                MPRecoverLogList.Add(e.log);
                whoList = MPWhoList;
            }


            HPMPWhoEntity   whoEntity   = null;
            HPMPSkillEntity skillEntity = null;

            e.Who   = (String.IsNullOrEmpty(e.Who)) ? null : e.Who;
            e.Skill = (String.IsNullOrEmpty(e.Skill)) ? null : e.Skill;
            foreach (HPMPWhoEntity entity in whoList)
            {
                if (entity.Who == e.Who)
                {
                    whoEntity = entity;
                    break;
                }
            }

            if (whoEntity == null)
            {
                whoEntity = new HPMPWhoEntity((String.IsNullOrEmpty(e.Who)) ? null : e.Who);
                whoList.Add(whoEntity);
            }

            foreach (HPMPSkillEntity se in whoEntity.SkillList)
            {
                if (se.SkillName == e.Skill)
                {
                    skillEntity = se;
                    break;
                }
            }

            if (skillEntity == null)
            {
                skillEntity           = new HPMPSkillEntity();
                skillEntity.SkillName = e.Skill;
                whoEntity.SkillList.Add(skillEntity);
            }
            skillEntity.TotalRecover += e.Amount;
            skillEntity.Count++;
            whoEntity.SkillList[0].TotalRecover += e.Amount;
            whoEntity.SkillList[0].Count++;
        }