From a569a7bb683bb01edb14be508e123ba556305f9f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 26 十二月 2025 14:00:40 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(曹操所有技能;增加触发方式50-敌方受控时(硬控);)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py                       |   14 +++++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                      |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                             |    3 ++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py |   33 +++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 10b32a8..ae558e2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4039,7 +4039,8 @@
 TriggerWay_ImmuneHurt, # 免疫伤害时 55
 TriggerWay_BeSuckHP, # 被吸血时 56
 TriggerWay_SuckHPOne, # 吸血时(多目标仅触发一次) 57
-) = range(1, 1 + 57)
+TriggerWay_EnemyBeControlledHard, # 敌方受控时(硬控) 58
+) = range(1, 1 + 58)
 
 # 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
 TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
index 4fee62e..ebbfb19 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
@@ -16,6 +16,7 @@
 #-------------------------------------------------------------------------------
 
 import GameWorld
+import TurnBuff
 
 def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
     
@@ -53,6 +54,38 @@
         GameWorld.DebugLog("按自身已损失生命百分比增加属性: attrID=%s,attrValue=%s,curHP=%s/%s,lostPer=%s" 
                            % (attrID, attrValue, curHP, maxHP, lostPer))
         
+    # 12-根据自己buff层级增加
+    elif calcType == 12:
+        if "turnFight" not in skillkwargs:
+            return
+        turnFight = skillkwargs["turnFight"]
+        buffState = curEffect.GetEffectValue(2) # 自己身上buff状态
+        isDelBuff = curEffect.GetEffectValue(3) # 触发效果后是否扣除buff
+        layerTotal = 0
+        buffMgr = attacker.GetBuffManager()
+        for buff in buffMgr.FindBuffListByState(buffState):
+            layerTotal += buff.GetLayer()
+            if isDelBuff:
+                TurnBuff.DoBuffDel(turnFight, attacker, buff, connSkill)
+        attrValue *= layerTotal
+        GameWorld.DebugLogEx("按自己buff层级增加属性: attrID=%s,attrValue=%s,buffState=%s,layerTotal=%s", attrID, attrValue, buffState, layerTotal)
+        
+    # 13-根据对方buff状态种数
+    elif calcType == 13:
+        buffStateList = curEffect.GetEffectValue(2) # 对方处于xx状态 [状态1, 状态2, ...]
+        isMulti = curEffect.GetEffectValue(3) # 存在多种状态时是否叠加属性
+        stateCount = 0
+        buffMgr = defender.GetBuffManager()
+        for buffState in buffStateList:
+            if buffMgr.IsInBuffState(buffState):
+                stateCount += 1
+        if not stateCount:
+            return
+        if isMulti and stateCount > 1:
+            attrValue *= stateCount
+        GameWorld.DebugLogEx("按目标buff状态种数增加属性: attrID=%s,attrValue=%s,buffStateList=%s,stateCount=%s,isMulti=%s", 
+                             attrID, attrValue, buffStateList, stateCount, isMulti)
+        
     else:
         checkInStateList = curEffect.GetEffectValue(2)
         if checkInStateList:
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 517f921..bb79c0f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
@@ -248,7 +248,16 @@
     #受控时
     if curBuffState and IsControlledHardState(curBuffState):
         TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BeControlledHard, tagObj=buffOwner, connSkill=buffSkill, connBuff=buff)
-        
+        batObjMgr = BattleObj.GetBatObjMgr()
+        ownerBatLineup = buffOwner.GetBatLineup()
+        for lineupObjID in ownerBatLineup.posObjIDDict.values():
+            lineupObj = batObjMgr.getBatObj(lineupObjID)
+            if not lineupObj.IsAlive():
+                continue
+            # 敌方被控时
+            if lineupObj.GetFaction() != batObj.GetFaction():
+                TurnPassive.OnTriggerPassiveEffect(turnFight, lineupObj, ChConfig.TriggerWay_EnemyBeControlledHard, batObj, connSkill=buffSkill)
+                
     return buff
 
 def IsControlledHardState(state):
@@ -631,6 +640,9 @@
             effID = effect.GetEffectID()
             if effID not in ChConfig.AttrIDList:
                 continue
+            if effect.GetTriggerWay():
+                # 有需要触发才生效的属性在buff中不生效,由触发规则决定
+                continue
             if not (not effect.GetTriggerSrc() or effect.GetTriggerBuffEnable()):
                 # buff时,不配默认有效,或仅buff有效
                 continue
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 3399483..2897f31 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -1549,7 +1549,7 @@
         # 掉血时
         if tagID in beHurtObjIDList:
             TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeHurt, curObj, connSkill=useSkill)
-            #TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_HurtTag, tagObj, connSkill=useSkill) 暂时用不到先屏蔽
+            TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_HurtTag, tagObj, connSkill=useSkill)
             
         #  受到任意效果时(除直接攻击外的任意效果,如buff、dot、治疗、额外怒技)
         if not isAttackDirect:

--
Gitblit v1.8.0