From bea3ae882f1b6b22b0d67f20d28b0892d3c89b81 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 20 十二月 2025 17:40:44 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(周瑜小乔潜能1;步练师潜能1、5;孙坚潜能1、3;增加灼烧增减伤属性;增加触发方式52;优化效果5022、5504;增加效果5026;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py |   29 ++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5504.py |   17 ++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5026.py |   39 +++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                      |   12 ++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                             |   12 ++++-
 5 files changed, 103 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 13c53a4..f3ef64c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -176,7 +176,9 @@
 AttrID_PVPDamPerDef,                        # PVP减伤 72
 AttrID_ReviveHPPer,                         # 复活生命加成 73
 AttrID_ReviveXPPer,                         # 复活怒气加成 74
-) = range(1, 1 + 74)
+AttrID_DOTBurnPer,                          # 灼烧增伤 75
+AttrID_DOTBurnPerDef,                       # 灼烧减伤 76
+) = range(1, 1 + 76)
 
 # 需要计算的武将战斗属性ID列表
 CalcBattleAttrIDList = [AttrID_Atk, AttrID_Def, AttrID_MaxHP, AttrID_StunRate, AttrID_StunRateDef, 
@@ -191,7 +193,7 @@
                         AttrID_WuFinalDamPer, AttrID_WuFinalDamPerDef, AttrID_QunFinalDamPer, AttrID_QunFinalDamPerDef,
                         AttrID_BatDamPer, AttrID_BatDamPerDef, AttrID_PursueDamPer, AttrID_PursueDamPerDef,
                         AttrID_ComboDamPer, AttrID_ComboDamPerDef, AttrID_XPRecoverPer, AttrID_PVPDamPer, AttrID_PVPDamPerDef,
-                        AttrID_ReviveHPPer, AttrID_ReviveXPPer,
+                        AttrID_ReviveHPPer, AttrID_ReviveXPPer, AttrID_DOTBurnPer, AttrID_DOTBurnPerDef,
                         ]
 
 # 基础三维属性ID列表
@@ -2998,6 +3000,9 @@
     BatObjState_Link, # 链接(董白) 29
 ) = range(1 + 29)
 
+#属于灼烧状态的
+BurnStateList = [BatObjState_Burn, BatObjState_BurnPlus]
+
 #玩家状态定义,不能超过31个,如超过,需扩展多个key支持
 Def_PlayerStateList = (
     Def_PlayerState_Normal, # 无 0
@@ -4016,7 +4021,8 @@
 TriggerWay_FriendPursue, # 友军追击时(包含自己) 49
 TriggerWay_FriendAttackOverDirectOne, # 友方使用技能后(多目标仅触发一次,包含自己) 50
 TriggerWay_FriendAttackOverDirectOneNoSelf, # 友方使用技能后(多目标仅触发一次,不含自己) 51
-) = range(1, 1 + 51)
+TriggerWay_DOTHurt, # 造成持续伤害时 52
+) = range(1, 1 + 52)
 
 # 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
 TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
index 2e01ef8..bf3848c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
@@ -16,14 +16,43 @@
 #-------------------------------------------------------------------------------
 
 import GameWorld
+import BattleObj
 
 def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
     effEx1 = curEffect.GetEffectValue(0) # 支持多个属性
     effEx2 = curEffect.GetEffectValue(1) # 支持多个属性
+    calcRule = curEffect.GetEffectValue(2) # 附加计算规则,没配置默认增加固定值
+    
+    calcLayer = 1 # 没配置的默认1层,相当于固定值
+    if calcRule:
+        ruleType = calcRule[0]
+        # 100 - 按友方某个国家武将数  参数1:国家
+        if ruleType == 100:
+            country = calcRule[1] if len(calcRule) > 1 else 0
+            batLineup = batObj.GetBatLineup()
+            countryCnt = 0
+            batObjMgr = BattleObj.GetBatObjMgr()
+            for objID in batLineup.posObjIDDict.values():
+                batObj = batObjMgr.getBatObj(objID)
+                if not batObj:
+                    continue
+                if batObj.GetCountry() != country:
+                    continue
+                #if batObj.IsAlive(): # 死亡也算
+                #    continue
+                countryCnt += 1
+            calcLayer = countryCnt
+            GameWorld.DebugLogEx("按友方某个国家武将数计算额外buff属性: ruleType=%s,country=%s,countryCnt=%s", ruleType, country, countryCnt)
+            
+    if calcLayer <= 0:
+        return
+    
     for effEX in [effEx1, effEx2]:
         if not isinstance(effEX, list) or len(effEX) != 3:
             continue
         attrID, attrValue, calcType = effEX
