hxp
5 天以前 388823edfe6308cba6f76ca6dc4f20022c5cb2be
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package UseItem.Item_AddVIPExp
#
# @todo:Ôö¼ÓVIP¾­Ñé
# @author hxp
# @date 2018-03-08
# @version 1.0
#
# ÏêϸÃèÊö: Ôö¼ÓVIP¾­Ñé
#
#-------------------------------------------------------------------------------
#"""Version = 2018-03-08 22:00"""
#-------------------------------------------------------------------------------
 
import PlayerVip
import ItemCommon
import ChConfig
 
def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
    ##ÅúÁ¿Ê¹ÓÃÎïÆ·
    curEff = curRoleItem.GetEffectByIndex(0)
    addExp = curEff.GetEffectValue(0)
    if not addExp:
        return
    
    befVIPLV = curPlayer.GetVIPLv()
    befVIPExp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_VipExp)
    
    succCnt = 0
    for _ in xrange(useCnt):
        if not PlayerVip.AddVIPExp(curPlayer, addExp):
            break
        succCnt += 1
        
    if not succCnt:
        return
    
    aftVIPLV = curPlayer.GetVIPLv()
    aftVIPExp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_VipExp)
    
    saveDataDict = {"BeforeVIPLV":befVIPLV, "BeforeVIPExp":befVIPExp, "AfterVIPLV":aftVIPLV, "AfterVIPExp":aftVIPExp, "AddVIPExp":addExp}
    ItemCommon.DelItem(curPlayer, curRoleItem, succCnt, True, ChConfig.ItemDel_AddVIPExp, saveDataDict, True)
    return True, succCnt