| | |
| | | import PlayerActBuyCountGift
|
| | | import PlayerActLoginNew
|
| | | import PlayerActTask
|
| | | import IPY_GameWorld
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | | import PlayerTravel
|
| | | import PlayerHorse
|
| | | import PlayerArena
|
| | | import PlayerTask
|
| | |
| | | ShareDefine.GameFuncID_Arena:lambda curObj:PlayerArena.DoArenaOpen(curObj),
|
| | | ShareDefine.GameFuncID_Shop:lambda curObj:FunctionNPCCommon.DoShopOpen(curObj),
|
| | | ShareDefine.GameFuncID_Horse:lambda curObj:PlayerHorse.DoHorseOpen(curObj),
|
| | | ShareDefine.GameFuncID_Travel:lambda curObj:PlayerTravel.DoTravelOpen(curObj),
|
| | | }
|
| | |
|
| | | def GetFuncOpenLVIpyData(funcID): return IpyGameDataPY.GetIpyGameData("FuncOpenLV", funcID)
|
| | |
|
| | | def DoFuncOpenLogic(curPlayer):
|
| | | def DoFuncOpenLogic(curPlayer, checkServerDay=True):
|
| | | '''执行触发功能开启逻辑
|
| | | @param finishMissionIDList: 完成的任务ID列表
|
| | | '''
|
| | |
| | | continue
|
| | |
|
| | | limitOpenDay = ipyData.GetLimitOpenDay()
|
| | | if limitOpenDay and serverDay < limitOpenDay:
|
| | | if limitOpenDay and serverDay < limitOpenDay and checkServerDay:
|
| | | continue
|
| | | |
| | | limitManLevel = ipyData.GetLimitManLevel()
|
| | | if limitManLevel and PlayerControl.GetMainLevelPassValue(curPlayer) < limitManLevel:
|
| | | 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
|
| | |
|