| | |
| | | GameWorld.DebugAnswer(curPlayer, "开启所有功能: OpenFunc 1")
|
| | | GameWorld.DebugAnswer(curPlayer, "开启指定功能: OpenFunc 1 功能ID")
|
| | | GameWorld.DebugAnswer(curPlayer, "关闭所有功能: OpenFunc 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "关闭指定功能: OpenFunc 0 功能ID")
|
| | | else:
|
| | | state = cmdList[0]
|
| | | if not state:
|
| | | curPlayer.SetLV(1)
|
| | | curPlayer.SetOfficialRank(0)
|
| | | for mwType in xrange(1, 6):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponIsActive % (mwType, 0), 0)
|
| | | |
| | | for keyNum in xrange(8):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch % keyNum, 0)
|
| | | |
| | | needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit([])
|
| | | for missionID in needMissionIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_MissionFinish % missionID, 0)
|
| | | |
| | | GameFuncComm.Sync_FuncOpenState(curPlayer, isSyncUnOpen=True)
|
| | | GameWorld.DebugAnswer(curPlayer, "关闭所有功能!")
|
| | | closeFuncID = cmdList[1] if len(cmdList) > 1 else 0
|
| | | DoGMCloseFunc(curPlayer, closeFuncID)
|
| | | else:
|
| | | openFuncID = cmdList[1] if len(cmdList) > 1 else 0
|
| | | DoGMOpenFunc(curPlayer, openFuncID)
|
| | |
| | | needMissionIDList.append(limitMissionID)
|
| | | return needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList
|
| | |
|
| | | def DoGMCloseFunc(curPlayer, closeFuncID):
|
| | | ## GM关闭功能
|
| | | if not closeFuncID:
|
| | | curPlayer.SetLV(1)
|
| | | curPlayer.SetOfficialRank(0)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetTreasureCount()):
|
| | | ipyData = ipyDataMgr.GetTreasureByIndex(i)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponLV % ipyData.GetID(), 0)
|
| | | |
| | | for keyNum in xrange(8):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch % keyNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState % keyNum, 0)
|
| | | |
| | | needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit([])
|
| | | for missionID in needMissionIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_MissionFinish % missionID, 0)
|
| | | |
| | | GameFuncComm.Sync_FuncOpenState(curPlayer, isSyncUnOpen=True)
|
| | | GameWorld.DebugAnswer(curPlayer, "关闭所有功能!")
|
| | | return
|
| | | |
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, closeFuncID):
|
| | | GameWorld.DebugLog("功能已关闭,不需要重复关闭! closeFuncID=%s" % closeFuncID, curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("FuncOpenLV", closeFuncID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | limitLV = ipyData.GetLimitLV()
|
| | | if limitLV and curPlayer.GetLV() >= limitLV:
|
| | | curPlayer.SetLV(max(1, limitLV - 1))
|
| | | PlayerControl.SetPlayerTotalExp(curPlayer, 0)
|
| | | |
| | | limitRealmLV = ipyData.GetLimiRealmLV()
|
| | | if limitRealmLV and curPlayer.GetOfficialRank() >= limitRealmLV:
|
| | | curPlayer.SetOfficialRank(max(0, limitRealmLV - 1))
|
| | | |
| | | limitMagicWeaponID = ipyData.GetLimitMagicWeapon()
|
| | | if limitMagicWeaponID:
|
| | | mwID = limitMagicWeaponID / 100
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponLV % mwID, 0)
|
| | | |
| | | limitMissionID = ipyData.GetLimitMissionID()
|
| | | if limitMissionID:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_MissionFinish % limitMissionID, 0)
|
| | | |
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch, closeFuncID, 0)
|
| | | GameFuncComm.Sync_FuncOpenState(curPlayer, isSyncUnOpen=True)
|
| | | GameWorld.DebugAnswer(curPlayer, "关闭功能: %s" % closeFuncID)
|
| | | return
|