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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldLogic.FBProcess.GameLogic_ClearDevil
#
# @todo:³ýħÎÀµÀ
# @author xdh
# @date 2017-09-12
# @version 1.0
#
# ÏêϸÃèÊö: ³ýħÎÀµÀ
#
#-------------------------------------------------------------------------------
#"""Version = 2017-09-12 21:00"""
#-------------------------------------------------------------------------------
 
import FBCommon
import GameWorld
import IpyGameDataPY
import IPY_GameWorld
import GameWorldProcess
import EventShell
import NPCCustomRefresh
import ChConfig
import ShareDefine
import EventReport
import PlayerControl
import QuestCommon
 
 
#---¸±±¾ÅäÖöÔÓ¦keyÖµ---
(
Def_IsPointType, #ÊÇ·ñ»ý·ÖÀั±¾
Def_PrepareTime, # ¸±±¾×¼±¸Ê±¼ä(Ãë)
Def_FightTime, # ½øÐÐʱ¼ä(Ãë)
Def_LeaveTime, # Í˳öʱ¼ä(Ãë)
) = range(4)
 
(
DL_RefreshMark, # Ë¢¹Ö±êʶµã
DL_NPCID, # NPCID
DL_SingleNPCCnt, # µ¥´ÎË¢NPC¸öÊý
DL_maxCnt, #µ±Ç°µã×î´ó¹ÖÎïÊý
DL_TotalNPCCnt, # ÀÛ¼ÆË¢NPC×ܸöÊý
DL_NeedKillCnt, # ÐèÒª»÷ɱÊýÁ¿
DL_RefreshCD, # Ë¢Ð¼ä¸ô
) = range(7)
 
 
#µ±Ç°¸±±¾µØÍ¼µÄ״̬
(
FB_Step_Open, # ¸±±¾¿ªÆô
FB_Step_Prepare, # ¸±±¾µÈ´ý
FB_Step_Fighting, # ¸±±¾½øÐÐÖÐ
FB_Step_Over, # ¸±±¾½áÊø
FB_Step_Close, # ¸±±¾¹Ø±Õ
) = range(5)
 
FBPlayerDict_MissionID = 'FBPlayerDict_MissionID'   #¸±±¾ÈÎÎñID
FBPlayerDict_MissionType = 'FBPlayerDict_MissionType'   #¸±±¾ÈÎÎñÀàÐÍ
FBPlayerDict_CostTime = 'FBPlayerDict_CostTime'   #¸±±¾ºÄʱ
FBPlayerDict_TotalPoint = 'FBPlayerDict_TotalPoint'   # »ñµÃµÄ×Ü»ý·Ö
FBPlayerDict_NPCRemainCnt = 'FBPlayerDict_NPCRemainCnt_%s'   # NPCÊ£ÓàÊýÁ¿
FBPlayerDict_TotalExp = 'FBPlayerDict_TotalExp'   # »ñµÃµÄ×ܾ­Ñé
FBPlayerDict_TotalExpPoint = 'FBPlayerDict_TotalExpPoint'   # »ñµÃµÄ×ܾ­Ñéµã
 
 
##---»ñµÃ¸±±¾ÅäÖÃ---
#  @param None
#  @return ÅäÖÃÐÅÏ¢
def GetClearDevilTimeCfg(lineID=None):
    if lineID == None:
        lineID = FBCommon.GetFBPropertyMark()
    mapID = GameWorld.GetMap().GetMapID()
    return FBCommon.GetFBLineStepTime(mapID, lineID)
 
 
def GetClearDevilNPCCfg(lineID):
    mapID = GameWorld.GetMap().GetMapID()
    return FBCommon.GetFBLineRefreshNPC(mapID, lineID)
 
def GetPointByNPCID(npcid):
    '''ͨ¹ýNPCID»ñÈ¡¶ÔÓ¦µÄ»ý·Ö'''
    npcPointDict = IpyGameDataPY.GetFuncEvalCfg('ClearDevilPoint', 2)
    return npcPointDict.get(npcid, 0)
 
