From 5c707e161b1c44e798a7d4f41b9c9b1825b6bb66 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 九月 2025 15:54:28 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(贾诩技能,buff计算属性后最终属性支持负值;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py   |    7 ++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py |    7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
index e49c8f3..efa0231 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
@@ -630,8 +630,8 @@
         self._xp = 0 # 当前怒气值
         self._isAlive = True # 是否活着
         self._initAttrDict = {} # 初始化时的属性,固定不变,初始化时已经算好的属性  {attrID:value, ...}
-        self._batAttrDict = {} # 实际战斗属性,包含buff层级的实际属性
-        self._skillTempAttrDict = {} # 某次技能释放中临时的属性增减 {attrID:+-value, ...}
+        self._batAttrDict = {} # 实际战斗属性,包含buff层级的实际属性 {attrID:+-value, ...} value可能是负值
+        self._skillTempAttrDict = {} # 某次技能释放中临时的属性增减 {attrID:+-value, ...} value可能是负值
         self._kvDict = {} # 自定义kv字典
         self._skillUseCntDict = {} # 技能累计使用次数 {skillID:useCnt, ...}
         self._skillTurnUseCntDict = {} # 技能单回合累计使用次数 {skillID:useCnt, ...}
@@ -805,12 +805,13 @@
     def GetAtk(self): return self.GetBatAttrValue(ChConfig.AttrID_Atk)
     def GetDef(self): return self.GetBatAttrValue(ChConfig.AttrID_Def)
     
+    def GetBatAttrDict(self): return self._batAttrDict
     def GetBatAttrValue(self, attrID, includeTemp=True):
         #ChConfig.AttrID_HP ChConfig.AttrID_XP
         value = self._batAttrDict.get(attrID, 0)
         if includeTemp and attrID in self._skillTempAttrDict:
             value += self._skillTempAttrDict[attrID] # 支持正负值
-            value = max(1, value)
+            #value = max(1, value)
         return value
     def SetBatAttrValue(self, attrID, value): self._batAttrDict[attrID] = value
     def AddSkillTempAttr(self, attrID, value):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
index fdf6480..f9a02dc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
@@ -328,7 +328,7 @@
         if attrValue <= 0:
             continue
         updValue = int(attrValue * (10000 + attrPerValue) / 10000.0)
-        updValue = max(0, updValue) # 最多减到0,最大无上限
+        #updValue = max(0, updValue) # 最多减到0,最大无上限
         batObj.SetBatAttrValue(attrID, updValue)
         GameWorld.DebugLog("    attrID=%s(PerID:%s),attrValue=%s(PerValue:%s),updValue=%s" % (attrID, attrPerID, attrValue, attrPerValue, updValue))
         
@@ -337,7 +337,8 @@
         if attrID in perIDList:
             continue
         attrValue = batObj.GetBatAttrValue(attrID, False)
-        updValue = max(0, attrValue + addValue) # 最多减到0,最大无上限
+        updValue = attrValue + addValue
+        #updValue = max(0, attrValue + addValue) # 最多减到0,最大无上限
         batObj.SetBatAttrValue(attrID, updValue)
         GameWorld.DebugLog("    attrID=%s,attrValue=%s,addValue=%s,updValue=%s" % (attrID, attrValue, addValue, updValue))
         
@@ -349,7 +350,7 @@
             aftHP += (aftMaxHP - befMaxHP)
             batObj.SetHP(aftHP, True)
     GameWorld.DebugLog("    befHP=%s/%s, aftHP=%s/%s" % (befHP, befMaxHP, aftHP, aftMaxHP))
-    GameWorld.DebugLog("    最终属性 ID:%s,atk=%s,def=%s,hp=%s/%s" % (objID, batObj.GetAtk(), batObj.GetDef(), aftHP, aftMaxHP))
+    GameWorld.DebugLog("    最终属性 ID:%s,atk=%s,def=%s,hp=%s/%s,%s" % (objID, batObj.GetAtk(), batObj.GetDef(), aftHP, aftMaxHP, batObj.GetBatAttrDict()))
     return
 
 def SyncBuffRefresh(turnFight, curBatObj, curBuff, relatedSkillID=0, isNewAdd=False):

--
Gitblit v1.8.0