コード例 #1
0
        /// <summary>
        ///     请求使用技能,但是请求不一定会被执行,还需要进行条件检验
        /// </summary>
        /// <param name="skillType">技能类型</param>
        public void RequestUseSkill(int skillType)
        {
            //判断抓取打断;
            MeController.JudgeGraspIntercept();
            //是否已经使用了技能;
            bool isRealUseSkill = false;

            if (LeftCdTimes[skillType] > 0 ||
                (MeController.GetMeVo().Id == MeVo.instance.Id && SkillMpCost[skillType] > MeController.GetMeVo().CurMp))
            {
                return; //CD状态不能使用技能
            }
            if (MeController.StatuController.CurrentStatu == Status.IDLE ||
                MeController.StatuController.CurrentStatu == Status.RUN)
            {
                isRealUseSkill = true;
                UseSkill(skillType); //待机状态或者跑动状态可使用技能
            }
            else if ((MeController.StatuController.CurrentStatu == Status.ATTACK1 && skillType == Attack2) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK2 && skillType == Attack2) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK2 && skillType == Attack3) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK3 && skillType == Attack3) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK3 && skillType == Attack4) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK5 && skillType == Attack5) ||
                     (MeController.StatuController.CurrentStatu == Status.ATTACK6 && skillType == Attack6))
            {
                isRealUseSkill = true;
                UseSkill(skillType); //连击技能的触发
            }
            if (MeController.StatuController.CurrentStatu == Status.ATTACK1 ||
                MeController.StatuController.CurrentStatu == Status.ATTACK2 ||
                MeController.StatuController.CurrentStatu == Status.ATTACK3 ||
                MeController.StatuController.CurrentStatu == Status.ATTACK4 ||
                MeController.StatuController.CurrentStatu == Status.ATTACK5 ||
                MeController.StatuController.CurrentStatu == Status.ATTACK6 ||
                ((MeController.StatuController.CurrentStatu == Status.SKILL1 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL2 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL3 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL4 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL5 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL6 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL7 ||
                  MeController.StatuController.CurrentStatu == Status.SKILL8) &&
                 isRealUseSkill == false))
            {
                if (skillType >= Skill1)
                {
                    if (SkillList.Count > 0)
                    {
                        SkillList.RemoveAt(0);
                    }
                    SkillList.Add(skillType);
                }
                //if (SkillList.Count <= 1 && skillType >= Skill1)
                //{
                //    SkillList.Add(skillType); //只缓存一个技能
                //    Debug.Log("RequestUseSkill 测试进入");
                //}
            }
        }
コード例 #2
0
 virtual public void BeAttacked(ActionVo actionVo)
 {
     //判断抓取打断;
     meController.JudgeGraspIntercept();
 }