def GetIsPointFBType(lineID):
    #ÊÇ·ñ»ý·ÖÀั±¾
    FBLineStepTimeCfg = GetClearDevilTimeCfg(lineID)
    if not FBLineStepTimeCfg:
        return
    return FBLineStepTimeCfg[Def_IsPointType]
 
## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë
#  @param curPlayer Íæ¼ÒʵÀý
#  @param mapID µØÍ¼ID
#  @param lineID Ïß·id
#  @param tick Ê±¼ä´Á
#  @return ²¼¶ûÖµ
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    return True
 
 
##¸±±¾Íæ¼Ò½øÈëµã
# @param curPlayer Íæ¼ÒʵÀý
# @param mapID µØÍ¼ID
# @param lineId ·ÖÏßID
# @param ipyEnterPosInfo ¹¦ÄÜÏß·IPYÅäÖÃ×ø±êÐÅÏ¢
# @param tick Ê±¼ä´Á
# @return posX, posY, Ëæ»ú°ë¾¶(¿ÉÑ¡)
def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
    return ipyEnterPosInfo
 
 
##²éѯÊÇ·ñ¿ÉÒÔ½øÈëµØÍ¼
# @param ask:ÇëÇó½á¹¹Ìå(IPY_BMChangeMapAsk)
# @param tick:ʱ¼ä´Á
# @return IPY_GameWorld.cme Ã¶¾Ù
def OnChangeMapAsk(ask, tick):
    return IPY_GameWorld.cmeAccept
 
 
