From 1f982fe95cfaa236db7dcf3d94c17626cfa34ad6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 23 一月 2026 18:37:31 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(修正属性计算结果本身是整数时不再进行小数处理;小数精确2位小数;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py | 13 ++++++++++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/FormulaControl.py | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/FormulaControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/FormulaControl.py
index 650611d..34f6807 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/FormulaControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/FormulaControl.py
@@ -112,7 +112,7 @@
try:
# 执行计算
value = eval(compileFormula, safe_env)
- if ndigits > 0:
+ if ndigits > 0 and not isinstance(value, int):
value = round(value, ndigits)
if ceil:
value = math.ceil(value)
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 2beb13d..9345b28 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -1083,11 +1083,18 @@
"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 = {}
--
Gitblit v1.8.0