From 3f862208516829ee806168cbb633bc9221f0cf6a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 11 十月 2025 20:30:10 +0800
Subject: [PATCH] 271 【内政】古宝系统-服务端

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py |   27 +++++++++++++++++++++------
 1 files changed, 21 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 2f18a62..ee604f5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -23,6 +23,8 @@
 import PlayerControl
 import IpyGameDataPY
 import FormulaControl
+import PlayerPrestigeSys
+import PlayerGubao
 import PlayerHero
 import GameWorld
 import ChConfig
@@ -410,6 +412,8 @@
     CalcRoleBase(curPlayer)
     ChEquip.CalcRoleEquipAttr(curPlayer)
     PlayerHero.CalcHeroAddAttr(curPlayer)
+    PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
+    PlayerGubao.CalcGubaoAttr(curPlayer)
     return
 
 def doRefreshLineupAttr(curPlayer, olPlayer, lineup):
@@ -631,7 +635,9 @@
     lvAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_LV)
     equipAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_MainEquip)
     bookAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_HeroBook)
-
+    realmAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Realm)
+    gubaoAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Gubao)
+    
     GameWorld.DebugLog("    国家武将统计=%s" % countryHeroInfo, playerID)
     GameWorld.DebugLog("    羁绊武将统计=%s" % fetterHeroInfo, playerID)
     GameWorld.DebugLog("    武将自身属性=%s" % heroSelfAttrInfo, playerID)
@@ -645,6 +651,8 @@
     GameWorld.DebugLog("    主公等级属性=%s" % lvAttrDict, playerID)
     GameWorld.DebugLog("    主公装备属性=%s" % equipAttrDict, playerID)
     GameWorld.DebugLog("    主公图鉴属性=%s" % bookAttrDict, playerID)
+    GameWorld.DebugLog("    主公官职属性=%s" % realmAttrDict, playerID)
+    GameWorld.DebugLog("    主公古宝属性=%s" % gubaoAttrDict, playerID)
     
     PlayerLV = curPlayer.GetLV()
     OfficialLV = curPlayer.GetOfficialRank()
@@ -676,6 +684,12 @@
             bookValue = bookAttrDict.get(attrID, 0)
             bookPer = bookAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
             
+            realmValue = realmAttrDict.get(attrID, 0)
+            realmPer = realmAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
+            
+            gubaoValue = gubaoAttrDict.get(attrID, 0)
+            gubaoPer = gubaoAttrDict.get(attrPerID, 0) / 10000.0 if attrPerID else 0
+            
             lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = 0, 0, 0, 0
             if attrID in ChConfig.BaseAttrIDList:
                 lineupInitAddPer, lineupLVAddPer, lineupBreakLVAddPer, lineupStarAddPer = InitAddPer, LVAddPer, BreakLVAddPer, StarAddPer
@@ -701,7 +715,8 @@
                 awakeTalentPer = awakeTalentAttrDict.get(attrPerID, 0) / 10000.0
                 
             # 计算
-            attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, 
+            attrParamDict = {"lvValue":lvValue, "equipValue":equipValue, "bookValue":bookValue, "bookPer":bookPer, "realmValue":realmValue, "realmPer":realmPer, 
+                             "gubaoValue":gubaoValue, "gubaoPer":gubaoPer, 
                              "lineupInitAddPer":lineupInitAddPer, "lineupLVAddPer":lineupLVAddPer, "lineupBreakLVAddPer":lineupBreakLVAddPer, "lineupStarAddPer":lineupStarAddPer,
                              "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer,
                              "lineupHaloValue":lineupHaloValue, "lineupHaloPer":lineupHaloPer, "fetterValue":fetterValue, "fetterPer":fetterPer,
@@ -710,9 +725,9 @@
                              }
             
             if attrID in ChConfig.BaseAttrIDList:
-                attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict)
+                attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict, toInt=False, ndigits=3)
             else:
-                attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict)
+                attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict, toInt=False, ndigits=3)
             #GameWorld.DebugLog("    attrID=%s,attrValue=%s,attrParamDict=%s" % (attrID, attrValue, attrParamDict))
             
             attrIpyData = IpyGameDataPY.GetIpyGameData("PlayerAttr", attrID)
@@ -728,7 +743,7 @@
                 logAttrDict["%s-%s" % (attrID, attrName)] = attrValue
             
         # 计算战力
-        fightPower = FormulaControl.Eval("fightPowerFormula", fightPowerFormula, fightPowerParamDict)
+        fightPower = FormulaControl.Eval("fightPowerFormula", fightPowerFormula, fightPowerParamDict, toInt=True)
         
         GameWorld.DebugLog("    heroID=%s,fightPower=%s,heroSkillIDList=%s" % (heroID, fightPower, lineupHero.heroSkillIDList), playerID)
         skillTypeIDDict = {}
@@ -752,7 +767,7 @@
             skillID = skillData.GetSkillID()
             lineupHero.heroSkillIDList.append(skillID)
             paramDict = {"SkillPower":skillData.GetFightPower(), "PlayerLV":PlayerLV, "OfficialLV":OfficialLV}
-            sFightPower = FormulaControl.Eval("skillFPFormula", skillFPFormula, paramDict)
+            sFightPower = FormulaControl.Eval("skillFPFormula", skillFPFormula, paramDict, toInt=True)
             skillFightPower += sFightPower
         GameWorld.DebugLog("    skillFightPower=%s,heroSkillIDList=%s" % (skillFightPower, lineupHero.heroSkillIDList), playerID)
         

--
Gitblit v1.8.0