| | |
| | | import PlayerFreeGoods
|
| | | import FunctionNPCCommon
|
| | | import PlayerGreatMaster
|
| | |
|
| | |
|
| | | import IPY_GameWorld
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | | import PlayerTJG
|
| | |
|
| | |
|
| | | # 功能开启需执行的函数{功能ID:执行函数, ...} 函数需返回是否激活成功, 功能开启有需要处理功能逻辑的这里增加函数调用配置即可
|
| | |
| | | ShareDefine.GameFuncID_OSSail:lambda curObj:FunctionNPCCommon.OSSaleOpenMail(curObj),
|
| | | ShareDefine.GameFuncID_AddPoint:lambda curObj:PlayerControl.DoAddPointOpen(curObj),
|
| | | ShareDefine.GameFuncID_Talent:lambda curObj:PlayerGreatMaster.DoTalentOpen(curObj),
|
| | | ShareDefine.GameFuncID_TJG:lambda curObj:PlayerTJG.DoTJGOpen(curObj),
|
| | | ShareDefine.GameFuncID_SuperGift:lambda curObj:FunctionNPCCommon.UpdataSuperGiftTime(curObj),
|
| | | #ShareDefine.GameFuncID_RunDaily:lambda curObj:FBCommon.DoFuncOpen_RunDaily(curObj),
|
| | | #ShareDefine.GameFuncID_RunFamily:lambda curObj:FBCommon.DoFuncOpen_RunFamily(curObj),
|
| | | #ShareDefine.GameFuncID_RefineExp:lambda curObj:Operate_PlayerBuyZhenQi.DoFuncOpen_RefineExp(curObj),
|
| | |
| | |
|
| | | return ipyData.GetLimitLV()
|
| | |
|
| | | def GetFuncOpenAward(curPlayer, funcID):
|
| | | ## 领取功能开启奖励
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FunctionForecast', funcID)
|
| | | if not ipyData:
|
| | | return
|
| | | getState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
|
| | | if getState:
|
| | | return
|
| | | awardDict = ipyData.GetAward()
|
| | | job = curPlayer.GetJob()
|
| | | itemList = awardDict.get(str(job))
|
| | | 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, 1, [IPY_GameWorld.rptItem])
|
| | | Sync_FuncOpenState(curPlayer, [funcID])
|
| | | return
|
| | | |
| | | def Sync_FuncOpenState(curPlayer, syncFuncIDList=[], isSyncUnOpen=False):
|
| | | ## 通知功能首次触发情况
|
| | | if not syncFuncIDList:
|
| | |
| | | funcOpenState.Clear()
|
| | | funcOpenState.FuncID = funcID
|
| | | funcOpenState.State = openState
|
| | | funcOpenState.AwardState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
|
| | | funcStatePack.FuncStateList.append(funcOpenState)
|
| | | funcCount = len(funcStatePack.FuncStateList)
|
| | | funcStatePack.FuncCount = funcCount
|