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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldLogic.FBProcess.GameLogic_Guard
#
# @todo:ÊØ»¤¸±±¾
# @author xdh
# @date 2017-12-22
# @version 1.0
#
# ÏêϸÃèÊö: ÊØ»¤¸±±¾
#
#-------------------------------------------------------------------------------
#"""Version = 2017-12-22 14:00"""
#-------------------------------------------------------------------------------
import ChConfig
import FBCommon
import GameWorld
import IPY_GameWorld
import ItemControler
import PlayerControl
import EventShell
 
 
 
## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë
#  @param curPlayer Íæ¼ÒʵÀý
#  @param mapID µØÍ¼ID
#  @param lineID Ïß·id
#  @param tick Ê±¼ä´Á
#  @return ²¼¶ûÖµ
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    hasEnter = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    if hasEnter:
        GameWorld.DebugLog("    ÒѽøÈë¹ý¸±±¾%s" % lineID)
        return False
    return True
 
 
def OnClientEndFB(curPlayer, mapID, lineID, dataList):
    #¿Í»§¶Ë¸±±¾·¢ËͽáÊø
    if PlayerControl.GetCustomMapID(curPlayer) != mapID:
        return
    hasEnter = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False,
                                           [mapID])
    if hasEnter:
        return
    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, 1, False, [mapID])
    itemID, giveExp = FBCommon.GetFBLineReward(mapID, 0)
    overDict = {}
    ItemControler.GivePlayerItemOrMail(curPlayer, [[itemID, 1, 0]])
    if giveExp:
        PlayerControl.PlayerControl(curPlayer).AddExp(giveExp)
        overDict[FBCommon.Over_exp] = giveExp
    if itemID:
        overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList([itemID])
 
    FBCommon.NotifyFBOver(curPlayer,mapID,lineID,1,overDict)
    EventShell.EventRespons_FBEvent(curPlayer, "guardfbpass")
    PlayerControl.SetCustomMap(curPlayer, 0, 0)
    return