public void HandleCastSkillResult(SkillCannotCastType result) { try { string CHN = StrDictionaryProvider.Instance.GetDictString(12); switch (result) { case SkillCannotCastType.kInCD: break; case SkillCannotCastType.kCostNotEnough: CHN = StrDictionaryProvider.Instance.GetDictString(13); break; case SkillCannotCastType.kUnknow: CHN = StrDictionaryProvider.Instance.GetDictString(14); break; default: CHN = StrDictionaryProvider.Instance.GetDictString(14); break; } if (m_TipsCD <= 0f) { LogicSystem.EventChannelForGfx.Publish("ge_screen_tip", "ui", CHN, UIScreenTipPosEnum.AlignBottom, UnityEngine.Vector3.zero); m_TipsCD = m_TipsDelta; } } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
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); }
public virtual void OnTick() { if (m_CurSkillNode != null && m_CurSkillNode.IsAlreadyPressUp) { if (StopSkill(m_CurSkillNode, SwordManSkillController.SKILL_PRESS_UP)) { m_CurSkillNode.IsAlreadyPressUp = false; } } DealBreakSkillTask(); UpdateAttacking(); UpdateSkillNodeCD(); if (m_WaiteSkillBuffer.Count <= 0) { return; } SkillNode node = m_WaiteSkillBuffer[m_WaiteSkillBuffer.Count - 1]; if (node == null) { m_WaiteSkillBuffer.Remove(node); return; } SkillNode nextNode = null; if ((node.Category == SkillCategory.kSkillQ || node.Category == SkillCategory.kSkillE) && m_WaiteSkillBuffer.Count >= 2) { SkillNode lastone = m_WaiteSkillBuffer[m_WaiteSkillBuffer.Count - 2]; if (node.Category == SkillCategory.kSkillQ && lastone.SkillQ != null && lastone.SkillQ.SkillId == node.SkillId) { nextNode = node; node = lastone; } else if (node.Category == SkillCategory.kSkillE && lastone.SkillE != null && lastone.SkillE.SkillId == node.SkillId) { nextNode = node; node = lastone; } } if (m_CurSkillNode == null || IsSkillCanBreak(m_CurSkillNode, node)) { SkillCannotCastType cannot_type = SkillCannotCastType.kUnknow; if (!IsSkillCanStart(node, out cannot_type)) { LogSystem.Debug("skill can't start"); if (IsPlayerSelf()) { GfxSystem.PublishGfxEvent("ge_skill_cannot_cast", "ui", cannot_type); GfxSystem.PublishGfxEvent("ge_skill_false", "ui"); HideSkillTip(node.Category); } m_WaiteSkillBuffer.Clear(); return; } if (m_CurSkillNode != null) { if (StopSkill(m_CurSkillNode, node)) { m_CurSkillNode.IsAlreadyPressUp = false; } } if (StartSkill(node)) { OnSkillStart(node); if (nextNode != null) { m_WaiteSkillBuffer.Add(nextNode); } PostSkillStart(node); } } }
// child should override this function public virtual bool IsSkillCanStart(SkillNode node, out SkillCannotCastType reason) { reason = SkillCannotCastType.kUnknow; return(true); }