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
68
69
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Buff_NoLineReduce
# @todo: buff·ÇÏßÐÔ¼õÉÙÊôÐÔ
# @author: wdb
# @date: 2013-06-05
# @version 1.2
#
# @note
# @change: "2013-10-31 14:45" Alee ÎäÆ÷µÄ¼¼ÄÜÔöǿЧ¹û
# @change: "2014-05-30 00:40" Alee Ì××°buffÊôÐÔ°Ù·Ö±ÈÌí¼Ó²ã¼¶¼ÆËã
#---------------------------------------------------------------------
"""Version = 2014-05-30 00:40""" 
 
#------------------------------------------------------------------------------ 
#µ¼Èë
import ChConfig
import BuffSkill
import IPY_GameWorld
#---------------------------------------------------------------------
 
## buff·ÇÏßÐÔ¼õÉÙÊôÐÔ
#  @param defender Buff³ÐÊÜÕß
#  @param curEffect ¼¼ÄÜЧ¹û
#  @param calcDict ¼¼ÄÜЧ¹ûÀÛ¼Ó×ܱí
#  @return None
def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
    if curEffect.GetEffectID() in ChConfig.TYPE_NPCAttr_Calc and defender.GetGameObjType() != IPY_GameWorld.gotNPC:
        return
    
    effect = curEffect.GetEffectValue(0)
    if curBuff and curBuff.GetLayer() and BuffSkill.IsLayerPlusAttr(curBuff):
        # ²ã¼¶µþ¼ÓЧ¹û
        effect = effect*curBuff.GetLayer()
 
    # ÊôÐÔbuffЧ¹ûid¶ÔÓ¦¼ÆËãÄ£¿é×Öµä{Ч¹ûid:(¼ÆËãÄ£¿éÃûºó׺, [ÊôÐÔÀàÐÍ])}
    suffixName, attrTypeList = BuffSkill.FindBuffAttrByEffectID(curEffect)
    
    if attrTypeList == []:
        attrTypeList = ChConfig.Def_Skill_BuffEffectOutside.get(curEffect.GetEffectID(), 
                                                                ("", []))[1]
    for attrType in attrTypeList: 
        calcDict[attrType] = calcDict.get(attrType, 0) - effect
        
    return 
 
 
## ·µ»ØbuffÀàÐÍ£¬ÏßÐÔÓë·ñ
#  @param 
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
def GetCalcType():
    return ChConfig.TYPE_NoLinear
 
 
##¼ÆËãÔöǿֵ
# @param attacker ¹¥»÷ÕßʵÀý
# @param curSkill ¼¼ÄÜʵÀý
# @param curEffect µ±Ç°¼¼ÄÜЧ¹û1
# @return ×ÜÖµ
def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):
    if not changeBuffValueDict:
        return []
    
    return [changeBuffValueDict.get(i, 0) for i in range(ChConfig.Def_BuffValue_Count)]