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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerNewFairyCeremony
#
# @todo:ÐÂÏɽçÊ¢µä
# @author xdh
# @date 2018-07-23 16:50
# @version 1.0
#
#
# ÏêϸÃèÊö: ÐÂÏɽçÊ¢µä
#
#---------------------------------------------------------------------
"""Version = 2018-07-23 16:50"""
#---------------------------------------------------------------------
 
import ChPyNetSendPack
import GameWorld
import PlayerDBGSEvent
import ShareDefine
import NetPackCommon
import PlayerBillboard
import IpyGameDataPY
import PlayerCompensation
 
(
Def_FC_Recharge, #³äÖµ´óÀñ
Def_FC_Fireworks, #ÑÌ»¨
Def_FC_Party, #È«ÃñÀ´àË
Def_FC_RechargeRank, #¾ø°æ½µÁÙ
) = range(1, 5)
 
def ResetNewFairyCeremony():
    ##»î¶¯¿ªÊ¼ ÖØÖÃÅÅÐаñÐÅÏ¢
    # Çå³ýÅÅÐаñ
    
    PlayerBillboard.ClearBillboardByIndex(ShareDefine.Def_BT_NewFCCostGold)
    return
 
def OnNewFairyCeremonyEnd():
    #»î¶¯½áÊø  ¾ø°æ½µÁÙ¸ø½±Àø
    billBoard = GameWorld.GetBillboard().FindBillboard(ShareDefine.Def_BT_NewFCCostGold)
    if not billBoard:
        return
    worldLvNum = __GetFCWorldLVIndex(Def_FC_RechargeRank)
    
    billboardCnt = billBoard.GetCount()
    
    for index in range(0, billboardCnt):
        ipyData = IpyGameDataPY.GetIpyGameData('NewUniquenessArrive', worldLvNum, index + 1)
        if not ipyData:
            break
        objBillboard = billBoard.At(index)
        playerID = objBillboard.GetID()
        awardInfoDict = ipyData.GetAward()
        job = objBillboard.GetType2() % 10
        if str(job) not in awardInfoDict:
            GameWorld.ErrLog('    ¾ø°æ½µÁÙ¸ø½±Àø UniquenessArrive Î´ÅäÖøÃÖ°Òµ job=%s' % job, playerID)
            continue
        
        awardList = awardInfoDict[str(job)]
        PlayerCompensation.SendMailByKey('NewCeremonyRank', [playerID], awardList, [objBillboard.GetName1(), index + 1])
        
    GameWorld.DebugLog('    »î¶¯½áÊø  ¾ø°æ½µÁÙ¸ø½±Àø  worldLvNum=%s, billboardCnt=%s' % (worldLvNum, billboardCnt))
    return
 
def __GetFCWorldLVIndex(fcType):
    #»ñÈ¡»î¶¯ÊÀ½çµÈ¼¶µµ
    playerFCWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony)
    fcWorldlvDict = IpyGameDataPY.GetFuncEvalCfg('NewCeremonyWorldLv', 1, {})
    if str(fcType) not in fcWorldlvDict:
        return 0
    worldLVIndex = 0
    worldlvList = fcWorldlvDict[str(fcType)]
    for index, lvinfo in enumerate(worldlvList):
        minlv, maxlv = lvinfo
        if minlv <= playerFCWorldLV <= maxlv:
            worldLVIndex = index
            break
    return worldLVIndex
 
def Sync_OperationAction_NewFairyCeremony(ipyData, curPlayer=None):
    ## Í¨ÖªÐÂÏɽçÊ¢µä»î¶¯ÐÅÏ¢
    if not ipyData:
        return
    
    startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData)
    NewFairyCeremonyInfo = ChPyNetSendPack.tagGCNewFairyCeremonyInfo()
    NewFairyCeremonyInfo.Clear()
    NewFairyCeremonyInfo.StartDate = startDateStr
    NewFairyCeremonyInfo.EndtDate = endDateStr
    NewFairyCeremonyInfo.WorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony)
    NewFairyCeremonyInfo.LimitLV = ipyData.GetLVLimit()
    NewFairyCeremonyInfo.ResetType = ipyData.GetResetType()
    if not curPlayer:
        # È«·þ¹ã²¥ÔÚÏßÍæ¼Ò
        playerManager = GameWorld.GetPlayerManager()
        for i in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(i)
            if curPlayer == None or not curPlayer.GetInitOK():
                continue
            NetPackCommon.SendFakePack(curPlayer, NewFairyCeremonyInfo)
    else:
        NetPackCommon.SendFakePack(curPlayer, NewFairyCeremonyInfo)
    return