| | |
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | | import time
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | GiveTuijinbiByDay(curPlayer)
|
| | | return
|
| | |
|
| | | def GiveTuijinbiByDay(curPlayer):
|
| | | tuibanTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TuiJinbiBanTime)
|
| | | tuibanDayAwardInfo = IpyGameDataPY.GetFuncEvalCfg("EnSuperDiscount", 4)
|
| | | if tuibanTime and tuibanDayAwardInfo and len(tuibanDayAwardInfo) == 2:
|
| | | diffDays = GameWorld.GetDiff_Day(int(time.time()), tuibanTime) + 1
|
| | | giveMoney, maxDays = tuibanDayAwardInfo
|
| | | if diffDays <= maxDays:
|
| | | GameWorld.DebugLog("按天给推金币次数! diffDays=%s, maxDays=%s" % (diffDays, maxDays), curPlayer.GetPlayerID())
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Tuijinbi, giveMoney, "tuibanonday")
|
| | | return
|
| | |
|
| | | def GetSuperDiscountState(curPlayer):
|
| | | ## 至尊折扣卡激活状态
|
| | |
| | |
|
| | | def ActSuperDiscountByCTG(curPlayer, ctgID):
|
| | | ## 充值激活
|
| | | ctgList = IpyGameDataPY.GetFuncEvalCfg("EnSuperDiscount", 1)
|
| | | if ctgID in ctgList:
|
| | | __DoActiveSuperDiscount(curPlayer, ctgID)
|
| | | if ctgID and ctgID == IpyGameDataPY.GetFuncCfg("EnSuperDiscount", 1):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TuiJinbiBanTime, int(time.time()))
|
| | | GameWorld.DebugLog("标记已购买超级推板时间戳!", curPlayer.GetPlayerID())
|
| | | GiveTuijinbiByDay(curPlayer) # 给第一天奖励
|
| | | return
|
| | |
|
| | | def __DoActiveSuperDiscount(curPlayer, ctgID=0):
|
| | | def __DoActiveSuperDiscount(curPlayer):
|
| | | ## 激活至尊卡
|
| | | if GetSuperDiscountState(curPlayer):
|
| | | GameWorld.DebugLog("至尊卡已激活!")
|
| | | return
|
| | |
|
| | | if not ctgID:
|
| | | # 没有购买超级推板的,验证免费激活
|
| | | tuibanTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TuiJinbiBanTime)
|
| | | if not tuibanTime:
|
| | | needCreateRoleDays = IpyGameDataPY.GetFuncCfg("EnSuperDiscount", 2)
|
| | | createRoleDays = GameWorld.GetCreateRoleDays(curPlayer)
|
| | | if createRoleDays < needCreateRoleDays:
|
| | | GameWorld.ErrLog("创角天数不足,无法免费激活至尊卡! createRoleDays=%s < %s" % (createRoleDays, needCreateRoleDays), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog("激活至尊卡: ctgID=%s" % (ctgID), curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog("激活至尊卡: tuibanTime=%s" % (tuibanTime), curPlayer.GetPlayerID())
|
| | | curPlayer.SetLV2(1)
|
| | | return
|
| | |
|