+        if calcLayer > 1:
+            attrValue = int(attrValue * calcLayer)
         GameWorld.DebugLogEx("额外buff效果ID/属性ID值: attrID=%s,attrValue=%s,calcType=%s", attrID, attrValue, calcType)
         connBuff.AddEffectValueEx(attrID, attrValue, calcType)
     return True
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5026.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5026.py
new file mode 100644
index 0000000..1a8ce83
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5026.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_5026
+#
+# @todo:减少某个buff状态层级
+# @author hxp
+# @date 2025-12-20
+# @version 1.0
+#
+# 详细描述: 减少某个buff状态层级
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-12-20 18:00"""
+#-------------------------------------------------------------------------------
+
+import TurnBuff
+import GameWorld
+
+def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
+    buffState = curEffect.GetEffectValue(0)
+    delLayers = curEffect.GetEffectValue(1) # 减少层数
+    if not buffState or not delLayers:
+        return
+    
+    curBuff = batObj.GetBuffManager().FindBuffByState(buffState)
+    if not curBuff:
+        return
+    buffLayers = curBuff.GetLayer()
+    updLayers = buffLayers - delLayers
+    GameWorld.DebugLogEx("减少buff层数: buffState=%s,buffLayers=%s,delLayers=%s,updLayers=%s", 
+                         buffState, buffLayers, delLayers, updLayers)
+    TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayers, connSkill)
+    return True
+
+def DoBuffEffectLogic(turnFight, batObj, tagObj, effBuff, curEffect, connSkill, connBuff, **kwargs):
+    effSkill = effBuff.GetSkillData().GetIpyData()
+    return DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5504.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5504.py
index 69e08b3..0813b4e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5504.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5504.py
@@ -17,11 +17,13 @@
 
 import TurnSkill
 import IpyGameDataPY
+import GameWorld
 
 def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
     skillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
     checkStateList = curEffect.GetEffectValue(1) # 可附加验证目标处于xx状态
     checkOwner = curEffect.GetEffectValue(2) # 是否只限归属自己的状态buff
+    isSelfDOTTrigger = curEffect.GetEffectValue(3) # 可附加验证触发的持续buff是否是自己施加的
     
     if checkStateList:
         ownerID = batObj.GetID() if checkOwner else 0
@@ -35,6 +37,21 @@
             #GameWorld.DebugLogEx("目标不在状态下不触发: tagID=%s,checkStateList=%s,ownerID=%s", tagObj.GetID(), checkStateList, ownerID)
             return
         
+    if isSelfDOTTrigger:
+        if not connBuff:
+            GameWorld.DebugLogEx("5504没有关联的buff不处理!")
+            return
+        curID = batObj.GetID()
+        buffOwnerID = connBuff.GetOwnerID()
+        connBuffID = connBuff.GetBuffID()
+        if curID != buffOwnerID:
+            GameWorld.DebugLogEx("5504非自己的持续buff触发的不处理: connBuffID=%s,buffOwnerID=%s != curID=%s", connBuffID, buffOwnerID, curID)
+            return
+        if checkStateList:
+            if connBuff.GetCurBuffState() not in checkStateList:
+                GameWorld.DebugLogEx("5504非自己指定持续buff触发的不处理: connBuffID=%s,buffState=%s not in %s", connBuffID, connBuff.GetCurBuffState(), checkStateList)
+                return
+            
     if not skillID:
         passiveSkill = effSkill
     else:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
index b6da081..bd24235 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -1511,7 +1511,8 @@
         elif not isAttackDirect:
             # 受到持续伤害
             if tagID in beHurtObjIDList:
-                TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeDOTHurt, curObj, connSkill=useSkill)
+                TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_DOTHurt, tagObj, connSkill=useSkill, connBuff=timeBuff)
+                TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeDOTHurt, curObj, connSkill=useSkill, connBuff=timeBuff)
                 
         # 使用技能后
         if isUseSkill:
@@ -2008,9 +2009,14 @@
         aDOTPer = atkObj.GetBatAttrValue(ChConfig.AttrID_DOTPer)
         dDOTPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_DOTPerDef)
         GameWorld.DebugLogEx("aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
-        
+        if curSkill.GetCurBuffState() in ChConfig.BurnStateList:
+            aDOTPer += atkObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPer)
+            dDOTPerDef += defObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPerDef)
+            GameWorld.DebugLogEx("是灼烧: aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
+            
     #aAddSkillPer = 0 # 技能增伤
-    aBatDamPer, dBatDamPerDef = 0, 0 # 战斗增减伤
+    dBatDamPerDef = 0 # 战斗增减伤
+    aBatDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_BatDamPer)
     aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_BatDamPer, curSkill)
     aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddBatDamPerByTagLostHP, curSkill)
     aBatDamPer += addBatDamPer

--
Gitblit v1.8.0