Exemplo n.º 1
0
 /// <summary>
 /// 技能附加buff
 /// </summary>
 public static void SkillAttachBuff(FightUnit attacker, FightUnit target, List <Skill.buffConfig> buffConfigList, HurtType hurtType)
 {
     if (buffConfigList.Count == 0)
     {
         return;
     }
     for (int i = 0; i < buffConfigList.Count; i++)
     {
         ActiveSkill.buffConfig buffConfig = buffConfigList[i];
         BuffData buffData = BuffDataDic[buffConfig.id];
         //判断免疫
         if (!IsBuffAttachable(target, buffData))
         {
             continue;
         }
         //判断控制buff的命中
         if (buffData.controlDebuff == 1 && Random.value > 1 - Mathf.Max(0, (target.fightAttribute.level - buffConfig.level)) * Const.CONST_RESIST_FACTOR)
         {
             continue;
         }
         float buffValue = Mathf.RoundToInt(attacker.fightAttribute.attack * buffConfig.percent) + buffConfig.value;
         Buff  buff      = Buff.AddNewBuff(target, attacker, buffData, buffValue, buffConfig.time, hurtType);
         buff.bindSkill = buffConfig.bindSkill;
     }
 }