| | |
| | | import ChConfig
|
| | | import CommFunc
|
| | |
|
| | | def __DoFnFortuneCompensate(curPlayer):
|
| | | ## 英文版福缘累充奖励补发,后续可删除
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FnFortuneCompensate):
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FnFortuneCompensate, 1)
|
| | | |
| | | actNum = 35 |
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_TotalRecharge, actNum)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | | templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not state or not templateID:
|
| | | return
|
| | | |
| | | curRechargeGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeGold % actNum)
|
| | | if not curRechargeGold:
|
| | | return
|
| | | |
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("TotalRechargeTemplate", templateID)
|
| | | if not ipyDataList:
|
| | | return
|
| | | |
| | | compensateItemDict = IpyGameDataPY.GetFuncEvalCfg("FortuneCompensate", 1, {})
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum)
|
| | | #GameWorld.Log("福缘累充奖励补发! curRechargeGold=%s,awardRecord=%s" % (curRechargeGold, awardRecord), playerID)
|
| | | for ipyData in ipyDataList:
|
| | | awardIndex = ipyData.GetAwardIndex()
|
| | | if not awardRecord & pow(2, awardIndex):
|
| | | #GameWorld.Log("福缘累充奖励未领取,不补发! awardIndex=%s" % awardIndex, playerID)
|
| | | continue
|
| | | if awardIndex not in compensateItemDict:
|
| | | continue
|
| | | #needGold = CommFunc.RMBToCoin(ipyData.GetNeedGold())
|
| | | addItemList = compensateItemDict[awardIndex]
|
| | | needRMB = str(ipyData.GetNeedGold())
|
| | | if needRMB.endswith(".0"):
|
| | | needRMB = needRMB[:-2]
|
| | | paramList = [needRMB]
|
| | | PlayerControl.SendMailByKey("FortuneCompensate", [playerID], addItemList, paramList)
|
| | | GameWorld.Log("福缘累充奖励已领取,补发! awardIndex=%s, %s" % (awardIndex, addItemList), playerID)
|
| | | |
| | | return
|
| | |
|
| | | def GetTemplateID(cfgID, dayIndex):
|
| | | if cfgID == None or dayIndex == None:
|
| | | return 0
|
| | |
| | | Sync_TotalRechargeActionInfo(curPlayer, actNum)
|
| | | Sync_TotalRechargeInfo(curPlayer, actNum)
|
| | |
|
| | | __DoFnFortuneCompensate(curPlayer)
|
| | | return
|
| | |
|
| | | def RefreshTotalRechargeActionInfo(actNum):
|