public PlayerAValueData GetPlayerAValue() { PlayerAValueData data = new PlayerAValueData(); for (int i = 0; i < (int)AvatarAValueDefine.size; i++) { data.Add((AvatarAValueDefine)i, new AValueItem()); } return(data); }
public float GetThreatValue(PlayerAValueData sCasterAValue, float fUserData, bool bHit) { //根据不同职业的不同属性集获得各自的嘲讽系数 //float fThreat = sCasterAValue.Values[AValue::threat] * (1 + sCasterAValue.Values[AValue::threat_r]); //fThreat = Mathf.Max(fThreat * ((bHit) ? 1 : 0.1), 1); float fThreat = Mathf.Max(fUserData * ((bHit) ? 1 : 0.1f), 1); return(fThreat); }
public void Merge(PlayerAValueData rhs) { foreach (var item in rhs) { if (!ContainsKey(item.Key)) { continue; } this[item.Key].Merge(item.Value); } }
public void ProcessHealThreat(PlayerAValueData sCasterAValue, Avatar pCaster, Avatar pTarget, float fUserData, bool bHit) { if (pCaster == null || pTarget == null || pTarget.ThreatCom == null) { return; } float fThreat = GetThreatValue(sCasterAValue, fUserData, bHit); pTarget.ThreatCom.OnHeal(pCaster, fThreat); }
public AvatarData(int entityId, int typeId, CampType camp) : base(entityId, typeId) { m_Camp = camp; m_AValue = AValueManager.Instance.GetPlayerAValue(); }
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; } } }