hxp
2022-02-21 0c27822ef5e6c67782ed143a4ff03ecfbdfda1fb
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
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: ³ÖÐø¼õÒæ¸ù¾ÝÖµ¼Ó³É£¬¼õ·¨£¨ÏßÐÔ£©
#
# @author: Alee
# @date 2019-4-29 ÏÂÎç02:32:15
# @version 1.0
#
# @note: 
#
#---------------------------------------------------------------------
#µ¼Èë
import PlayerControl
import NPCCommon
import IPY_GameWorld
import GameWorld
import ChConfig
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
    
    attrType = curEffect.GetEffectValue(0)
    value = curEffect.GetEffectValue(1)*curBuff.GetValue()
    calcDict[attrType] = calcDict.get(attrType, 0) - value
        
    return 
 
 
## ·µ»ØbuffÀàÐÍ£¬ÏßÐÔÓë·ñ
#  @param 
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
def GetCalcType():
    return ChConfig.TYPE_Linear
 
def ProcessBuff(defender, curBuff, curEffect, processBuffTick, tick):
    # ´¥·¢¼Ó³É ÊôÐÔË¢ÐÂ
    value = curBuff.GetValue()
    if value >= curEffect.GetEffectValue(2):
        return
    
    curBuff.SetValue(value+1)
    #Ë¢ÐÂÊôÐÔ
    curObjType = defender.GetGameObjType()
    #Íæ¼Ò
    if curObjType == IPY_GameWorld.gotPlayer:
        #Ë¢ÐÂÍæ¼ÒÊôÐÔ
        playerControl = PlayerControl.PlayerControl(defender)
        #playerControl.CalcPassiveBuffAttr()
        playerControl.RefreshPlayerAttrByBuff()
    #NPC
    elif curObjType == IPY_GameWorld.gotNPC:
        npcControl = NPCCommon.NPCControl(defender)
        npcControl.RefreshNPCAttrState()
    return