#!/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