## ½ø¸±±¾
#  @param curPlayer
#  @param tick
#  @return None
def DoEnterFB(curPlayer, tick):
    playerID = curPlayer.GetPlayerID()
    playerLV = curPlayer.GetLV()
    mapID = GameWorld.GetMap().GetMapID()
    mapID = FBCommon.GetRecordMapID(mapID)
    gameFB = GameWorld.GetGameFB()
    lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
    GameWorld.DebugLog("DoEnterFB...lineID=%s,playerLV=%s" % (lineID, playerLV), playerID)
    hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
    if not hadDelTicket:
        FBCommon.SetHadDelTicket(curPlayer)
        FBCommon.SetFBPropertyMark(lineID)
        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ClearDevil, 0, ChConfig.CME_Log_Start)
        
    
    fbMissionID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBMissionID)
    if fbMissionID:
        fbMissionType = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBMissionType)
        gameFB.SetGameFBDict(FBPlayerDict_MissionID, fbMissionID)
        gameFB.SetGameFBDict(FBPlayerDict_MissionType, fbMissionType)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionID, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionType, 0)
    
    fbStep = gameFB.GetFBStep()
    if fbStep < FB_Step_Prepare:
        FBCommon.SetFBStep(FB_Step_Prepare, tick)
        
    if fbStep <= FB_Step_Prepare:
        notify_tick = GetClearDevilTimeCfg(lineID)[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
        curPlayer.Sync_TimeTick(IPY_GameWorld.tttAddUpTime, 0, max(notify_tick, 0), True)
        curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
        
    elif fbStep == FB_Step_Fighting:
        notify_tick = GetClearDevilTimeCfg(lineID)[Def_FightTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
        curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
    
    DoFBHelp(curPlayer, tick, not hadDelTicket)
    return
 
## ¿Í»§¶Ë·¢ËÍ¿ªÊ¼¸±±¾
def OnClientStartFB(curPlayer, tick):
    gameFB = GameWorld.GetGameFB()
    fbStep = gameFB.GetFBStep()
    if fbStep >= FB_Step_Prepare:
        GameWorld.ErrLog("ǰ¶ËÇëÇóÕýʽ¿ªÊ¼¸±±¾, µ«¸±±¾ÒѾ­¿ªÊ¼ÁË£¬²»¿ÉÖØ¸´¿ªÊ¼!", curPlayer.GetPlayerID())
        return
    
    lineID = FBCommon.GetFBPropertyMark()
    GameWorld.DebugLog("ǰ¶Ë³¡¾°ÐãÒѲ¥·ÅÍê±Ï£¬ÇëÇóÕýʽ¿ªÊ¼¸±±¾!lineID=%s" % lineID, curPlayer.GetPlayerID())
    FBCommon.SetFBStep(FB_Step_Prepare, tick)
    notify_tick = GetClearDevilTimeCfg(lineID)[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
    curPlayer.Sync_TimeTick(IPY_GameWorld.tttAddUpTime, 0, max(notify_tick, 0), True)
    curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
    DoFBHelp(curPlayer, tick, True)
    return
 
##Íæ¼ÒÍ˳ö¸±±¾
# @param curPlayer Íæ¼ÒʵÀý
# @param tick Ê±¼ä´Á
# @return ÎÞÒâÒå
def DoExitFB(curPlayer, tick):
    return
 
##Íæ¼ÒÖ÷¶¯À뿪¸±±¾.
# @param curPlayer Íæ¼ÒʵÀý
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎÞÒâÒå
def DoPlayerLeaveFB(curPlayer, tick):
    return
 
## »ñµÃ¸±±¾°ïÖúÐÅÏ¢
#  @param curPlayer µ±Ç°Íæ¼Ò£¨±»Í¨Öª¶ÔÏó£©
#  @param tick µ±Ç°Ê±¼ä
#  @return None
def DoFBHelp(curPlayer, tick, isEnter=False):
    gameFB = GameWorld.GetGameFB()
    
    # »ñµÃ¸±±¾ÐÅÏ¢
    lineID = FBCommon.GetFBPropertyMark()
    if GetIsPointFBType(lineID):
        totalPoint = gameFB.GetGameFBDictByKey(FBPlayerDict_TotalPoint)
        helpDict = {FBCommon.Help_score:totalPoint}
    else:
        npcCfg = GetClearDevilNPCCfg(lineID)
        if not npcCfg:
            GameWorld.Log("ûÓиÃÏß·ˢ¹ÖÅäÖàlineID=%s" % lineID)
            return
        npcDict = {}
        for info in npcCfg:
            npcID = info[DL_NPCID]
            remainCnt = gameFB.GetGameFBDictByKey(FBPlayerDict_NPCRemainCnt % npcID)
            if isEnter:
                killCnt = 0
            else:
                killCnt= info[DL_NeedKillCnt] - remainCnt
            npcDict[npcID] = killCnt
        helpDict = {FBCommon.Help_npc:FBCommon.GetJsonNPCKillList(npcDict)}
            
    #¸±±¾°ïÖú
    helpDict[FBCommon.Help_lineID] = FBCommon.GetFBPropertyMark()
    fbMissionID = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionID)
    helpDict["missionID"] = fbMissionID
    GameWorld.DebugLog("DoFBHelp %s" % str(helpDict))
    FBCommon.Notify_FBHelp(curPlayer, helpDict)
    return
 
 
##---¸±±¾×ÜÂß¼­¼ÆÊ±Æ÷---
# @param tick:ʱ¼ä´Á
# @return ÎÞÒâÒå
# @remarks ¸±±¾×ÜÂß¼­¼ÆÊ±Æ÷
def OnProcess(tick):
    fbStep = GameWorld.GetGameFB().GetFBStep()
    
    # ¸±±¾×¼±¸
    if fbStep == FB_Step_Prepare:
        __DoLogic_FB_Prepare(tick)    
    # ¸±±¾½øÐÐÖÐ
    elif fbStep == FB_Step_Fighting:
        __DoLogic_FB_Fighting(tick)
    # ¸±±¾½áÊø
    elif fbStep == FB_Step_Over:
        __DoLogic_FB_Over(tick)
    
    return
 
## ¸±±¾×¼±¸Âß¼­
#  @param tick:ʱ¼ä´Á
#  @return ÎÞÒâÒå
def __DoLogic_FB_Prepare(tick):
    #gameFB = GameWorld.GetGameFB()
    fbCfg = GetClearDevilTimeCfg()
    # ¼ä¸ôδµ½
    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_PrepareTime] * 1000:
        return
    
    # ÉèÖÿªÊ¼Ë¢¹Ö
    lineID = FBCommon.GetFBPropertyMark()
    
    npcCfg = GetClearDevilNPCCfg(lineID)
    if not npcCfg:
        GameWorld.Log("ûÓиÃÏß·ˢ¹ÖÅäÖàlineID=%s" % lineID)
        return
    gameFB = GameWorld.GetGameFB()
 
    for npcInfo in npcCfg:
        npcID = npcInfo[DL_NPCID]
        gameFB.SetGameFBDict(FBPlayerDict_NPCRemainCnt % npcID, npcInfo[DL_NeedKillCnt])
        refreshCD = npcInfo[DL_RefreshCD]
        NPCCustomRefresh.SetNPCRefresh(npcInfo[DL_RefreshMark], [(npcID, npcInfo[DL_SingleNPCCnt])], npcInfo[DL_maxCnt], npcInfo[DL_TotalNPCCnt], refreshTick=refreshCD)
    NPCCustomRefresh.ProcessAllNPCRefresh(tick) # Á¢¼´³ö·¢Ò»´Î±êʶµãË¢ÐÂ
    
    playerManager = GameWorld.GetMapCopyPlayerManager()
    if playerManager.GetPlayerCount() > 0:
        curPlayer = playerManager.GetPlayerByIndex(0)
        DoFBHelp(curPlayer, tick)
    
    FBCommon.SetFBStep(FB_Step_Fighting, tick)
    FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttTowerTake, fbCfg[Def_FightTime] * 1000)
    return
 
 
