From 9ea1f366518b9c3713c52c1e6d79f3937cc3d7b5 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 06 五月 2019 16:49:38 +0800 Subject: [PATCH] 6628 【2.0】【后端】查看玩家装备和查看玩家战力功能(修复查看同地图玩家时返回的是自己的信息bug) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 108 ++++++++++++++++++++++-------------------------------- 1 files changed, 44 insertions(+), 64 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py index 7f720e3..ffb92a0 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py @@ -102,9 +102,6 @@ global g_ClientHurtDict g_ClientHurtDict = collections.OrderedDict() - # 缓存单次技能攻击的最大伤害, 减少计算量 - curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientMaxHurtValue, 0) - def GetClientHurtByObj(objID, objType): global g_ClientHurtDict @@ -983,7 +980,7 @@ #使用技能行为状态, 客户端限制 if not OperControlManager.IsObjCanDoAction(curPlayer, ChConfig.Def_Obj_ActState_ClientSkill, - curSkill.GetSkillOfSeries()): + curSkill.GetSkillOfSeries(), curSkill): AttackFailNotify(curPlayer, curSkill) return @@ -1850,9 +1847,8 @@ #获得技能等级 curSkillLV = curSkill.GetSkillLV() - DataRecordPack.DR_LearnORUPSkill(curPlayer, curSkillID, curSkillLV) - + EventShell.EventRespons_SkillUp(curPlayer, curSkill.GetFuncType()) GameWorld.Log("升级技能名 = %s 成功, 当前等级 = %s"%(curSkill.GetSkillName(), curSkill.GetSkillLV()), curPlayer.GetPlayerID()) return True @@ -2017,8 +2013,8 @@ return False #玩家属性点要求 - stateSkillLV = curSkill.GetStateSkillLV() #需要基础属性ID*10000+需要属性点 - needBaseAttrID, needBaseAttrValue = stateSkillLV /10000, stateSkillLV%10000 + stateSkillLV = curSkill.GetStateSkillLV() #需要基础属性ID*100000+需要属性点 + needBaseAttrID, needBaseAttrValue = GetSkillUpNeedAttr(stateSkillLV) if needBaseAttrID and needBaseAttrValue: baseAttrDict = { ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer), @@ -2036,6 +2032,8 @@ return False return True +## 获取技能升级属性需求 rutrun attrID, attrvalue +def GetSkillUpNeedAttr(stateSkillLV):return stateSkillLV /100000, stateSkillLV%100000 #// A5 16 选择技能五行专精 #tagCMSelectSkillElement # @@ -2051,7 +2049,10 @@ if not ipyData: return mainSkillID = ipyData.GetMainSkillID() - + if curPlayer.GetLV() < ipyData.GetNeedLV(): + GameWorld.DebugLog('选择技能五行专精等级不足!') + return + curElementSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % mainSkillID) if selectSkillID == curElementSkillID: GameWorld.DebugLog('已经是该专精技能!') @@ -2070,9 +2071,9 @@ #更新新技能 RefreshElementSkill(curPlayer, selectSkillID) # 重刷被动技能 - PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer) + PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer) # 重刷技能战力 - PlayerControl.PlayerControl(curPlayer).RefreshAllSkill() + PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState() NotifyElementSkillInfo(curPlayer, mainSkillID) return @@ -2094,7 +2095,7 @@ maxSkillLV = len(limitInfoList) updSkillLV = 0 for i, limitInfo in enumerate(limitInfoList): - needAttrID, needAttrValue = limitInfo /10000, limitInfo%10000 + needAttrID, needAttrValue = GetSkillUpNeedAttr(limitInfo) curAttrValue = baseAttrDict.get(needAttrID, 0) if curAttrValue >= needAttrValue: updSkillLV = maxSkillLV - i @@ -2102,7 +2103,7 @@ skillManager = curPlayer.GetSkillManager() curSkill = skillManager.FindSkillBySkillTypeID(skillTypeID) curSkillLV = curSkill.GetSkillLV() if curSkill else 0 - + if updSkillLV == curSkillLV: return elif updSkillLV < curSkillLV: @@ -2117,11 +2118,12 @@ def RefreshElementSkillByAttr(curPlayer, attrIDList): #加点、丹药、境界、洗点 会影响灵根点 __InitElementSkillInfo() - isRefresh = False + + needRefreshSkillIDList = [] skillManager = curPlayer.GetSkillManager() for i in xrange(skillManager.GetSkillCount()): hasSkill = skillManager.GetSkillByIndex(i) - hasSkillID = hasSkill.GetSkillID() + hasSkillID = hasSkill.GetSkillTypeID() ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False) if not ipyData: continue @@ -2130,15 +2132,20 @@ continue if curElementSkillID not in PyGameData.g_elemntSkillDict: continue - if PyGameData.g_elemntSkillDict[curElementSkillID][0] /10000 not in attrIDList: + attrID = GetSkillUpNeedAttr(PyGameData.g_elemntSkillDict[curElementSkillID][0])[0] + if attrID not in attrIDList: continue - if RefreshElementSkill(curPlayer, curElementSkillID): + needRefreshSkillIDList.append(curElementSkillID) + + isRefresh = False + for skillID in needRefreshSkillIDList: + if RefreshElementSkill(curPlayer, skillID): isRefresh = True if isRefresh: # 重刷被动技能 PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer) # 重刷技能战力 - PlayerControl.PlayerControl(curPlayer).RefreshAllSkill() + PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState() return def GetElementSkillCnt(curPlayer): @@ -2147,7 +2154,7 @@ skillManager = curPlayer.GetSkillManager() for i in xrange(skillManager.GetSkillCount()): hasSkill = skillManager.GetSkillByIndex(i) - hasSkillID = hasSkill.GetSkillID() + hasSkillID = hasSkill.GetSkillTypeID() ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False) if not ipyData: continue @@ -2158,7 +2165,7 @@ return cnt def __InitElementSkillInfo(): - #缓存技能专精信息{skillID:[attrID*10000+needValue,..]} + #缓存技能专精信息{skillID:[attrID*100000+needValue,..]} if not PyGameData.g_elemntSkillDict: ipyMgr = IpyGameDataPY.IPY_Data() for i in xrange(ipyMgr.GetSkillElementCount()): @@ -2184,7 +2191,7 @@ skillManager = curPlayer.GetSkillManager() for i in xrange(skillManager.GetSkillCount()): hasSkill = skillManager.GetSkillByIndex(i) - hasSkillID = hasSkill.GetSkillID() + hasSkillID = hasSkill.GetSkillTypeID() ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False) if not ipyData: continue @@ -2669,6 +2676,11 @@ callFunc = GameWorld.GetExecFunc(GameBuffs, "Buff_%s.%s"%(moduleSuffix, "OnCalcBuffEx")) if callFunc: callFunc(objDetel, curEffect, allAttrList[index], curBuff) + + # 持续性属性变化的buff,目前只有持续减益 + callFunc = GameWorld.GetExecFunc(GameBuffs, "BuffProcess_%s.%s"%(moduleSuffix, "OnCalcBuffEx")) + if callFunc: + callFunc(objDetel, curEffect, allAttrList[index], curBuff) return ## 获得buff效果的计算模块文件后缀 @@ -2864,19 +2876,6 @@ OperControlManager.SetObjActState(curObj, buffSkill) -# 非属性技能算属性 特殊处理 -# 法宝SP技能 如1-4级为增加属性,第5级为伤害效果,第6-10级就要包含属性和伤害效果 -def CalcFabaoSPSkillAttr(curPlayer, curPlayerSkill, allAttrList): - if curPlayerSkill.GetFuncType() != ChConfig.Def_SkillFuncType_FbSPSkill: - return - - value = GetMaxHPAttrValue(curPlayerSkill) - if value == 0: - return - - PlayerControl.CalcAttrDict_Type(ShareDefine.Def_Effect_MaxHP, value, allAttrList) - return - # 计算属性类技能的属性,同buff层不算战力 def CalcPassiveAttr_Effect(curPlayer, allAttrList): @@ -2886,7 +2885,6 @@ if curPlayerSkill == None: continue - CalcFabaoSPSkillAttr(curPlayer, curPlayerSkill, allAttrList) if not SkillCommon.isPassiveAttr(curPlayerSkill): continue @@ -2930,15 +2928,15 @@ def CalcBuffers_Effect(curPlayer, allAttrList, calcEffectIDList=[]): for buffType in range(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax): + #这些类型不影响玩家计算属性 + if buffType in [IPY_GameWorld.bfProcessBuff, #IPY_GameWorld.bfProcessDeBuff, + IPY_GameWorld.bfMapBuff, + IPY_GameWorld.bfEquipBuff]: + continue + buffTuple = SkillCommon.GetBuffManagerByBuffType(curPlayer, buffType) #通过类型获取目标的buff管理器为空,则跳出 if buffTuple == (): - continue - - #这些类型不影响玩家计算属性 - if buffType in [IPY_GameWorld.bfProcessBuff, - IPY_GameWorld.bfProcessDeBuff, IPY_GameWorld.bfMapBuff, - IPY_GameWorld.bfEquipBuff]: continue buffManager = buffTuple[0] @@ -3367,7 +3365,6 @@ # 不受限制和影响的技能 def Trigger_UseSkill(attacker, defender, curSkill, tick, tagRoundPosX = 0, tagRoundPosY = 0, isEnhanceSkill = False): - #这个技能是Buff if SkillCommon.IsBuff(curSkill): @@ -3448,16 +3445,6 @@ return True -#=============================================================================== -# Def_Effect_GoddessAddHP = 1300 # 加血 (压总值血量百分比) -# Def_Effect_AddHPValue_All = 1027 # 持续加血(压总值攻击) -# Def_Effect_LostHPValue_All = 1033 # 持续减血(压总值攻击) -# Def_Effect_LostAndAddHPValue_All = 1050 # 持续吸血(压总值攻击) -# Def_Effect_LostHPValue_Single = 1201 # 持续单次减血计算 攻击 -# Def_Effect_AddHPValue_Single = 1202 # 持续单次加血计算 攻击 -# Def_Effect_LostHP_MaxHP = 1089 # 持续减血(压总值, 血量百分比) -#=============================================================================== - #waring: 此值影响了BUFF的替换规则,值大替换小的 ##添加BUFF前压入BUFF的值,这边只计算和攻击者相关,仅支持放在效果1的buff # @param attacker 攻击方 @@ -3466,7 +3453,6 @@ def GetAddBuffValue(attacker, curSkill, defender): #验证该技能效果1的ID,提取公式 curEffect = curSkill.GetEffect(0) - effectID = curEffect.GetEffectID() moduleSuffix = GetBuffModuleSuffix(curEffect) @@ -3583,7 +3569,7 @@ return #--------------------------------------------------------------------- -# 获得关联技能 +# 获得关联技能,0 全部 1是主动型技能(法宝,普攻) 其他技能ID def GetConnectSkillID(curSkill): return curSkill.GetExAttr1() @@ -3620,9 +3606,7 @@ def GetUpLVCostItemNum(curSkill): return curSkill.GetExAttr5() -# 技能特殊增加属性配置,目前只支持生命,潜力技能专用 -def GetMaxHPAttrValue(curSkill): - return curSkill.GetMP() + ##获得当前技能升级消耗的真气值 # @param curSkill 当前技能技能 @@ -3727,19 +3711,15 @@ ## 获取技能总等级 # @param curPlayer # @return allSkillLV:总技能等级 -def GetAllSkillLV(curPlayer): - successSkillIDList = ReadChConfig.GetEvalChConfig("SuccessSkillIDList") +def GetAllSkillLV(curPlayer, funcType): allSkillLV = 0 skillManager = curPlayer.GetSkillManager() - for i in range(0 , skillManager.GetSkillCount()): + for i in xrange(skillManager.GetSkillCount()): curPlayerSkill = skillManager.GetSkillByIndex(i) if curPlayerSkill == None: continue - - skillTypeID = curPlayerSkill.GetSkillTypeID() - if skillTypeID not in successSkillIDList: + if curPlayerSkill.GetFuncType() != funcType: continue - skillLV = curPlayerSkill.GetSkillLV() allSkillLV += skillLV -- Gitblit v1.8.0