From 6eb8ce81a683bf5a3024877fdcd4d8c95a8c87b5 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 29 六月 2023 17:15:43 +0800 Subject: [PATCH] 9818 【BT10】新增古宝特效效果 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 100 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py index 1cc9d8b..66493cf 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py @@ -29,6 +29,17 @@ import PlayerPet import ChConfig import ItemControler +import PlayerDienstgrad +import PlayerCoat + +GubaoEffType_FamilyWar = 48 # 参与仙盟联赛每X次+XXX属性 x次 +GubaoEffType_ElderBattlefield = 49 # 参与上古战场每X次+XXX属性 x次 +GubaoEffType_CrossBattlefield = 50 # 参与古神战场每X次+XXX属性 x次 +GubaoEffType_CrossYaomoBoss = 51 # 参与魔王入侵每X次+XXX属性 x次 +GubaoEffType_CrossFamilyFlagwar = 52 # 参与逐鹿万界每X次+XXX属性 x次 + +GubaoEffAttrIypeList = [GubaoEffType_FamilyWar, GubaoEffType_ElderBattlefield, GubaoEffType_CrossBattlefield, + GubaoEffType_CrossYaomoBoss, GubaoEffType_CrossFamilyFlagwar] GubaoEffType_ActivityPlace = 33 # 活跃修炼x次可领取物品 x次 GubaoEffType_Arena = 34 # 竞技场挑战x次可领取物品 x次 @@ -296,17 +307,17 @@ effAttrInfo = {} #GameWorld.DebugLog("GubaoStar属性: gubaoID=%s,star=%s,starEffIDList=%s" % (gubaoID, star, starEffIDList)) for effID in starEffIDList: - __calcStarEffAttrByID(curPlayer, effID, effAttrInfo) + __calcStarEffAttrByID(curPlayer, gubaoID, effID, effAttrInfo) #GameWorld.DebugLog(" effID=%s,effAttrInfo=%s" % (effID, effAttrInfo)) for attrID, attrValue in effAttrInfo.items(): PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList) # 保存计算值 - #GameWorld.DebugLog("古宝属性: %s" % allAttrList) + GameWorld.DebugLog("古宝属性: %s" % allAttrList) PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Gubao, allAttrList) return -def __calcStarEffAttrByID(curPlayer, effID, effAttrInfo): +def __calcStarEffAttrByID(curPlayer, gubaoID, effID, effAttrInfo): ''' 计算古宝特殊效果ID对应提升属性 ''' ipyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID) @@ -555,6 +566,85 @@ if attrID > 0 and addAttrValue > 0: effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + #41 x类型神兵每X级+X属性 x类型 x级 + elif effType == 41: + gwType = effCond + gwLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % gwType) + addAttrValue = int(gwLV / effCond2 * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,gwType=%s,gwLV=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, gwType, gwLV, effCond2, attrID, addAttrValue)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + #42 法器每X阶+X%法器总属性 x阶 + elif effType == 42: + customAttrDictFaQi = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_FaQi)[2] + faQiAllAttrInfo = customAttrDictFaQi.get("faQiAllAttrInfo", {}) + faQiLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FaQiLV) + addPer = int(faQiLV / effCond * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,faQiLV=%s,addPer=%s,faQiAllAttrInfo=%s" % (effID, effType, faQiLV, addPer, faQiAllAttrInfo)) + __addStarEffFuncAttr(ipyData, effAttrInfo, faQiAllAttrInfo, addPer) + + #43 每拥有X个X类型的称号+X属性 x类型 x个 + elif effType == 43: + activeTypeCountDict = PlayerDienstgrad.GetDienstgradActiveTypeCountInfo(curPlayer) + dType = effCond + activeCount = activeTypeCountDict.get(dType, 0) + addAttrValue = int(activeCount / effCond2 * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,dType=%s,activeTypeCountDict=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, dType, activeTypeCountDict, effCond2, attrID, addAttrValue)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + + #44 X品质时装总星数每X星+X属性 x类型 x星 + elif effType == 44: + costQualityLVDict = PlayerCoat.GetCoatQualityLVInfo(curPlayer) + quality = effCond + lvTotal = costQualityLVDict.get(quality, 0) + addAttrValue = int(lvTotal / effCond2 * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,quality=%s,costQualityLVDict=%s,effCond2=%s,attrID=%s,addAttrValue=%s" % (effID, effType, quality, costQualityLVDict, effCond2, attrID, addAttrValue)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + #45 每X级魅力等级+X属性 x级 + elif effType == 45: + charmLV = PlayerControl.GetCharmLV(curPlayer) + addAttrValue = int(charmLV / effCond * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,charmLV=%s,effCond=%s,attrID=%s,addAttrValue=%s" % (effID, effType, charmLV, effCond, attrID, addAttrValue)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + #46 每拥有X个神通技能+X属性 x个 + elif effType == 46: + customAttrDictShentong = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Shentong)[2] + shentongSkillInfo = customAttrDictShentong.get("shentongSkillInfo", {}) + skillCount = len(shentongSkillInfo) + addAttrValue = int(skillCount / effCond * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,skillCount=%s,effCond=%s,attrID=%s,addAttrValue=%s,shentongSkillInfo=%s" % (effID, effType, skillCount, effCond, attrID, addAttrValue, shentongSkillInfo)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + #47 神通技能总等级每X级+X属性 x级 + elif effType == 47: + customAttrDictShentong = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Shentong)[2] + shentongSkillInfo = customAttrDictShentong.get("shentongSkillInfo", {}) + skillLVTotal = sum(shentongSkillInfo.values()) + addAttrValue = int(skillLVTotal / effCond * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,skillLVTotal=%s,effCond=%s,attrID=%s,addAttrValue=%s,shentongSkillInfo=%s" % (effID, effType, skillLVTotal, effCond, attrID, addAttrValue, shentongSkillInfo)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + + #48 参与仙盟联赛每X次+XXX属性 x次 + #49 参与上古战场每X次+XXX属性 x次 + #50 参与古神战场每X次+XXX属性 x次 + #51 参与魔王入侵每X次+XXX属性 x次 + #52 参与逐鹿万界每X次+XXX属性 x次 + elif effType in GubaoEffAttrIypeList: + effValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType)) + addAttrValue = int(effValue / effCond * effAttrValue) + #GameWorld.DebugLog(" effID=%s,effType=%s,effValue=%s,effCond=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effValue, effCond, attrID, addAttrValue)) + if attrID > 0 and addAttrValue > 0: + effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue + return def __addStarEffFuncAttr(ipyData, effAttrInfo, funcAttrInfo, effAttrValue): @@ -574,8 +664,9 @@ return def AddGubaoItemEffValue(curPlayer, effType, addCnt): - if effType not in GubaoEffTtemIypeList: + if effType not in GubaoEffTtemIypeList and effType not in GubaoEffAttrIypeList: return + isAttr = False ipyDataMgr = IpyGameDataPY.IPY_Data() for index in xrange(ipyDataMgr.GetGubaoCount()): ipyData = ipyDataMgr.GetGubaoByIndex(index) @@ -599,6 +690,11 @@ GameWorld.DebugLog("更新古宝物品效果类型进度值: gubaoID=%s,effID=%s,effType=%s,effValue=%s,addCnt=%s,updValue=%s" % (gubaoID, effID, effType, effValue, addCnt, updValue), curPlayer.GetPlayerID()) Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True) + if effType in GubaoEffAttrIypeList: + isAttr = True + + if isAttr: + RefreshGubaoAttr(curPlayer) return def GetGubaoItemEffAward(curPlayer, gubaoID, effIDStr): -- Gitblit v1.8.0