hch
2019-04-16 d9820f9f7f09c14d270b4cbbe649369c043be7e4
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package PlayerRefineStove
# @todo: Íæ¼ÒÁ¶µ¤Â¯
#
# @author: xdh
# @date 2019-4-12
# @version 1.0
#
# @note: 
#---------------------------------------------------------------------
#"""Version = 2019-4-12 16:40"""
#---------------------------------------------------------------------
import ChConfig
import GameWorld
import IPY_GameWorld
import ItemControler
import PlayerControl
import ChPyNetSendPack
import NetPackCommon
import GameFuncComm
import ShareDefine
import ItemCommon
import PlayerSuccess
import PlayerAttrFruit
import IpyGameDataPY
import EventShell
import PlayerActivity
import PlayerFairyCeremony
import PlayerNewFairyCeremony
import PlayerActLogin
import PlayerVip
 
import copy
import time
 
DefStoveTypeList = [1, 2]  #1Á鵤 2Ïɵ¤
 
 
##¹¦ÄÜ¿ªÆô
def DoRefineStoveOpen(curPlayer):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyLV, 1)
    PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_AlchemyLV, 1)
    Sycn_AlchemyMsg(curPlayer)
    return True
 
 
##µÇ¼´¦Àí
def DoOnLogin(curPlayer, tick):
    Sycn_AlchemyMsg(curPlayer)
    Sycn_AlchemyPrayMsg(curPlayer)
    return
 
 
def OnDay(curPlayer):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyPrayCnt, 0)
    Sycn_AlchemyPrayMsg(curPlayer)
    return
 
 