## ¸±±¾½øÐÐÖÐ
#  @param tick:ʱ¼ä´Á
#  @return ÎÞÒâÒå
def __DoLogic_FB_Fighting(tick):
    fbCfg = GetClearDevilTimeCfg()
    # ¼ä¸ôδµ½
    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_FightTime] * 1000:
        return
    
    __DoClearDevilOver(False)
    return
 
        
##¸±±¾¹Ø±ÕÖÐ
# @param tick:ʱ¼ä´Á
# @return ÎÞÒâÒå
# @remarks ¸±±¾¹Ø±ÕÖÐ
def __DoLogic_FB_Over(tick):
 
    #gameFB = GameWorld.GetGameFB()
    fbCfg = GetClearDevilTimeCfg()
    # ¼ä¸ôδµ½
    if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_LeaveTime] * 1000:
        return
    
    #¸±±¾¹Ø±Õ
    GameWorldProcess.CloseFB(tick)
    FBCommon.SetFBStep(FB_Step_Close, tick)
    return
 
## »ñµÃ¾­Ñé
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param addExp »ñµÃµÄ¾­Ñé
#  @param expViewType ¾­ÑéÀàÐÍ
#  @return True or False
def OnGetExp(curPlayer, addExp, expViewType):
    
    if expViewType != ShareDefine.Def_ViewExpType_KillNPC:
        return
    
    playerID = curPlayer.GetID() 
    gameFB = GameWorld.GetGameFB()
    exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
    expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
    totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    updTotalExp = totalExp + addExp
    updExp = updTotalExp % ChConfig.Def_PerPointValue
    updExpPoint = updTotalExp / ChConfig.Def_PerPointValue
    gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_TotalExp, updExp)
    gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_TotalExpPoint, updExpPoint)
    
    
    GameWorld.DebugLog("OnGetExp() totalExp=%s,addExp=%s,updTotalExp=%s" 
                       % (totalExp, addExp, updTotalExp), playerID)
    
    return
 
