| | |
| | |
|
| | | def GetFuncOpenAward(curPlayer, funcID):
|
| | | ## 领取功能开启奖励
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FunctionForecast', funcID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("FuncOpenLV", funcID)
|
| | | if not ipyData:
|
| | | return
|
| | | getState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
|
| | | if getState:
|
| | | GameWorld.DebugLog("功能开启奖励已领取! funcID=%s" % funcID)
|
| | | return
|
| | | awardDict = ipyData.GetAward()
|
| | | job = curPlayer.GetJob()
|
| | | itemList = awardDict.get(str(job))
|
| | | openState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch, funcID)
|
| | | if not openState:
|
| | | GameWorld.DebugLog("功能未开启无法领取! funcID=%s" % funcID)
|
| | | return
|
| | | itemList = ipyData.GetAwardList()
|
| | | if not itemList:
|
| | | return
|
| | | # 检查背包
|
| | | needSpace = len(itemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID, 1)
|
| | | |
| | | # 给物品
|
| | | for itemID, itemCount in itemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | | ItemControler.NotifyGiveAwardInfo(curPlayer, itemList, "FuncOpenAward")
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["FuncOpenAward", False, {}])
|
| | | Sync_FuncOpenState(curPlayer, [funcID])
|
| | | return
|
| | |
|