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 SkillAValueData GetSkillAValue() { SkillAValueData data = new SkillAValueData(); for (int i = 0; i < (int)SkillAValueDefine.size; i++) { data.Add((SkillAValueDefine)i, new AValueItem()); } return(data); }
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 override bool Process(GSkillCalculation sCalculation, GTargetInfo sTarInfo, SkillAValueData sSkillAValue) { Avatar pCaster = sCalculation.m_pCaster; Avatar pTarget = sCalculation.m_pTarget; DRSkillData pSkillData = sCalculation.m_pSkillData; if (pSkillData == null || !pCaster || !pTarget) { return(false); } if (pTarget.IsDead) { return(false); } SkillEffectEvent gameEvent = ReferencePool.Acquire <SkillEffectEvent>(); gameEvent.SkillID = pSkillData.Id; gameEvent.CasterID = pCaster.Id; gameEvent.TargetID = pTarget.Id; gameEvent.NotifyType = (int)eTriggerNotifyType.NotifyType_Damage; gameEvent.EffectType = pSkillData.MSV_EffectType; gameEvent.EffectValue = 0; sCalculation.CalculationDamage(ref gameEvent.EffectType, ref gameEvent.EffectValue); ////////////////////////////////////////////////////////////////////////// //产生效果事件 if (pCaster.SkillCom) { pCaster.SkillCom.PushTriggerNotify(pSkillData.Id, pTarget.Id, (int)eTriggerNotifyType.NotifyType_Damage, gameEvent.EffectType, (int)gameEvent.EffectValue, sTarInfo.m_vSrcPos, sTarInfo.m_vTarPos, sTarInfo.m_vAimDir); } if (pTarget.SkillCom) { pTarget.SkillCom.PushTriggerNotify(pSkillData.Id, pCaster.Id, (int)eTriggerNotifyType.NotifyType_OnDamage, gameEvent.EffectType, (int)gameEvent.EffectValue, sTarInfo.m_vSrcPos, sTarInfo.m_vTarPos, sTarInfo.m_vAimDir); } //产生效果事件 ////////////////////////////////////////////////////////////////////////// bool bHit = ((gameEvent.EffectType & (int)eTriggerNotify.TriggerNotify_Hit) > 0); //产生仇恨 ProcessHurtThreat(sCalculation.m_CasterAValue, pCaster, pTarget, gameEvent.EffectValue, bHit); GameEntry.Event.Fire(this, gameEvent); return(bHit); }
public abstract bool Process(GSkillCalculation sCalculation, GTargetInfo sTarInfo, SkillAValueData sSkillAValue);
public void ResetSkillAValue() { m_AValue = AValueManager.Instance.GetSkillAValue(); UpdateAValueByInstance(); TransfromRoleAValue(); }
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); }
//创建技能子弹 todo技能子弹修复后添加 public void CreateSkillProjectile(DRSkillData pSkillData, GTargetInfo sTarInfo, SkillAValueData m_SkillValue) { //if(Owner == null) // return; //if(pSkillData == null) // return; //int nType = pSkillData.MSV_ProjectileLogic; //GSkillProjectile pProjectile = GSkillLogicManager::Instance().CreateProjectile(nType); //if(!pProjectile) // return; //if(!pProjectile->Init(pSkillData, sTarInfo, sRoleValue, (GNodeAvatar*)m_pOwner)) //{ // FACTORY_DELOBJ(pProjectile); // return; //} //if(m_pOwner->GetScene()) //{ // ((GNodeScene*)m_pOwner->GetScene())->ChangeProjsCount(+1); //} //pProjectile->SetID(++m_nProjectileID); ////子弹坐标使用当前角色坐标 //if(pSkillData->IsBulletBornTarPos()) //{ // pProjectile->m_TargetInfo.m_vSrcPos = pProjectile->m_TargetInfo.m_vTarPos; // pProjectile->m_TargetInfo.m_vSrcPos.z = m_pOwner->GetSceneHeight(pProjectile->m_TargetInfo.m_vTarPos); //} //pProjectile->Tick(0, Owner); //MSV_ProjectileFirstEffectTime 为0的情况 //if(m_ProjectileDict.ContainsKey(pSkillData.Id)) //{ // m_ProjectileDict[pSkillData.Id].Add(pProjectile); //} //else //{ // List<GSkillProjectile> list = new List<GSkillProjectile>(); // list.Add(pProjectile); // m_ProjectileDict[pSkillData.Id].Add(list); //} }