From 783f0435fafdc0ab6480ff572cf9b11aeedbc138 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 23 一月 2026 17:35:02 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(PrintFightPower命令支持刷属性指定属性明细,调整输出)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py | 31 ++++++++++++++++++++++++++++---
1 files changed, 28 insertions(+), 3 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 8accd71..2beb13d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -19,6 +19,7 @@
import BattleObj
import TurnAttack
import PyGameData
+import SkillCommon
import ShareDefine
import PlayerPreset
import PlayerControl
@@ -38,6 +39,8 @@
import ChEquip
import time
+
+g_calcDetail = 0
class LineupHero():
## 阵容武将,注意:同一个武将在不同阵容中可能属性不一样
@@ -951,6 +954,7 @@
horseAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Horse)
beautyAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Beauty)
minggeAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
+ mgSkillLVDict = olPlayer.GetCalcSpecInfo(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
dingjungeAttrDict = olPlayer.GetCalcAttr(ChConfig.Def_CalcAttr_Dingjunge) if exclusiveMapID == ChConfig.Def_FBMapID_Dingjunge else {}
GameWorld.DebugLog(" 国家武将统计=%s" % countryHeroInfo, playerID)
@@ -971,7 +975,7 @@
GameWorld.DebugLog(" 主幻境阁属性=%s" % hjgAttrDict, playerID)
GameWorld.DebugLog(" 主公坐骑属性=%s" % horseAttrDict, playerID)
GameWorld.DebugLog(" 主公红颜属性=%s" % beautyAttrDict, playerID)
- GameWorld.DebugLog(" 主公命格属性=%s,mgPresetID=%s" % (minggeAttrDict, mgPresetID), playerID)
+ GameWorld.DebugLog(" 主公命格属性=%s,技能:%s,mgPresetID=%s" % (minggeAttrDict, mgSkillLVDict, mgPresetID), playerID)
GameWorld.DebugLog(" 定军专属属性=%s" % dingjungeAttrDict, playerID)
effCardAddPer = heroPreset.GetEffCardAddPer()
effCardAddPer /= 10000.0
@@ -981,9 +985,23 @@
OfficialLV = curPlayer.GetOfficialRank()
GameWorld.DebugLog(" PlayerLV=%s,OfficialLV=%s" % (PlayerLV, OfficialLV), playerID)
+ mgSkillFightPower = 0
+ for skillTypeID, skillLV in mgSkillLVDict.items():
+ skillID = SkillCommon.GetSkillIDBySkillTypeID(skillTypeID, skillLV)
+ skillData = IpyGameDataPY.GetIpyGameData("Skill", skillID)
+ if not skillData:
+ continue
+ paramDict = {"SkillPower":skillData.GetFightPower(), "PlayerLV":PlayerLV, "OfficialLV":OfficialLV}
+ sFightPower = FormulaControl.Eval("skillFPFormula", skillFPFormula, paramDict, toInt=True)
+ mgSkillFightPower += sFightPower
+ if mgSkillLVDict:
+ GameWorld.DebugLog(" 命格技能战力=%s,mgSkillLVDict=%s" % (mgSkillFightPower, mgSkillLVDict), playerID)
+
fpRatioIpyData = IpyGameDataPY.GetIpyGameData("FightPowerRatio", OfficialLV)
lineupFightPower = 0 # 阵容总战力
+ lineupFightPower += mgSkillFightPower
+
for heroID, selfAttrDict in heroSelfAttrInfo.items():
lineupHero = presetLineup.GetLineupHeroByID(heroID)
if not lineupHero:
@@ -1070,8 +1088,15 @@
attrValue = FormulaControl.Eval("baseAttrFormula", baseAttrFormula, attrParamDict, toInt=False, ndigits=3)
else:
attrValue = FormulaControl.Eval("otherAttrFormula", otherAttrFormula, attrParamDict, toInt=False, ndigits=3)
- #GameWorld.DebugLog(" attrID=%s,attrValue=%s,attrParamDict=%s" % (attrID, attrValue, attrParamDict))
-
+ # 前端对比刷属性明细时需要
+ if g_calcDetail and attrValue > 0:
+ calcParamDict = {}
+ for k, v in attrParamDict.items():
+ 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
attrRatioName = "%sRatio" % attrName
--
Gitblit v1.8.0