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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.TurnBuffs.BuffAtkType_1005
#
# @todo:¶îÍâÊôÐÔ
# @author hxp
# @date 2025-10-27
# @version 1.0
#
# ÏêϸÃèÊö: ¶îÍâÊôÐÔ£¬Ð§¹û1ÖµÅäÖãº[»÷ÖÐx״̬]|Ôö¼ÓÊôÐÔID|ÿ»÷ÖÐ1¸öÔö¼ÓÊôÐÔÖµ
#
#-------------------------------------------------------------------------------
#"""Version = 2025-10-27 17:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
 
def CalcBuffValue(turnFight, attacker, defender, curSkill):
    bySkill = curSkill.GetBySkill()
    if not bySkill:
        return
    
    effect = curSkill.GetEffect(0)
    checkInStateList = effect.GetEffectValue(0)
    attrIDEx = effect.GetEffectValue(1)
    attrValueEx = effect.GetEffectValue(2)
    #GameWorld.DebugLog("BuffAtkType_1005 ¼ì²é¶îÍâÊôÐÔ: checkInStateList=%s,attrIDEx=%s,attrValueEx=%s" % (checkInStateList, attrIDEx, attrValueEx))
    if not checkInStateList or not attrIDEx or not attrValueEx:
        return
    
    hitCnt = 0
    effIgnoreObjIDList = bySkill.GetEffIgnoreObjIDList()
    tagObjList = bySkill.GetTagObjList()
    for tagObj in tagObjList:
        tagID = tagObj.GetID()
        if tagID in effIgnoreObjIDList:
            #GameWorld.DebugLog("    ÉÁ±Ü»òÃâÒßµÄÄ¿±ê: tagID=%s" % (tagID))
            continue
        if not tagObj.CheckInState(checkInStateList):
            #GameWorld.DebugLog("    ²»ÔÚ״̬ϵÄÄ¿±ê: tagID=%s not in state:%s" % (tagID, checkInStateList))
            continue
        hitCnt += 1
        #GameWorld.DebugLog("    hitCnt=%s,tagID=%s" % (hitCnt, tagID))
        
    if hitCnt <= 0:
        return
    
    return [hitCnt]
 
def CalcBuffAttrEx(batObj, buff, skillData, layer, buffAttrDict):
    ## ¼ÆËãbuff¶îÍâÊôÐÔ
    hitCnt = buff.GetValue1()
    effect = skillData.GetEffect(0)
    attrID = effect.GetEffectValue(1)
    attrValue = effect.GetEffectValue(2) * hitCnt * layer
    if not attrID or not attrValue:
        return
    calcType = effect.GetEffectValue(3)
    if calcType == 2: # ¼õÉÙ£¬ÆäËûĬÈÏÔö¼Ó
        attrValue = -attrValue
    buffAttrDict[attrID] = buffAttrDict.get(attrID, 0) + attrValue
    GameWorld.DebugLog("    buff¶îÍâÊôÐÔ: skillID=%s,hitCnt=%s,attrID=%s,attrValue=%s" % (skillData.GetSkillID(), hitCnt, attrID, attrValue))
    return