From ca11e79c7981d66e3d8bdbe12b3f2b44b3ae7063 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 26 一月 2026 16:18:36 +0800
Subject: [PATCH] 438 【方案】方案预设-服务端(武将方案切换时如果为空方案则复制当前武将方案;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
index 6d0e74e..cd3b221 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -82,6 +82,10 @@
         reloadEffHeroCard(curPlayer, self) # 更新武将阵容强制重刷生效卡牌
         return
     
+    def OnSwitch(self):
+        self.isHeroChange = True
+        return
+    
     def IsHeroItemIn(self, itemIndex): return itemIndex in self.heroItemDict
 
     def GetHeroEffectiveCard(self, heroID): return self._effectiveCardDict.get(heroID, [-1, -1, False])
@@ -1083,17 +1087,26 @@
                              "starTalentValue":starTalentValue, "starTalentPer":starTalentPer, "breakLVValue":breakLVValue, "breakLVPer":breakLVPer,
                              "awakeTalentValue":awakeTalentValue, "awakeTalentPer":awakeTalentPer,
                              }
-            
+            #testDict = {'lineupHaloPer': 0.1, 'minggeValue': 43685, 'heroLVValue': 836851, 'cardPer': 72.276, 'realmValue': 9878456, 'fetterPer': 0.15, 'horseValue': 5040, 'equipValue': 18381400, 'inheritPer': 1.4, 'lvValue': 53600}
+            #testDict = {'inheritPer': 1, 'minggeValue': 905, 'equipValue': 796}
+            #for k in attrParamDict.keys():
+            #    v = testDict.get(k, 0)
+            #    exec("%s = %s" % (k, v))
+            #    attrParamDict[k] = v
             if attrID in ChConfig.BaseAttrIDList:
-                attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict, toInt=False, ndigits=3)
+                attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict, toInt=False, ndigits=2)
+                #GameWorld.DebugLog("    evalValue=%s,attrValue=%s" % (eval(baseAttrFormula), attrValue))
             else:
-                attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict, toInt=False, ndigits=3)
+                attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict, toInt=False, ndigits=2)
+                #GameWorld.DebugLog("    evalValue=%s,attrValue=%s" % (eval(otherAttrFormula), attrValue))
+            # 前端对比刷属性明细时需要
             if g_calcDetail and attrValue > 0:
                 calcParamDict = {}
                 for k, v in attrParamDict.items():
-                    if v > 0:
-                        calcParamDict[k] = v
-                GameWorld.DebugLog("    heroID=%s,attrID=%s,attrValue=%s,attrParamDict=%s" % (heroID, attrID, attrValue, calcParamDict))
+                    if not v or (k == "inheritPer" and v == 1):
+                        continue
+                    calcParamDict[k] = v
+                GameWorld.DebugLogEx("    heroID=%s,attrID=%s,attrValue=%s,%s", heroID, attrID, attrValue, calcParamDict)
                 
             attrIpyData = IpyGameDataPY.GetIpyGameData("PlayerAttr", attrID)
             attrName = attrIpyData.GetParameter() if attrIpyData else "%s" % attrID

--
Gitblit v1.8.0