//接受触发消息 public void PushTriggerNotify(GTriggerNotify pTriggerNotify) { if (pTriggerNotify == null) { return; } int nType = pTriggerNotify.m_nType; if (CanTriggerNotify(nType)) { if (pTriggerNotify.IsTriggerAtOnce()) { ProcessTriggerNotify(pTriggerNotify, m_TriggerSkillList[nType]); ReferencePool.Release(pTriggerNotify); } else { m_TriggerNotifyWaitList.Add(pTriggerNotify); } } else { ReferencePool.Release(pTriggerNotify); } }
public override bool ProcessTrigger(GTriggerNotify pNotify) { //检查触发条件 if (!CheckNotify(pNotify)) { return(false); } Log.Debug("Skill Trigger Succ '{0}'", m_pSkillData.Id); //设置触发消耗 SetTriggerCost(); //转化技能效果 TransfromEffectNotify(pNotify); Reset(); ResetSkillAValue(); //产生触发效果 OnTrigger(pNotify); //产生触发事件 if (m_pSkillData != null && m_pSkillData.IsTriggerTriggerNotify()) { Avatar pCaster = GetCaster(); if (pCaster != null && pCaster.SkillCom) { GetTarget(); pCaster.SkillCom.PushTriggerNotify(m_pSkillData.Id, m_TargetInfo.m_nTargetID, (int)eTriggerNotifyType.NotifyType_Trigger, 0, 0, pNotify.m_vSrcPos, pNotify.m_vTarPos, pNotify.m_vDir); } } return(true); }
//触发值合并转化 private void TransfromEffectNotify(GTriggerNotify pNotify) { //if(!pNotify || !m_pTransform) // return; //if(m_pTransform->m_nTransformType == SkillEffectTransform_Trigger_Value) //{ // m_AValue.Values[AValue::ad_skill_p] += pNotify->m_nValue * m_pTransform->m_fTransformPrecent; //} }
public void ProcessTriggerNotify(GTriggerNotify pTriggerNotify, List <GSkillSpellLogic> vTriggerList) { if (pTriggerNotify == null) { return; } foreach (var pTriggerLogic in vTriggerList) { if (pTriggerLogic == null) { continue; } pTriggerLogic.ProcessTrigger(pTriggerNotify); } }
//接受通用触发消息 public void PushTriggerNotify(int nSkillID, int nTargetID, int nType, int nFlag, int nValue, Vector3 pSrcPos, Vector3 pTarPos, Vector3 pAimDir) { if (CanTriggerNotify(nType)) { GTriggerNotify pNotify = ReferencePool.Acquire <GTriggerNotifyNormal>(); if (pNotify != null) { pNotify.m_nDataID = nSkillID; pNotify.m_nTargetID = nTargetID; pNotify.m_nType = nType; pNotify.m_nFlag = nFlag; pNotify.m_nValue = nValue; pNotify.m_vSrcPos = pSrcPos; pNotify.m_vTarPos = pTarPos; pNotify.m_vDir = pAimDir; PushTriggerNotify(pNotify); } } }
public virtual bool ProcessTrigger(GTriggerNotify pNotify) { return(false); }
public bool CheckNotify(GTriggerNotify pNotify) { if (!m_pOwner || m_pSkillData == null || pNotify == null) { return(false); } Avatar pCaster = GetCaster(); if (!pCaster || !pCaster.SkillCom) { return(false); } if (m_pSkillData.IsTargetSelfOnly()) { m_TargetInfo.m_nTargetID = pCaster.Id; m_TargetInfo.m_vSrcPos = pCaster.GetPos(); m_TargetInfo.m_vTarPos = pCaster.GetPos(); m_TargetInfo.m_vAimDir = pCaster.GetDir(); } else { m_TargetInfo.m_nTargetID = pNotify.m_nTargetID; m_TargetInfo.m_vTarPos = pNotify.m_vTarPos; m_TargetInfo.m_vSrcPos = pNotify.m_vSrcPos; if (pNotify.m_vDir == default(Vector3)) { m_TargetInfo.m_vAimDir = m_TargetInfo.m_vTarPos - m_TargetInfo.m_vSrcPos; } else { m_TargetInfo.m_vAimDir = pNotify.m_vDir; } m_TargetInfo.m_vAimDir.Normalize2D(); } //检查cd与消耗 if (!m_pOwner.CDCom || m_pOwner.CDCom.CheckCD(m_pSkillData.MSV_CDGroup)) { return(false); } if (!pCaster.SkillCom.CheckCost(m_pSkillData)) { return(false); } if (!pNotify.CheckTrigger(pCaster, m_pSkillData)) { return(false); } //if(m_pBuff && m_pBuff->IsInvalid()) // return false; if (!PassiveProcessCheck()) { return(false); } return(true); }
public void OnTrigger(GTriggerNotify pNotify) { ProcessEffect(); }