From db9e2574a77068dff06f87af64132bf3c6f99350 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 十月 2025 10:17:56 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(步练师技能;临时增加属性增加计算方式10-根据对方buff层级增加;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py |   48 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 33 insertions(+), 15 deletions(-)

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 a994394..643422c 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
@@ -15,23 +15,41 @@
 #"""Version = 2025-09-16 14:30"""
 #-------------------------------------------------------------------------------
 
+import GameWorld
+
 def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, **skillkwargs):
     
-    checkInStateList = curEffect.GetEffectValue(2)
-    if checkInStateList:
-        if not defender.CheckInState(checkInStateList):
-            return
-        
-    onlyOwner = curEffect.GetEffectValue(3) # 是否仅对buff施法者有效,默认0-否,1-是
-    if onlyOwner:
-        if not effBuff:
-            return
-        if effBuff.GetOwnerID() != defender.GetID():
-            return
-        
+    attrID = curEffect.GetEffectID()
     attrValue = curEffect.GetEffectValue(0)
     calcType = curEffect.GetEffectValue(1)
-    if calcType == 2: # 减少,其他默认增加
-        attrValue = -attrValue
-        
+    # 10-根据对方buff层级增加
+    if calcType == 10:
+        buffStateList = curEffect.GetEffectValue(2)
+        maxValue = curEffect.GetEffectValue(3) # 累计最高增加值
+        layerTotal = 0
+        buffMgr = defender.GetBuffManager()
+        for buffState in buffStateList:
+            for buff in buffMgr.FindBuffListByState(buffState):
+                layerTotal += max(1, buff.GetLayer())
+        attrValue *= layerTotal
+        if maxValue and attrValue > maxValue:
+            attrValue = maxValue
+        GameWorld.DebugLog("按对方buff层级增加属性: attrID=%s,attrValue=%s,buffStateList=%s,layerTotal=%s,maxValue=%s" 
+                           % (attrID, attrValue, buffStateList, layerTotal, maxValue))
+    else:
+        checkInStateList = curEffect.GetEffectValue(2)
+        if checkInStateList:
+            if not defender.CheckInState(checkInStateList):
+                return
+            
+        onlyOwner = curEffect.GetEffectValue(3) # 是否仅对buff施法者有效,默认0-否,1-是
+        if onlyOwner:
+            if not effBuff:
+                return
+            if effBuff.GetOwnerID() != defender.GetID():
+                return
+            
+        if calcType == 2: # 减少,其他默认增加
+            attrValue = -attrValue
+            
     return attrValue

--
Gitblit v1.8.0