## Ö´Ðи±±¾É±¹ÖÂß¼­
#  @param curPlayer É±¹ÖµÄÈË
#  @param curNPC ±»É±µÄ¹Ö
#  @param tick µ±Ç°Ê±¼ä
#  @return None
def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
    gameFB = GameWorld.GetGameFB()
    fbStep = gameFB.GetFBStep()
    if fbStep != FB_Step_Fighting:
        return
    
    npcid = curNPC.GetNPCID()
    lineID = FBCommon.GetFBPropertyMark()
    isFinish = False #ÊÇ·ñÍê³É
    
    if GetIsPointFBType(lineID):#»ý·ÖÀà
        addPoint = GetPointByNPCID(npcid)
        if not addPoint:
            return
        totalPoint = gameFB.GetGameFBDictByKey(FBPlayerDict_TotalPoint)
        maxPoint = IpyGameDataPY.GetFuncCfg('ClearDevilPoint')
        updPoint = min(totalPoint + addPoint, maxPoint)
        gameFB.SetGameFBDict(FBPlayerDict_TotalPoint, updPoint)
        
        if updPoint >= maxPoint:
            isFinish = True
    else:
        
        remainCnt = gameFB.GetGameFBDictByKey(FBPlayerDict_NPCRemainCnt % npcid)
        gameFB.SetGameFBDict(FBPlayerDict_NPCRemainCnt % npcid, max(0, remainCnt - 1))
        
        npcCfg = GetClearDevilNPCCfg(lineID)
        if not npcCfg:
            GameWorld.Log("ûÓиÃÏß·ˢ¹ÖÅäÖàlineID=%s" % lineID)
            return
        isFinish = True
        for npcInfo in npcCfg:
            npcID = npcInfo[DL_NPCID]
            remainCnt = gameFB.GetGameFBDictByKey(FBPlayerDict_NPCRemainCnt % npcID)
            if remainCnt:
                isFinish = False
                break
            
    DoFBHelp(curPlayer, tick)
    
    if isFinish:
        __DoClearDevilOver(True)
        # ÈÎÎñ
        fbMissionID = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionID)
        if fbMissionID:
            EventShell.EventRespons_FBEvent(curPlayer, "cleardevil_pass_%s" % fbMissionID)
        
    
    
    return
 
##Íæ¼ÒÍ˳ö¼Ò×å´¦Àí
# @param curPlayer Íæ¼ÒʵÀý
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎÞÒâÒå
def OnLeaveFamily(curPlayer, tick):
    gameFB = GameWorld.GetGameFB()
    fbMissionType = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionType)
    if fbMissionType == QuestCommon.Def_Mission_Type_RunFamily:
        gameFB.SetGameFBDict(FBPlayerDict_MissionType, 0)
    return
 
## ÈÎÎñרÓÃ,´¥·¢Ê¼þ£¨¸±±¾ÄÚÍê³ÉijÈÎÎñ£©
#  @param curPlayer:Íæ¼ÒʵÀý
#  @param isAchieve:ÊÇ·ñÍê³ÉÈÎÎñ
#  @return None
def DoFB_OnFinishRunAroundTask(curPlayer, curMissionID, addExp=0, moneyDict={}, itemList=[]):
    gameFB = GameWorld.GetGameFB()
    #playerID = curPlayer.GetPlayerID()
    #exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
    #expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
    #totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    exp = addExp % ChConfig.Def_PerPointValue
    expPoint = addExp / ChConfig.Def_PerPointValue
    fbMissionID = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionID)
    GameWorld.DebugLog("ÈÎÎñרÓÃ,´¥·¢Ê¼þ£¨¸±±¾ÄÚÍê³ÉijÈÎÎñ£© curMissionID=%s, fbMissionID=%s, exp=%s,moneyDict=%s,itemList=%s" % (curMissionID, fbMissionID, exp, moneyDict,itemList))
    if fbMissionID != curMissionID:
        return
    costTime = gameFB.GetGameFBDictByKey(FBPlayerDict_CostTime)
    awardDict = {}
    awardDict[FBCommon.Over_isPass] = 1
    awardDict[FBCommon.Over_costTime] = costTime
    awardDict[FBCommon.Over_exp] = exp
    awardDict[FBCommon.Over_expPoint] = expPoint
    awardDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(itemList)
    awardDict[FBCommon.Over_money] = FBCommon.GetJsonMoneyList(moneyDict)
    
    __SendOverInfo(curPlayer, awardDict)
    return
 
