From 6431718d4fabf83de74f7abe40f671590dbf91c0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 26 十二月 2025 09:08:44 +0800
Subject: [PATCH] 358 【内政】红颜系统-服务端(马车炸弹不出裂纹;马车炸开后通知马车空白;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 50 insertions(+), 8 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 2cdd501..4fee62e 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,16 +15,58 @@
 #"""Version = 2025-09-16 14:30"""
 #-------------------------------------------------------------------------------
 
-def GetHappenValue(attacker, defender, curEffect, effSkill, **skillkwargs):
+import GameWorld
+
+def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
     
-    checkInStateList = curEffect.GetEffectValue(2)
-    if checkInStateList:
-        if not defender.CheckInState(checkInStateList):
-            return 0
-        
+    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) # 累计最高增加值
+        checkBatType = curEffect.GetEffectValue(4) # 验证攻击类型 0-不验证;1-连击;2-追击;3-反击
+        if checkBatType:
+            if not connSkill:
+                return
+            if connSkill.GetBatType() != checkBatType:
+                #GameWorld.DebugLog("额外属性效果非该战斗类型不触发: checkBatType=%s,skillBatType=%s" % (checkBatType, connSkill.GetBatType()))
+                return
+            
+        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.DebugLogEx("按对方buff层级增加属性: attrID=%s,attrValue=%s,buffStateList=%s,layerTotal=%s,maxValue=%s,checkBatType=%s", 
+                             attrID, attrValue, buffStateList, layerTotal, maxValue, checkBatType)
+    # 11-根据自己已损失血量百分比
+    elif calcType == 11:
+        curHP = attacker.GetHP()
+        maxHP = attacker.GetMaxHP()
+        lostPer = int((maxHP - curHP) / float(maxHP) * 100) # 只算取整
+        attrValue = lostPer * attrValue
+        GameWorld.DebugLog("按自身已损失生命百分比增加属性: attrID=%s,attrValue=%s,curHP=%s/%s,lostPer=%s" 
+                           % (attrID, attrValue, curHP, maxHP, lostPer))
         
+    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