Пример #1
0
        /// <summary>
        /// 单人技能的tick,这个需要手动调用
        /// </summary>
        /// <param name="self"></param>
        public static void Tick_Battle(SkillObj self)
        {
            if (self.IsDead())
            {
                return;
            }
            var skillList = self.GetSkillList(true);
            var buffList  = self.GetBuffList(true);
            var CDKeyList = self.GetCDKeyList();

            //buff
            if (buffList != null)
            {
                foreach (var buffInfo in buffList)
                {
                    BuffLogic buffLogic = GetBuffLogic(buffInfo, self);
                    if (buffLogic != null)
                    {
                        int            buffId     = self.GetBuffID(buffInfo);
                        BuffConfig_New buffConfig = self.GetBuffConfig(buffId);
                        buffLogic.Tick(self, buffInfo, buffConfig);
                    }
                    else
                    {
                        self.LogInfo("something error {0}".F(self.GetBuffID(buffInfo)));
                    }
                }
            }
            //技能
            if (skillList != null)
            {
                foreach (var skillInfo in skillList)
                {
                    SkillLogic skillLogic = GetSkillLogic(skillInfo, self);
                    if (skillLogic != null)
                    {
                        int             skillId     = self.GetSkillID(skillInfo);
                        SkillConfig_New skillConfig = self.GetSkillConfig(skillId);
                        skillLogic.Tick(self, skillInfo, skillConfig);
                    }
                    else
                    {
                        self.LogInfo("something error2 {0}".F(self.GetSkillID(skillInfo)));
                    }
                }
            }
            //CD
            if (CDKeyList != null)
            {
                foreach (var key in CDKeyList)
                {
                    self.SetCD(key, self.GetCD(key) - self.GetDeltaTime());
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 单人技能的tick,这个需要手动调用
 /// </summary>
 /// <param name="self"></param>
 public static void Tick_Battle(SkillObj self)
 {
     if (self.IsDead())
     {
         return;
     }
     var skillList = self.GetSkillList(true);
     var buffList = self.GetBuffList(true);
     var CDKeyList = self.GetCDKeyList();
     //buff
     if (buffList != null)
     {
         foreach (var buffInfo in buffList)
         {
             BuffLogic buffLogic = GetBuffLogic(buffInfo, self);
             if (buffLogic != null)
             {
                 int buffId = self.GetBuffID(buffInfo);
                 BuffConfig_New buffConfig = self.GetBuffConfig(buffId);
                 buffLogic.Tick(self, buffInfo, buffConfig);
             }
             else
             {
                 self.LogInfo("something error {0}".F(self.GetBuffID(buffInfo)));
             }
         }
     }
     //技能
     if (skillList != null)
     {
         foreach (var skillInfo in skillList)
         {
             SkillLogic skillLogic = GetSkillLogic(skillInfo, self);
             if (skillLogic != null)
             {
                 int skillId = self.GetSkillID(skillInfo);
                 SkillConfig_New skillConfig = self.GetSkillConfig(skillId);
                 skillLogic.Tick(self, skillInfo, skillConfig);
             }
             else
             {
                 self.LogInfo("something error2 {0}".F(self.GetSkillID(skillInfo)));
             }
         }
     }
     //CD
     if(CDKeyList != null)
     {
         foreach (var key in CDKeyList)
         {
             self.SetCD(key, self.GetCD(key) - self.GetDeltaTime());
         }
     }
 }