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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.FeastWish
#
# @todo:½ÚÈÕ×£¸£
# @author hxp
# @date 2021-01-29
# @version 1.0
#
# ÏêϸÃèÊö: ½ÚÈÕ×£¸£
#
#-------------------------------------------------------------------------------
#"""Version = 2021-01-29 11:30"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerControl
import PlayerFeastWish
import ChConfig
 
 
def __Help(curPlayer):
    GameWorld.DebugAnswer(curPlayer, "ÖØÖÃ×£¸£Æ¿: FeastWish 0")
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ×£¸£Æ¿: FeastWish ±àºÅ ×£¸£Öµ")
    GameWorld.DebugAnswer(curPlayer, "×£¸£Æ¿ÁìÈ¡: FeastWish ±àºÅ ¼Ç¼Ë÷Òý ÊÇ·ñÁìÈ¡")
    return
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param paramList ²ÎÊýÁбí []
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, paramList):
    
    if not paramList:
        __Help(curPlayer)
        return
    
    if paramList[0] == 0:
        bottleNumList = PlayerFeastWish.GetWishBottleNumList()
        for bottleNum in bottleNumList:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, 0)
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃOK£¡")
    elif len(paramList) == 2:
        bottleNum, wishValue = paramList
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, wishValue)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ×£¸£Æ¿(%s),×£¸£Öµ=%s" % (bottleNum, wishValue))
    elif len(paramList) == 3:
        bottleNum, recordIndex, isGet = paramList
        getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
        updState = GameWorld.SetBitValue(getState, recordIndex, isGet)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, updState)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ×£¸£Æ¿(%s),getState=%s,updState=%s" % (bottleNum, getState, updState))
    else:
        __Help(curPlayer)
        return
    
    PlayerFeastWish.Sync_FeastWishActionInfo(curPlayer)
    PlayerFeastWish.Sync_FeastWishPlayerInfo(curPlayer)
    return