Ejemplo n.º 1
0
        /// <summary>
        /// 技能的late tick,这是处理一些技能时间到,buff时间到之后的后续处理,需要手动调用
        /// </summary>
        /// <param name="self"></param>
        public static void Tick_Battle_Late(SkillObj self)
        {
            self.Tick_Battle_Late();
            //这个时候已经不再使用buff的迭代器,可以改变集合了,因为这里边的buff已经认为是被加在角色身上了,所以需要有后续处理得先加进去
            foreach (var b in self.GetTempBuffList())
            {
                self.AddBuffList(b);
            }
            self.ClearTempBuffList();
            IEnumerable <BuffInfo_New> detachBuffs = null;

            if (self.IsDead())
            {
                detachBuffs = self.RemoveAllBuffs((b) => true);
                self.RemoveAllSkills((s) => true);
                self.RemoveAllCDKey((c) => true);
            }
            else
            {
                detachBuffs = self.RemoveAllBuffs(b => self.GetBuffTime(b) <= 0);
                self.RemoveAllSkills(s => self.GetSkillTime(s) <= 0);
                self.RemoveAllCDKey(s => self.GetCD(s) <= 0);
            }
            foreach (var delBuf in detachBuffs)
            {
                var buffConfig = self.GetBuffConfig(self.GetBuffID(delBuf));
                if (buffConfig == null)
                {
                    continue;
                }
                //foreach (var buff in GetTankData().BuffInfos)
                {
                    BattleModule.DetachBuff(self, null, delBuf, buffConfig);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 技能的late tick,这是处理一些技能时间到,buff时间到之后的后续处理,需要手动调用
 /// </summary>
 /// <param name="self"></param>
 public static void Tick_Battle_Late(SkillObj self)
 {
     self.Tick_Battle_Late();
     //这个时候已经不再使用buff的迭代器,可以改变集合了,因为这里边的buff已经认为是被加在角色身上了,所以需要有后续处理得先加进去
     foreach (var b in self.GetTempBuffList())
     {
         self.AddBuffList(b);
     }
     self.ClearTempBuffList();
     IEnumerable<BuffInfo_New> detachBuffs = null;
     if (self.IsDead())
     {
         detachBuffs = self.RemoveAllBuffs((b) => true);
         self.RemoveAllSkills((s) => true);
         self.RemoveAllCDKey((c) => true);
     }else
     {
         detachBuffs = self.RemoveAllBuffs(b => self.GetBuffTime(b) <= 0);
         self.RemoveAllSkills(s => self.GetSkillTime(s) <= 0);
         self.RemoveAllCDKey(s => self.GetCD(s) <= 0);
     }
     foreach (var delBuf in detachBuffs)
     {
         var buffConfig = self.GetBuffConfig(self.GetBuffID(delBuf));
         if (buffConfig == null)
         {
             continue;
         }
         //foreach (var buff in GetTankData().BuffInfos)
         {
             BattleModule.DetachBuff(self, null, delBuf, buffConfig);
         }
     }
 }