Exemplo n.º 1
0
 private void DealDamage(DamageCom damageCom)
 {
     if (damageCom.Damages == null || damageCom.Damages.Count <= 0)
     {
         return;
     }
     for (int i = 0; i < damageCom.Damages.Count; i++)
     {
         AddDamageInfo damageInfo = damageCom.Damages[i];
         //执行攻击者的Buff,OnHit函数
         ExecuteHurtFunc(damageInfo);
         //执行目标者的Buff,BeHurt函数
         ExecuteBeHurtFunc(damageInfo);
         //执行伤害
         bool isDead = SkillLocate.Damage.CalcDamage(damageInfo);
         //执行死亡的Buff函数
         if (isDead)
         {
             //攻击者Kill
             ExecuteKilledFunc(damageInfo);
             //目标OnBeKilled
             ExecuteBeKilledFunc(damageInfo);
         }
         //伤害结束,添加Buff
         for (int j = 0; j < damageInfo.model.addBuffs.Count; j++)
         {
             AddBuffModel addBuff = damageInfo.model.addBuffs[j];
             SkillLocate.Skill.CreateBuff(damageInfo.attacker, damageInfo.target, addBuff);
         }
         //移除
         damageCom.RemoveDamageInfo(damageInfo);
     }
 }
Exemplo n.º 2
0
        protected override void HandleComs(List <BaseCom> comList)
        {
            DamageCom damageCom = GetCom <DamageCom>(comList[0]);

            DealDamage(damageCom);
        }