#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package GM.Commands.SetTechLV
|
#
|
# @todo:ÉèÖÃÍæ¼Ò×ÔÉíÕ½Ã˿Ƽ¼
|
# @author hxp
|
# @date 2016-11-02
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: ÉèÖÃÍæ¼Ò×ÔÉíÕ½Ã˿Ƽ¼
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2016-11-02 14:00"""
|
#-------------------------------------------------------------------------------
|
|
import PlayerFamilyTech
|
import PlayerControl
|
import IpyGameDataPY
|
import ChConfig
|
import GameWorld
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param msgList ²ÎÊýÁбí
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(curPlayer, msgList):
|
|
# ÊäÈëÃüÁî¸ñʽ´íÎó
|
if not msgList or len(msgList) > 2:
|
GameWorld.DebugAnswer(curPlayer, "SetTechLV µÈ¼¶(Ö±½ÓÉèÖÃËùÓпƼ¼µÈ¼¶)")
|
GameWorld.DebugAnswer(curPlayer, "SetTechLV ¿Æ¼¼ID µÈ¼¶(ÉèÖÃij¸ö¿Æ¼¼IDµÈ¼¶)")
|
return
|
|
techNeedLVDict = IpyGameDataPY.GetFuncEvalCfg('FamilyTechNeedLV', 1, {})
|
techIDList = techNeedLVDict.keys()
|
|
# ÉèÖÃËùÓпƼ¼µÈ¼¶
|
if len(msgList) == 1:
|
techLV = msgList[0]
|
for techID in techIDList:
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTechLV % techID, techLV)
|
GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÕ½Ã˿Ƽ¼(%s)µÈ¼¶: %s" % (techID, techLV))
|
else:
|
techID = msgList[0]
|
techLV = msgList[1]
|
if techID not in techIDList:
|
GameWorld.DebugAnswer(curPlayer, "Õ½Ã˿Ƽ¼(%s)²»´æÔÚ!" % (techID))
|
return
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTechLV % techID, techLV)
|
GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÕ½Ã˿Ƽ¼(%s)µÈ¼¶: %s" % (techID, techLV))
|
|
PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
#Ë¢ÐÂËùÓÐÊôÐÔ
|
PlayerFamilyTech.CalcFamilyTechAttr(curPlayer)
|
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
return
|
|
|