예제 #1
0
        /// <summary>
        /// 检查技能条件
        /// </summary>
        public override bool CheckSkillCondition(RoleActor actor, SkillActive skill)
        {
            if (!base.CheckSkillCondition(actor, skill))
            {
                return(false);
            }

            RoleActor target = actor.GetTarget(skill.mTargetId);

            if (null == target)
            {
                skill.mResult = eSkillResult.NotTarget;
                return(false);
            }

            if (actor.HostMap.MapInstanceId != target.HostMap.MapInstanceId)
            {
                Log.Log.Server.Info("Error, actor.HostMap.MapInstanceId != target.HostMap.MapInstanceId");
                return(false);
            }

            if (!actor.CanAttack(target))
            {
                skill.mResult = eSkillResult.NoAttack;
                return(false);
            }

            if (!skill.SkillCD.IsCoolDown() || !actor.SkillCD.IsCoolDown())
            {
                skill.mResult = eSkillResult.NotCoolDown;
                return(false);
            }

            if (skill.mDistance > skill.RangeMax + GameSet.Instance.SkillRangeSync)
            {
                skill.mResult = eSkillResult.DistanceToFar;
                return(false);
            }

            return(true);
        }