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
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package CalcLineEffect.
# @todo: 
#
# @author: panwei
# @date 2011-03-22
# @version 1.1
#
# @change: "2013-04-17 20:35" Alee ¸ü¸Ä¼ÆË㷽ʽ
#------------------------------------------------------------------------------ 
"""Version = 2013-04-17 20:35"""
#---------------------------------------------------------------------
import EffGetSet
import GameWorld
import ChConfig
#---------------------------------------------------------------------
## ¸øÍæ¼ÒÌí¼ÓÏßÐÔBuffЧ¹û 
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param effectDict Ð§¹û×Öµä
#  @return None
def ChangePlayerAttrInLineEffectList(curPlayer, effectDict, isBuffAttr=False):
    return __CalcAttrInLineEffectList(curPlayer, effectDict, isBuffAttr)
 
#---------------------------------------------------------------------
## ¸øNPCÌí¼ÓÏßÐÔBuffЧ¹û
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param effectDict Ð§¹û×Öµä
#  @return None
#  @remarks 
def ChangeNPCAttrInLineEffectList(curNPC, effectDict):
    return __CalcAttrInLineEffectList(curNPC, effectDict, False)
 
#---------------------------------------------------------------------
##Ìí¼ÓÏßÐÔBuff
# @param curObj ¶ÔÏóʵÀý
# @param effectList Ð§¹ûÁбíTYPE_Max_Attr
# @return ·µ»ØÖµÎÞÒâÒå
# @remarks 
def __CalcAttrInLineEffectList(curObj, effectDict, isBuffAttr):
    for key, value in effectDict.items():
        if value == 0:
            continue
        
        # buff¶ÔÒÆ¶¯ËٶȵÄÓ°Ïì²»ÔÚÕâÀï¼ÆËã, µ¥¶ÀÌá³öÀ´¶ÀÁ¢¼ÆËã
        if isBuffAttr and key == ChConfig.TYPE_Calc_AttrSpeed:
            continue
        
        curValue = EffGetSet.GetValueByEffIndex(curObj, key)
 
        if curValue == None:
            GameWorld.Log("µ÷ÓÃÏßÐÔÊôÐÔÌõ¼þʧ°Ü, curObjType = %s, index = %s"%(curObj.GetGameObjType(), key))
            continue
 
        EffGetSet.SetValueByEffIndex(curObj, key, curValue + value)
 
    return