internal SkillInfo GetSkillInfoByNode(SkillNode node)
        {
            SkillInfo result = null;

            if (node != null)
            {
                SkillStateInfo state = m_Owner.GetSkillStateInfo();
                if (state != null)
                {
                    result = state.GetSkillInfoById(node.SkillId);
                }
            }
            return(result);
        }
Example #2
0
        protected bool IsInCombatState()
        {
            SkillStateInfo state = GetOwner().GetSkillStateInfo();

            if (state == null)
            {
                return(false);
            }
            if (state.IsSkillActivated() && state.GetCurSkillInfo().SkillId != GetOwner().Combat2IdleSkill)
            {
                return(true);
            }
            if (state.IsImpactActive())
            {
                return(true);
            }
            return(false);
        }
        public override bool IsSkillCanStart(SkillNode node, out SkillCannotCastType reason)
        {
            SkillStateInfo state = m_Owner.GetSkillStateInfo();
            SkillInfo      info  = state.GetSkillInfoById(node.SkillId);

            reason = SkillCannotCastType.kUnknow;
            if (info == null)
            {
                reason = SkillCannotCastType.kNotFindSkill;
                return(false);
            }
            if (m_Owner.IsDead())
            {
                reason = SkillCannotCastType.kOwnerDead;
                return(false);
            }
            if (state != null && m_Owner.IsUnderControl() && !CanStartWhenImpactControl(info))
            {
                reason = SkillCannotCastType.kCannotCtrol;
                return(false);
            }
            if (IsSkillInCD(node))
            {
                reason = SkillCannotCastType.kInCD;
                return(false);
            }
            if (!IsCostEnough(node))
            {
                reason = SkillCannotCastType.kCostNotEnough;
                return(false);
            }
            SkillInfo skillinfo = m_Owner.GetSkillStateInfo().GetCurSkillInfo();

            if (skillinfo != null && skillinfo.IsForbidNextSkill &&
                skillinfo.ConfigData != null && skillinfo.ConfigData.NextSkillId == node.SkillId)
            {
                reason = SkillCannotCastType.kUnknow;
                return(false);
            }
            return(true);
        }