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); }
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); }