| | |
| | | import PlayerHorse
|
| | | import PlayerArena
|
| | | import PlayerTask
|
| | | import DBDataMgr
|
| | |
|
| | |
|
| | | # 功能开启需执行的函数{功能ID:执行函数, ...} 函数需返回是否激活成功, 功能开启有需要处理功能逻辑的这里增加函数调用配置即可
|
| | |
| | | '''
|
| | | #GameWorld.DebugLog("执行触发功能开启逻辑: finishMissionIDList=%s" % finishMissionIDList, curPlayer.GetPlayerID())
|
| | |
|
| | | serverDay = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_ServerDay) + 1
|
| | | openFuncIDList = []
|
| | | curLV = curPlayer.GetLV()
|
| | | ipyGameData = IpyGameDataPY.IPY_Data()
|
| | |
| | |
|
| | | limitMissionID = ipyData.GetLimitMissionID()
|
| | | if limitMissionID and not curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_MissionFinish % limitMissionID):
|
| | | continue
|
| | | |
| | | limitOpenDay = ipyData.GetLimitOpenDay()
|
| | | if limitOpenDay and serverDay < limitOpenDay:
|
| | | continue
|
| | |
|
| | | # 先更新值再处理开启逻辑,不能可能导致在功能开启逻辑中再开启功能引发的递归死循环
|
| | |
| | |
|
| | | 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
|
| | |
|