From 369e52f7a7b980c882ca322615b1995796fe9223 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 06 十一月 2018 21:38:13 +0800
Subject: [PATCH] 4595 【1.2】【后端】装备战力、评分优化(角色装备、神兽装备 )

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
index a4adcd0..79917ff 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -510,6 +510,9 @@
     totalPlusLv = 0 #出战神兽装备总强化等级
     fightPowerEx = 0
     allAttrList = [{} for _ in range(4)]
+    allAttrListEquip = [{} for _ in range(4)]
+    allAttrListEquipPlus = [{} for _ in range(4)]
+    equipScoreTotal = 0 #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
     
     dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
     equipPackCount = dogzEquipPack.GetCount()
@@ -540,6 +543,8 @@
             if curEquip.IsEmpty():
                 continue
             
+            equipScoreTotal += ItemCommon.GetEquipGearScore(curEquip)
+            
             #itemID = curEquip.GetItemTypeID()
             # 装备基础属性
             for effIndex in xrange(curEquip.GetEffectCount()):
@@ -550,8 +555,8 @@
                 if not effID or effID == ChConfig.Def_Effect_DogzEquipPlusExp:
                     continue
                 effValue = curEffect.GetEffectValue(0)
-                PlayerControl.CalcAttrDict_Type(effID, effValue, allAttrList)
-                #GameWorld.DebugLog("    装备基础: itemID=%s,effID=%s,effValue=%s, %s" % (itemID, effID, effValue, allAttrList))
+                PlayerControl.CalcAttrDict_Type(effID, effValue, allAttrListEquip)
+                #GameWorld.DebugLog("    装备基础: itemID=%s,effID=%s,effValue=%s, %s" % (itemID, effID, effValue, allAttrListEquip))
                 
             # 强化属性
             curPlusLV = curEquip.GetUserAttrByIndex(ShareDefine.Def_IudetDogzEquipPlus, 0)
@@ -563,18 +568,25 @@
                 if plusAttrTypeList and len(plusAttrTypeList) == len(plusAttrValueList):
                     for plusIndex, plusAttrID in enumerate(plusAttrTypeList):
                         plusAttrValue = plusAttrValueList[plusIndex]
-                        PlayerControl.CalcAttrDict_Type(plusAttrID, plusAttrValue, allAttrList)
-                        #GameWorld.DebugLog("    装备强化: itemID=%s,plusAttrID=%s, plusAttrValue=%s, %s" % (itemID, plusAttrID, plusAttrValue, allAttrList))
+                        PlayerControl.CalcAttrDict_Type(plusAttrID, plusAttrValue, allAttrListEquipPlus)
+                        #GameWorld.DebugLog("    装备强化: itemID=%s,plusAttrID=%s, plusAttrValue=%s, %s" % (itemID, plusAttrID, plusAttrValue, allAttrListEquipPlus))
                         
             # 传奇属性
-            ChEquip.CalcAttr_LegendAttr(curPlayer, curEquip, allAttrList)
-            #GameWorld.DebugLog("    装备传奇: itemID=%s,%s" % (itemID, allAttrList))
+            ChEquip.CalcAttr_LegendAttr(curPlayer, curEquip, allAttrListEquip)
+            #GameWorld.DebugLog("    装备传奇: itemID=%s,%s" % (itemID, allAttrListEquip))
             
         # 附加战力
         fightPowerEx += ipyData.GetFightPowerEx()
         
     # 保存计算值
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Dogz, allAttrList)
+    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzEquip, allAttrListEquip)
+    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzEquipPlus, allAttrListEquipPlus)
+    
+    #计算装备基础属性附加战力 (目前组成: 评分战力 + ...)
+    equipFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
+    #GameWorld.DebugLog("神兽装备评分战力: equipScoreTotal=%s,equipFightPowerEx=%s" % (equipScoreTotal, equipFightPowerEx))
+    fightPowerEx += equipFightPowerEx
     curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Dogz, fightPowerEx)
     
     # 技能属性,从Def_CalcAttrFunc_Dogz获取

--
Gitblit v1.8.0