#// A5 76 Íæ¼ÒÁ¶µ¤ #tagCMPlayerRefine
#
#struct tagCMPlayerRefine
#{
#    tagHead    Head;
#    DWORD    AlchemyID;    // µ¤Ò©ID
#    BYTE   DoType;  // 0-ѧϰ 1-¿ªÊ¼Á¶µ¤ 2-Í£Ö¹Á¶µ¤ 3-¿ªÂ¯È¡µ¤
#};
def PlayerRefineItem(index, clientPack, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetPlayerID()
    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineStove):
        GameWorld.DebugLog("Á¶µ¤Â¯¹¦ÄÜ먦Æô£¡", playerID)
        return
    
    alchemyID = clientPack.AlchemyID
    doType = clientPack.DoType
    GameWorld.DebugLog("Íæ¼ÒÁ¶µ¤: alchemyID=%s, doType=%s" % (alchemyID, doType), playerID)
    alchemyIpyData = IpyGameDataPY.GetIpyGameData("Alchemy", alchemyID)
    if not alchemyIpyData:
        GameWorld.DebugLog("Åä·½²»´æÔÚ£¡alchemyID=%s" % alchemyID, playerID)
        return
    alchemType = alchemyIpyData.GetAlchemType()
    alchemyItemID = alchemyIpyData.GetAlchemItemID()
    hasLearn = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_AlchemyLearnState, alchemyID)
    alchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
    curAlchemyItemID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyItemID % alchemType)  #ÕýÔÚÁ¶µÄµ¤
    curLuckValue = curPlayer.GetLuckValue()
    curTime = int(time.time())
    
    if doType == 0:
        if hasLearn:
            GameWorld.DebugLog('µ¤·½ÒÑѧϰ£¡£¬²»¿ÉÖØ¸´Ñ§')
            return
        learnNeedAlchemLV = alchemyIpyData.GetLearnNeedAlchemLV()
        if alchemyLV < learnNeedAlchemLV:
            GameWorld.DebugLog('µ¤·½Ñ§Ï°ÐèÒªÁ¶µ¤µÈ¼¶ %s' % learnNeedAlchemLV)
            return
        learnNeedLuck = alchemyIpyData.GetLearnNeedLuck()
        if curLuckValue < learnNeedLuck:
            GameWorld.DebugLog('µ¤·½Ñ§Ï°ÐèÒª»Û¸ù %s' % learnNeedLuck)
            return
        learnNeedItemID = alchemyIpyData.GetLearnNeedItemID()
        itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
        enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(learnNeedItemID, itemPack, 1)
        if not enough:
            return
        ItemCommon.ReduceItem(curPlayer, itemPack, indexList, 1, False, "RefineStove")
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_AlchemyLearnState, alchemyID, 1)
        Sycn_AlchemyMsg(curPlayer, alchemyID, False)
    elif doType == 1:
        if not hasLearn:
            GameWorld.DebugLog('µ¤·½Î´Ñ§Ï°£¡£¬²»¿ÉÁ¶µ¤')
            return
        if curAlchemyItemID:
            GameWorld.DebugLog('µ±Ç°µ¤ÀàÐÍÒÑÔÚÁ¶µ¤ÖУ¡ curAlchemyItemID=%s' % curAlchemyItemID)
            return
        # »ù´¡¹Ì¶¨ÏûºÄ
        needMaterialDict = alchemyIpyData.GetMaterial()
               
        itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
        lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needMaterialDict, itemPack, False)
        if lackItemDict:
            GameWorld.DebugLog("Åä·½²ÄÁϲ»×㣡alchemyID=%s,needMaterialDict=%s,lackItemDict=%s,hasItemDict=%s" 
                               % (alchemyItemID, needMaterialDict, lackItemDict, delInfoDict), playerID)
            return
        #¿ÛÏûºÄ
        ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, ChConfig.ItemDel_Alchemy)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyItemID % alchemType, alchemyItemID)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyStartTime % alchemyID, curTime)
        
        Sycn_AlchemyMsg(curPlayer, alchemyID, False)
        #ÈÕ³£ÈÎÎñ
        costItemCnt = sum(needMaterialDict.values())
        PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_RefineStove, costItemCnt)
        
    elif doType == 2:
        if curAlchemyItemID != alchemyItemID:
            GameWorld.DebugLog('Í£Ö¹µ¤Ò©ID´íÎó curAlchemyItemID=%s' % curAlchemyItemID)
            return
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyItemID % alchemType, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyStartTime % alchemyID, 0)
        Sycn_AlchemyMsg(curPlayer, alchemyID, False)
    elif doType == 3:
        if curAlchemyItemID != alchemyItemID:
            GameWorld.DebugLog('¿ªÂ¯µ¤Ò©ID´íÎó curAlchemyItemID=%s' % curAlchemyItemID)
            return
        startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyStartTime % alchemyID)
        passTime = max(0, curTime - startTime)
        if passTime < alchemyIpyData.GetNeedTime():
            GameWorld.DebugLog('¿ªÂ¯µ¤Ò©,ʱ¼äδµ½  passTime=%s' % passTime)
            return
        #³É¹¦ÂÊ
        if alchemType == 2:
            successRate = ShareDefine.Def_MaxRateValue  #Ïɵ¤±Ø¶¨³É¹¦
        else:
            #Á鵤³É¹¦Âʹ«Ê½ ²ÎÊý curLuckValue:»Û¸ù  alchemyLV:Á¶µ¤µÈ¼¶ alchemyQuality:µ¤Ò©µÈ¼¶  qualityNeedLuck:ÒªÇó»Û¸ù
            alchemyQuality = alchemyIpyData.GetAlchemyQuality()
            qualityNeedLuck = IpyGameDataPY.GetFuncEvalCfg('alchemySuccess', 2, {}).get(alchemyQuality, 0)
            successRate = eval(IpyGameDataPY.GetFuncCompileCfg('alchemySuccess'))
        isSuccess = GameWorld.CanHappen(successRate)
        resultCnt = 0  #µ¤Ò©ÊýÁ¿ 0´ú±íʧ°Ü
        if isSuccess:
            needSpace = 1
            packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
            if needSpace > packSpace:
                PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
                return
            ipyData = IpyGameDataPY.InterpolationSearch('AlchemyResult', 'LuckValue', curLuckValue, {'AlchemyQuality':alchemyIpyData.GetAlchemyQuality()})
            if not ipyData:
                GameWorld.ErrLog('AlchemyResult ÅäÖôíÎó Î´ÕÒµ½¸Ãµ¤·½ÊýÁ¿ alchemyItemID=%s' % alchemyItemID, playerID)
                return
            resultCnt = GameWorld.GetResultByRandomList(ipyData.GetCntRateList())
            if not resultCnt:
                GameWorld.ErrLog('AlchemyResult ÅäÖôíÎó Î´Ëæ»ú³ö¸Ãµ¤·½ÊýÁ¿alchemyItemID=%s' % alchemyItemID, playerID)
                return
            makeItemData = GameWorld.GetGameData().GetItemByTypeID(alchemyItemID)
            if not makeItemData:
                return
            ItemControler.GivePlayerItem(curPlayer, alchemyItemID, resultCnt, 0, [IPY_GameWorld.rptItem],
                                     event=[ChConfig.ItemGive_Refine, False, {}])
            #×ÏÉ«¼°ÒÔÉÏÈ«·þ¹ã²¥
            notifyColor = IpyGameDataPY.GetFuncCfg("AlchemyNotify", 1)
            needNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 2)
            notNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 3)
            if alchemyItemID not in notNotifyItemIDList and (alchemyItemID in needNotifyItemIDList or makeItemData.GetItemColor() >= notifyColor):
                PlayerControl.WorldNotify(0, "AchemyGreatSuccess", [curPlayer.GetPlayerName(), alchemyItemID])
 
        #ÖØÖÃ
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyItemID % alchemType, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyStartTime % alchemyID, 0)
        #¼Ó¾­Ñé
        addExp = alchemyIpyData.GetAlchemyExp()
        AddRefineExp(curPlayer, addExp, alchemyLV)
        GameWorld.DebugLog('Á¶µ¤½á¹û alchemyItemID=%s,successRate=%s,isSuccess=%s,resultCnt=%s' % (alchemyItemID, successRate, isSuccess, resultCnt), playerID)
    
        Sycn_AlchemyMsg(curPlayer, alchemyID, False, alchemyItemID, resultCnt)
                    
        #Íê³É1´ÎÁ¶µ¤³É¾Í
        PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_RefineItem, 1)
        #Íê³É1´ÎXÆ·ÖÊÎïÆ·Á¶µ¤³É¾Í
        #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_RefineStoveColor, 1, [makeItemData.GetItemColor()])
        #ÈÎÎñ
        #EventShell.EventRespons_RefineItem(curPlayer, alchemyIpyData.GetNeedAlchemyLV())
        
        PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RefineStove, 1)
        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RefineStove, 1)
        PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_Alchemy, 1)
    return 
 
 
