hxp
2020-04-01 8155ce1b16a37578c76b3d520a12f4b5419666a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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