1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveTrigger.PassiveEff_6029
#
# @todo:ÌáÉý¼¼ÄÜÕ½¶·É˺¦£¨¸ù¾ÝÉíÉÏbuff״̬²ãÊý£©
# @author hxp
# @date 2025-12-19
# @version 1.0
#
# ÏêϸÃèÊö: ÌáÉý¼¼ÄÜÕ½¶·É˺¦£¨¸ù¾ÝÉíÉÏbuff״̬²ãÊý£©
#
#-------------------------------------------------------------------------------
#"""Version = 2025-12-19 18:00"""
#-------------------------------------------------------------------------------
 
import TurnBuff
#import GameWorld
 
def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
    if "turnFight" not in skillkwargs:
        return
    turnFight = skillkwargs["turnFight"]
    
    buffState = curEffect.GetEffectValue(0) # buff״̬
    addPerList = curEffect.GetEffectValue(1) # [1²ãÌáÉýÍò·Ö±È, 2²ã, ...]
    isDelBuff = curEffect.GetEffectValue(2) # ´¥·¢Ð§¹ûºóÊÇ·ñ¿Û³ýbuff
    if not addPerList:
        return
    
    addPer = 0
    layerTotal = 0
    buffMgr = attacker.GetBuffManager()
    for buff in buffMgr.FindBuffListByState(buffState):
        layerTotal += max(1, buff.GetLayer())
        if len(addPerList) >= layerTotal:
            addPer = addPerList[layerTotal - 1]
        else:
            addPer = addPerList[-1]
            
        if isDelBuff:
            TurnBuff.DoBuffDel(turnFight, attacker, buff, connSkill)
            
    #GameWorld.DebugLogEx("6029Õ½¶·ÔöÉË: buffState=%s,layerTotal=%s,addPer=%s", buffState, layerTotal, addPer)
    return addPer