def AddRefineExp(curPlayer, addExp, alchemyLV):
    #Ôö¼ÓÁ¶µ¤Â¯¾­Ñé
    if addExp <= 0:
        return
    
    alchemyExp = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyExp) + addExp, ShareDefine.Def_UpperLimit_DWord)
    GameWorld.DebugLog("Ôö¼ÓÁ¶µ¤¾­Ñé: alchemyLV=%s,addExp=%s,alchemyExp=%s" % (alchemyLV, addExp, alchemyExp), curPlayer.GetPlayerID())
    
    isLVUp = False
    stoveIpyData = IpyGameDataPY.GetIpyGameDataNotLog("RefineStove", alchemyLV)
    while stoveIpyData and stoveIpyData.GetUpNeedExp() and alchemyExp >= stoveIpyData.GetUpNeedExp():
        needExp = stoveIpyData.GetUpNeedExp()
        nextLV = alchemyLV + 1
        stoveIpyData = IpyGameDataPY.GetIpyGameDataNotLog("RefineStove", nextLV)
        if not stoveIpyData:
            GameWorld.DebugLog("ûÓÐÏÂÒ»¼¶Êý¾ÝÁË£¬ÒÑÂú¼¶£¡²»¿ÉÉý¼¶£¡", curPlayer.GetPlayerID())
            break
        
        alchemyExp -= needExp
        alchemyLV += 1
        GameWorld.DebugLog("    Á¶µ¤Éý¼¶: alchemyLV=%s,alchemyExp=%s" % (alchemyLV, alchemyExp), curPlayer.GetPlayerID())
        isLVUp = True
        EventShell.EventRespons_RefineStoveUp(curPlayer, alchemyLV)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyExp, alchemyExp)
    if not isLVUp:
        return False
    
    GameWorld.DebugLog("Éý¼¶ºóÊ£ÓྭÑ飺 %s" % alchemyExp, curPlayer.GetPlayerID())
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyLV, alchemyLV)
    PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_AlchemyLV, alchemyLV)
    return True
 
 
def Sycn_AlchemyMsg(curPlayer, alchemyID=0, isAll=True, itemID=0, itemCnt=0):
    # Í¨Öª¿Í»§¶ËÁ¶µ¤Â¯ÐÅÏ¢
    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineStove):
        return
    pack = ChPyNetSendPack.tagMCPlayerStoveMsg()
    pack.StoveExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyExp)
    pack.StoveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
    pack.ItemID = itemID
    pack.ItemCnt = itemCnt
    pack.InfoList = []
    syncItemIDList = []
    if isAll:
        ipyMgr = IpyGameDataPY.IPY_Data()
        for i in xrange(ipyMgr.GetAlchemyCount()):
            ipyData = ipyMgr.GetAlchemyByIndex(i)
            alchemyID = ipyData.GetID()
            if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_AlchemyLearnState, alchemyID):
                syncItemIDList.append(alchemyID)
    elif alchemyID and GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_AlchemyLearnState, alchemyID):
        syncItemIDList = [alchemyID]
    
    for alchemyID in syncItemIDList:
        StoveInfo = ChPyNetSendPack.tagMCPlayerStoveInfo()
        StoveInfo.AlchemyID = alchemyID
        StoveInfo.StartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyStartTime % alchemyID)
        pack.InfoList.append(StoveInfo)
    pack.StoveCnt = len(pack.InfoList)
    NetPackCommon.SendFakePack(curPlayer, pack)
    return
 
 