## ÊÇ·ñ¸±±¾¸´»î
#  @param None
#  @return ÊÇ·ñ¸±±¾¸´»î
def OnPlayerReborn():
    return True
 
##Íæ¼ÒËÀÍö.
# @param curPlayer:ËÀÍöµÄÍæ¼Ò 
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎÞÒâÒå
# @remarks Íæ¼ÒÖ÷¶¯À뿪¸±±¾.
def DoPlayerDead(curPlayer):
    
    return
 
## ¼ì²éÊÇ·ñ¿É¹¥»÷£¬ Ö÷Åж¨²»¿É¹¥»÷µÄÇé¿ö£¬ÆäËûÂß¼­ÓÉÍâ²ã¾ö¶¨
#  @param attacker ¹¥»÷·½
#  @param defender ·ÀÊØ·½
#  @return bool
def CheckCanAttackTagObjInFB(attacker, defender):
    gameFB = GameWorld.GetGameFB()
    if gameFB.GetFBStep() != Def_FightTime:
        return False
    return True
 
## ¸±±¾½áÊø´¦Àí
def __DoClearDevilOver(isPass):
    gameFB = GameWorld.GetGameFB()
    if gameFB.GetFBStep() == FB_Step_Over:
        return
    tick = GameWorld.GetGameWorld().GetTick()
    curPlayer = None
    playerManager = GameWorld.GetMapCopyPlayerManager()
    if playerManager.GetPlayerCount() > 0:
        curPlayer = playerManager.GetPlayerByIndex(0)
        
    if not curPlayer:
        GameWorldProcess.CloseFB(tick)
        return
    lineID = FBCommon.GetFBPropertyMark()
    
    fbCfg = GetClearDevilTimeCfg()
    gameFB = GameWorld.GetGameFB()
    playerID = curPlayer.GetPlayerID()
    exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
    expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
    #totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
    gameFB.SetGameFBDict(FBPlayerDict_CostTime, costTime)
    fbMissionID = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionID)
    fbMissionType = gameFB.GetGameFBDictByKey(FBPlayerDict_MissionType)
    # Í¨Öª½á¹û ´Ë´¦Ö»Í¨ÖªÊ§°Ü£¬³É¹¦ÔÚÍê³ÉÈÎÎñʱ֪ͨ, ²»ÊÇͨ¹ýÈÎÎñ½øµÄ¸±±¾Ò²Í¨Öª
    if not isPass or not fbMissionID or not fbMissionType:
        __SendOverInfo(curPlayer, {FBCommon.Over_isPass:int(isPass), FBCommon.Over_exp:exp,FBCommon.Over_expPoint:expPoint, FBCommon.Over_costTime:costTime})
    
    # ½øÈëÀ뿪½×¶Î
    FBCommon.SetFBStep(FB_Step_Over, tick)
    FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttLeaveMap, fbCfg[Def_LeaveTime] * 1000)
    
    # ¹Ø±ÕË¢¹Ö
    
    npcCfg = GetClearDevilNPCCfg(lineID)
    for npcInfo in npcCfg:
        NPCCustomRefresh.CloseNPCRefresh(npcInfo[DL_RefreshMark], tick)
    return
 
## ·¢ËÍÌôÕ½½á¹ûÐÅÏ¢
def __SendOverInfo(curPlayer, overDict):
    overDict[FBCommon.Over_dataMapID] = FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID())
    overDict[FBCommon.Over_lineID] = FBCommon.GetFBPropertyMark()
    GameWorld.DebugLog("__SendOverInfo overDict=%s" % (str(overDict)), curPlayer.GetPlayerID())
    FBCommon.Notify_FB_Over(curPlayer, overDict)
    return