hxp
2018-12-26 1deb0b9086974c1205cddee149b88b6974d35ecd
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
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package BuffProcess_904
# @todo: ³¡¾° buff¶¨Ê±¸øÓèÍæ¼Ò¾­Ñé
#
# @author: wdb
# @date 2013-02-28
# @version 1.0
# @note:
# Ä£¿éÏêϸ˵Ã÷
#---------------------------------------------------------------------
"""Version = 2013-02-28 17:00"""
#µ¼Èë
import IPY_GameWorld
import GameWorld
import PlayerControl
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## ³ÖÐøÐÔBuff´¦Àí 
#  @param defender ³ÐÊÜÕß
#  @param curBuff µ±Ç°Buff
#  @param curEffect BuffЧ¹û
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks ³ÖÐøÐÔBuff´¦Àí, ºÈÒ©Ë®µÄ»Ö¸´Âß¼­Ê±¼äTICKÀýÍâ 
def ProcessBuff(defender, curBuff, curEffect, processBuffTick, tick):
    #---¼ì²éBuff¿ÉÐÐÐÔ---
    curObjType = defender.GetGameObjType()
 
    # ¸øÓè¾­Ñ飬ֻ֧³ÖÍæ¼Ò¶ÔÏó
    if curObjType != IPY_GameWorld.gotPlayer:
        
        GameWorld.ErrLog("BuffProcess_904, objType error, expect(%s) \
        insted (%s)"%(IPY_GameWorld.gotPlayer, curObjType))
        return
    
    # Íæ¼Ò×îСµÈ¼¶ÏÞÖÆ
    if defender.GetLV() < curEffect.GetEffectValue(1):
        return
    
    reExp = PlayerControl.GetPlayerReExp(defender)
    giveExp = int(curEffect.GetEffectValue(0)*reExp)
    
    if giveExp <= 0:
        return
    
    playerControl = PlayerControl.PlayerControl(defender)
    playerControl.AddExp(giveExp) 
    return