def RefreshStoveAttr(curPlayer):
    CalcStoveAttr(curPlayer)
    PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
    return
 
 
def CalcStoveAttr(curPlayer):
    # ¹ûʵ¼Ó³É
    allAttrYaoList = [{} for _ in range(4)]
    fightPowerEx = PlayerAttrFruit.CalcAttrFruitAddAtrr(curPlayer, allAttrYaoList, ShareDefine.Def_AttrFruitFunc_Stove)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_StoveYao, allAttrYaoList)
    curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_StoveYao, fightPowerEx)
    return
 
 
#// A5 14 Æí¸£µ¤Ò© #tagCMPrayElixir
#
#struct    tagCMPrayElixir
#
#{
#    tagHead        Head;
#};
def PlayerPrayElixir(index, clientPack, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    prayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyPrayCnt)
    limitCnt = PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_PrayElixir)
    if prayCnt >= limitCnt:
        GameWorld.DebugLog('½ñÈÕÆí¸£µ¤Ò©´ÎÊýÒÑÂú£¡prayCnt=%s' % prayCnt)
        return
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1) 
    if not packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    
    alchemyItemList = IpyGameDataPY.GetFuncEvalCfg('GodAlchemy')
    
    newItemInfoList = []
    for itemInfo in alchemyItemList:
        itemID = itemInfo[1]
#        if not GetIsCanOutByAlchemyLV(curPlayer, itemID):
#            #GameWorld.DebugLog('Æí¸£µ¤Ò©,Á¶µ¤µÈ¼¶Î´´ïµ½£¬ÒƳý²ú³ö¿â£¡itemID=%s'%itemID)
#            continue
        if PlayerAttrFruit.IsFruitEatFull(curPlayer, itemID):
            #GameWorld.DebugLog('Æí¸£µ¤Ò©,ʹÓôÎÊýÒÑÂú£¬ÒƳý²ú³ö¿â£¡itemID=%s'%itemID)
            continue
        newItemInfoList.append(itemInfo)
    if not newItemInfoList:
        GameWorld.DebugLog('Æí¸£µ¤Ò©,ûÓе¤Ò©¿É²ú³ö£¡£¡')
        return
    
    makeItemInfo = GameWorld.GetResultByWeightList(newItemInfoList)
    if not makeItemInfo:
        GameWorld.DebugLog("Æí¸£µ¤Ò©£¬ ½á¹û´íÎó£¡")
        return
    
    makeItemID, itemCount = makeItemInfo
    makeItemData = GameWorld.GetGameData().GetItemByTypeID(makeItemID)
    if not makeItemData:
        return
    
    costMoney = IpyGameDataPY.GetFuncCfg('GodAlchemy', 2)
    if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_AlchemyPray):
        return
    #¸øÎïÆ·
    ItemControler.GivePlayerItem(curPlayer, makeItemID, itemCount, 0, [IPY_GameWorld.rptItem],
                                 event=[ChConfig.ItemGive_Refine, False, {}])
    #GameWorld.DebugLog('makeItemID=%s,newItemInfoList=%s'%(makeItemID, newItemInfoList))
    
    #×ÏÉ«¼°ÒÔÉÏÈ«·þ¹ã²¥
    notifyColor = IpyGameDataPY.GetFuncCfg("AlchemyNotify", 1)
    needNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 2)
    notNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 3)
    if makeItemID not in notNotifyItemIDList and (makeItemID in needNotifyItemIDList or makeItemData.GetItemColor() >= notifyColor):
        PlayerControl.WorldNotify(0, "BlastfurnaceBlessing", [curPlayer.GetPlayerName(), makeItemID])
        
    #¸üдÎÊý
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyPrayCnt, prayCnt + 1)
    Sycn_AlchemyPrayMsg(curPlayer, makeItemID)
    return
 
 
def Sycn_AlchemyPrayMsg(curPlayer, itemID=0):
    return
    #Æí¸£µ¤Ò©½á¹û
    if not itemID and not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineStove):
        return
    pack = ChPyNetSendPack.tagMCPrayElixirResult()
    pack.PrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyPrayCnt)
    pack.ItemID = itemID
    NetPackCommon.SendFakePack(curPlayer, pack)
    return