public virtual bool Init(DRSkillData pSkillData, GTargetInfo sTarInfo, SkillAValueData sSkillAValue, Avatar pCaster) { if (pSkillData == null) { return(false); } m_fCurTime = 0; m_pSkillData = pSkillData; m_TargetInfo = sTarInfo; m_fSpeed = m_pSkillData.MSV_ProjectileSpeed; m_fLifeTime = m_pSkillData.MSV_ProjectileTime; m_fFirstEffectTime = m_pSkillData.MSV_ProjectileFirstEffectTime; m_fEffectTime = m_pSkillData.MSV_EffectTime; m_fCurEffectTime = m_fFirstEffectTime; m_vExcludeList = new GSkillExcludeList(); m_vExcludeList.m_nCount = m_pSkillData.MSV_ProjectileEffectCount; m_vExcludeList.m_bCount = (m_vExcludeList.m_nCount > 0); //int nProjectileOffset = m_pSkillData.MSV_ProjectileOffset; //Vector3 vOffset = GSkillProjectileOffsetManager.Instance.GetProjectileOffset(nProjectileOffset); //m_TargetInfo.m_vSrcPos += vOffset; m_TargetInfo.m_vSrcPos += new Vector3(0, 1, 0); m_SkillAValue = sSkillAValue.CloneData(); m_vPreCheckPos = m_TargetInfo.m_vSrcPos; return(true); }
public void Clear() { m_fCurTime = 0; m_pSkillData = null; m_TargetInfo = null; m_fSpeed = 0; m_fLifeTime = 0; m_fFirstEffectTime = 0; m_fEffectTime = 0; m_fCurEffectTime = 0; m_vExcludeList = null; m_vExcludeList.m_nCount = 0; m_vExcludeList.m_bCount = false; m_SkillAValue = null; m_vPreCheckPos = default(Vector3); }
public void ProcessSkillEffect(DRSkillData pSkillData, GTargetInfo sTarInfo, SkillAValueData AValue, GSkillExcludeList vExcludeList) { if (pSkillData == null) { return; } Avatar pCaster = Owner; if (!pCaster) { return; } int nAreaLogic = pSkillData.MSV_AreaLogic; GSkillAreaLogic pAreaLogic = GSkillLogicManager.Instance.GetAreaLogic(nAreaLogic); if (pAreaLogic == null) { return; } if (nAreaLogic != (int)eSkillAreaLogic.SkillArea_Singleton && !pSkillData.IsAreaIncludeSelf()) { vExcludeList.Add(pCaster.Id); } List <Avatar> vTargetList = pAreaLogic.GetTargetList(pSkillData, pCaster, sTarInfo, vExcludeList); if (vTargetList == null || vTargetList.Count == 0) { return; } ////合并攻击方属性 todo合并技能属性集和模板属性集 //RoleAValue sSkillAValue; //sSkillAValue.Copy(sRoleValue); //sSkillAValue.Combine(pSkillData->m_RoleValue); //RoleAValue sCasterRoleValue; //sCasterRoleValue.Copy(sSkillAValue); //sCasterRoleValue.Combine(pCaster->GetRoleAValue()); //属性合并节点 todo 等技能数据包裹修复后 //if(pSkillData->IsCombineEffectNotify()) //{ // PushTriggerNotifyAValue(pSkillData->m_nDataID, 0, NotifyType_CombineEffect, pSkillData->GetIntValue(MSV_EffectType), &sCasterRoleValue); //} int nEffectLogic = pSkillData.MSV_EffectLogic; GSkillEffect pEffectLogic = GSkillLogicManager.Instance.GetEffectLogic(nEffectLogic); if (pEffectLogic == null) { return; } GTargetInfo tempTarInfo; foreach (var pTarget in vTargetList) { if (pTarget == null) { continue; } if (vExcludeList.Contains(pTarget.Id)) { continue; } PlayerAValueData sCasterRoleValue = pCaster.GetRoleAValue(); PlayerAValueData sTargetRoleValue = pTarget.GetRoleAValue(); if (sCasterRoleValue == null || sCasterRoleValue == null) { continue; } GSkillCalculation sCaluation = new GSkillCalculation(); sCaluation.m_pSkillData = pSkillData; sCaluation.m_pCaster = pCaster; sCaluation.m_pTarget = pTarget; sCaluation.m_CasterAValue = sCasterRoleValue.CloneData(); sCaluation.m_TargetAValue = sTargetRoleValue.CloneData(); sCaluation.m_SkillAValue = AValue; sCaluation.TransfromEffectTarget(); tempTarInfo = sTarInfo; tempTarInfo.m_nTargetID = pTarget.Id; tempTarInfo.m_vTarPos = pTarget.GetPos(); if (pEffectLogic.Process(sCaluation, tempTarInfo, AValue)) { //todo 添加log范围 //pAreaLogic.Draw(pSkillData, pCaster, pTarget, sTarInfo); } //填充重复列表 if (pSkillData.IsAreaAddExclude()) { vExcludeList.Add(pTarget.Id); } //减少效果次数 if (vExcludeList.m_nCount > 0) { --vExcludeList.m_nCount; } } }
//处理技能效果 public void ProcessSkillEffect(DRSkillData pSkillData, GTargetInfo sTarInfo, SkillAValueData AValue) { GSkillExcludeList vExcludeList = new GSkillExcludeList(); ProcessSkillEffect(pSkillData, sTarInfo, AValue, vExcludeList); }