| #!/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 FBCommon  | 
| import GameWorld  | 
| import IpyGameDataPY  | 
| import IPY_GameWorld  | 
| import GameWorldProcess  | 
| import NPCCustomRefresh  | 
| import ChConfig  | 
| import ShareDefine  | 
| import ItemControler  | 
| import PlayerControl  | 
| import EventShell  | 
| import EventReport  | 
|   | 
|   | 
| #---¸±±¾ÅäÖöÔÓ¦keyÖµ---  | 
| (  | 
| Def_PrepareTime, # ¸±±¾×¼±¸Ê±¼ä(Ãë)  | 
| Def_FightTime, # ½øÐÐʱ¼ä(Ãë)  | 
| Def_LeaveTime, # Í˳öʱ¼ä(Ãë)  | 
| ) = range(3)  | 
|   | 
| (  | 
| 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)  | 
|   | 
| #¸±±¾½øÐеĹؿ¨  | 
| (  | 
| Def_Prepare, # ×¼±¸  | 
| Def_KillBandit, # »÷ɱǿµÁ  | 
| Def_BreakCage, # ÆÆ»µÁý×Ó  | 
| Def_Dialog, # ÓëÓ×Áú¶Ô»°  | 
| Def_EndGuard, # ½áÊø  | 
| ) = range(5)  | 
|   | 
| FBPlayerDict_GameStep = 'FBPlayerDict_GameStep' #¹Ø¿¨  | 
| FBPlayerDict_NPCKillCnt = 'FBPlayerDict_NPCKillCnt'   # NPCÒÑ»÷ɱÊýÁ¿  | 
| FBPlayerDict_NPCNeedKillCnt = 'FBPlayerDict_NPCNeedKillCnt'   # NPCÐèÒª»÷ɱÊýÁ¿  | 
|   | 
| FBPlayerDict_TotalExp = 'FBPlayerDict_TotalExp'   # »ñµÃµÄ×ܾÑé  | 
| FBPlayerDict_TotalExpPoint = 'FBPlayerDict_TotalExpPoint'   # »ñµÃµÄ×ܾÑéµã  | 
|   | 
|   | 
| ##---»ñµÃ¸±±¾ÅäÖÃ---  | 
| #  @param None  | 
| #  @return ÅäÖÃÐÅÏ¢  | 
| def GetGuardTimeCfg():  | 
|     return FBCommon.GetFBLineStepTime(GameWorld.GetMap().GetMapID(), 0)  | 
|   | 
| ##¿ªÆô¸±±¾  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¿ªÆô¸±±¾  | 
| def OnOpenFB(tick):  | 
|     FBCommon.OpenOrCloseDoorEx([IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID', 2)], 0)  | 
|     return  | 
|   | 
| ## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë  | 
| #  @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  | 
|   | 
| def SetMap_Guard_GameStep(gameStep):  | 
|     ## ÉèÖø±±¾²½Öè  | 
|     GameWorld.GetGameFB().SetGameFBDict(FBPlayerDict_GameStep, gameStep)  | 
|       | 
|     return  | 
| ## ½ø¸±±¾  | 
| #  @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()  | 
|      | 
|     GameWorld.DebugLog("DoEnterFB...,playerLV=%s" % (playerLV), playerID)  | 
|     hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)  | 
|     if not hadDelTicket:  | 
|         FBCommon.SetHadDelTicket(curPlayer)  | 
|           | 
|         # ÐÂÊÖ¾çÇ鸱±¾ÖØÖÃËùÓм¼ÄÜCD  | 
|         skillManager = curPlayer.GetSkillManager()  | 
|         for i in range(0, skillManager.GetSkillCount()):  | 
|             curSkill = skillManager.GetSkillByIndex(i)  | 
|             if curSkill.GetRemainTime() != 0:  | 
|                 curSkill.SetRemainTime(0)  | 
|                 curSkill.Sync_Skill()  | 
|         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_Guard, 0, ChConfig.CME_Log_Start)  | 
|         GameWorld.DebugLog("´Ë¸±±¾¸Õ½øÈëʱ²»Ö±½Ó¿ªÊ¼£¬ÐèµÈǰ¶Ë֪ͨ¿ªÊ¼²Å¿ªÊ¼!", playerID) # µôÏßÖØÉÏÇ¿ÖÆ¿ªÊ¼      | 
|         return  | 
|   | 
|     fbStep = gameFB.GetFBStep()  | 
|     if fbStep < FB_Step_Prepare:  | 
|         FBCommon.SetFBStep(FB_Step_Prepare, tick)  | 
|           | 
|     if fbStep <= FB_Step_Prepare:  | 
|         notify_tick = GetGuardTimeCfg()[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())  | 
|         curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)  | 
|           | 
|     elif fbStep == FB_Step_Fighting:  | 
|         notify_tick = GetGuardTimeCfg()[Def_FightTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())  | 
|         curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)  | 
|       | 
|     DoFBHelp(curPlayer, tick)  | 
|     return  | 
|   | 
| ## ¿Í»§¶Ë·¢ËÍ¿ªÊ¼¸±±¾  | 
| def OnClientStartFB(curPlayer, tick):  | 
|     gameFB = GameWorld.GetGameFB()  | 
|     fbStep = gameFB.GetFBStep()  | 
|     if fbStep >= FB_Step_Prepare:  | 
|         GameWorld.ErrLog("ǰ¶ËÇëÇóÕýʽ¿ªÊ¼¸±±¾, µ«¸±±¾ÒѾ¿ªÊ¼ÁË£¬²»¿ÉÖØ¸´¿ªÊ¼!", curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     GameWorld.DebugLog("ǰ¶Ë³¡¾°ÐãÒѲ¥·ÅÍê±Ï£¬ÇëÇóÕýʽ¿ªÊ¼¸±±¾!", curPlayer.GetPlayerID())  | 
|     FBCommon.SetFBStep(FB_Step_Prepare, tick)  | 
|     notify_tick = GetGuardTimeCfg()[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())  | 
|     curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)  | 
|     DoFBHelp(curPlayer, tick)  | 
|     return  | 
|   | 
| ##Íæ¼ÒÍ˳ö¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ÎÞÒâÒå  | 
| def DoExitFB(curPlayer, tick):  | 
|     step = GameWorld.GetGameFB().GetGameFBDictByKey(FBPlayerDict_GameStep)  | 
|     if step == Def_EndGuard:  | 
|         itemID, giveExp = FBCommon.GetFBLineReward(GameWorld.GetMap().GetMapID(), 0)  | 
|         if itemID:  | 
|             ItemControler.GivePlayerItem(curPlayer, itemID, 1, 1, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True, showSysInfo=True)  | 
|       | 
|     # ÐÂÊÖ±¾Íæ¼ÒÍ˳öĬÈϹرո±±¾  | 
|     GameWorldProcess.CloseFB(tick)  | 
|     return  | 
|   | 
| ##Íæ¼ÒÖ÷¶¯À뿪¸±±¾.  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| def DoPlayerLeaveFB(curPlayer, tick):  | 
|     return  | 
|   | 
| ## »ñµÃ¸±±¾°ïÖúÐÅÏ¢  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò£¨±»Í¨Öª¶ÔÏó£©  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| def DoFBHelp(curPlayer, tick):  | 
|     gameFB = GameWorld.GetGameFB()  | 
|       | 
|     step = gameFB.GetGameFBDictByKey(FBPlayerDict_GameStep)  | 
|     helpDict = {FBCommon.Help_step:step, FBCommon.Help_npcTotal:gameFB.GetGameFBDictByKey(FBPlayerDict_NPCKillCnt)}  | 
|     cageNPCID = IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID')  | 
|     helpDict[FBCommon.Help_npc] = FBCommon.GetJsonNPCKillList({cageNPCID:int(step>Def_BreakCage)})  | 
|     helpDict["talkOver"] = int(step>Def_Dialog)  | 
|     #¸±±¾°ïÖú  | 
|     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 = GetGuardTimeCfg()  | 
|     # ¼ä¸ôδµ½  | 
|     if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_PrepareTime] * 1000:  | 
|         return  | 
|     FBCommon.OpenOrCloseDoorEx([IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID', 2)], 1)  | 
|     # ÉèÖÿªÊ¼Ë¢¹Ö  | 
|     mapID = GameWorld.GetMap().GetMapID()  | 
|     gameFB = GameWorld.GetGameFB()  | 
|     cageNPCID = IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID')  | 
|     refreshIDList = FBCommon.GetFBLineRefreshNPC(mapID)  | 
|     needKillCnt = 0  | 
|     for refreshID in refreshIDList:  | 
|         npcCountList = NPCCustomRefresh.GetNPCRefreshCountList(refreshID)  | 
|         if not npcCountList:  | 
|             continue  | 
|         for npcID, count in npcCountList:  | 
|             if npcID == cageNPCID:  | 
|                 continue  | 
|             needKillCnt += count  | 
|       | 
|     gameFB.SetGameFBDict(FBPlayerDict_NPCNeedKillCnt, needKillCnt)  | 
|       | 
|     for refreshID in refreshIDList:  | 
|         NPCCustomRefresh.SetNPCRefreshByID(refreshID)  | 
|       | 
|     SetMap_Guard_GameStep(Def_KillBandit)  | 
|     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 = GetGuardTimeCfg()  | 
|     # ¼ä¸ôδµ½  | 
|     if tick - GameWorld.GetGameFB().GetFBStepTick() < fbCfg[Def_FightTime] * 1000:  | 
|         return  | 
|       | 
|     __DoGuardOver(False)  | 
|     return  | 
|   | 
|           | 
| ##¸±±¾¹Ø±ÕÖÐ  | 
| # @param tick:ʱ¼ä´Á  | 
| # @return ÎÞÒâÒå  | 
| # @remarks ¸±±¾¹Ø±ÕÖÐ  | 
| def __DoLogic_FB_Over(tick):  | 
|   | 
|     #gameFB = GameWorld.GetGameFB()  | 
|     fbCfg = GetGuardTimeCfg()  | 
|     # ¼ä¸ôδµ½  | 
|     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  | 
|     cageNPCID = IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID')  | 
|     npcid = curNPC.GetNPCID()  | 
|     if not npcid:  | 
|         return  | 
|     if npcid == cageNPCID:  | 
|         #Áý×Ó´òµôÁË´¥·¢ÈÎÎñ¿É¶Ô»°  | 
|         EventShell.EventRespons_FBEvent(curPlayer, "guardfbtalk")  | 
|         SetMap_Guard_GameStep(Def_Dialog)  | 
|     else:  | 
|         killCnt = gameFB.GetGameFBDictByKey(FBPlayerDict_NPCKillCnt)  | 
|         gameFB.SetGameFBDict(FBPlayerDict_NPCKillCnt, killCnt+1)  | 
|         if killCnt+1 >= gameFB.GetGameFBDictByKey(FBPlayerDict_NPCNeedKillCnt):  | 
|             SetMap_Guard_GameStep(Def_BreakCage)  | 
|          | 
|     DoFBHelp(curPlayer, tick)  | 
|     return  | 
|   | 
|   | 
| ## ¼ì²éÊÇ·ñ¿É¹¥»÷£¬ Ö÷Åж¨²»¿É¹¥»÷µÄÇé¿ö£¬ÆäËûÂß¼ÓÉÍâ²ã¾ö¶¨  | 
| #  @param attacker ¹¥»÷·½  | 
| #  @param defender ·ÀÊØ·½  | 
| #  @return bool  | 
| def CheckCanAttackTagObjInFB(attacker, defender):  | 
|     gameFB = GameWorld.GetGameFB()  | 
|     if gameFB.GetFBStep() != FB_Step_Fighting:  | 
|         return False  | 
|   | 
|     gameFB = GameWorld.GetGameFB()  | 
|     cageNPCID = IpyGameDataPY.GetFuncCfg('GuardFBCageNPCID')  | 
|     step = gameFB.GetGameFBDictByKey(FBPlayerDict_GameStep)  | 
|     if step != Def_BreakCage:  | 
|         defenderObjType = defender.GetGameObjType()  | 
|         # ¹¥»÷Áý×Ó  | 
|         if defenderObjType == IPY_GameWorld.gotNPC and defender.GetNPCID() == cageNPCID:  | 
|             return False  | 
|       | 
|     return True  | 
|   | 
| ## ÈÎÎñרÓÃ,´¥·¢Ê¼þ£¨¸±±¾ÄÚÍê³ÉijÈÎÎñ£©  | 
| #  @param curPlayer:Íæ¼ÒʵÀý  | 
| #  @param isAchieve:ÊÇ·ñÍê³ÉÈÎÎñ  | 
| #  @return None  | 
| def DoFB_OnAchieveTask(curPlayer, isAchieve):  | 
|     if GameWorld.GetGameFB().GetGameFBDictByKey(FBPlayerDict_GameStep) != Def_Dialog:  | 
|         return  | 
|     SetMap_Guard_GameStep(Def_EndGuard)  | 
|     DoFBHelp(curPlayer, 0)  | 
|     __DoGuardOver(True)  | 
|     return  | 
|   | 
| ## ÊÇ·ñ¸±±¾¸´»î  | 
| #  @param None  | 
| #  @return ÊÇ·ñ¸±±¾¸´»î  | 
| def OnPlayerReborn():  | 
|     return True  | 
|   | 
| ##Íæ¼ÒËÀÍö.  | 
| # @param curPlayer:ËÀÍöµÄÍæ¼Ò   | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks Íæ¼ÒÖ÷¶¯À뿪¸±±¾.  | 
| def DoPlayerDead(curPlayer):  | 
|     __DoGuardOver(False)  | 
|     return  | 
|   | 
| ## ¸±±¾½áÊø´¦Àí  | 
| def __DoGuardOver(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  | 
|       | 
|     fbCfg = GetGuardTimeCfg()  | 
|     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()  | 
|     giveExp = 0  | 
|     overDict = {FBCommon.Over_isPass:int(isPass), FBCommon.Over_costTime:costTime}  | 
|     if isPass:  | 
|         itemID, giveExp = FBCommon.GetFBLineReward(GameWorld.GetMap().GetMapID(), 0)  | 
|         #ÎïÆ·¸ÄÔÚÍ˳ö¸±±¾Ê±¸ø  | 
|         #ItemControler.GivePlayerItem(curPlayer, itemID, 1, 1, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True, showSysInfo=True)  | 
|         if giveExp:  | 
|             PlayerControl.PlayerControl(curPlayer).AddExp(giveExp)  | 
|             overDict[FBCommon.Over_exp] = giveExp  | 
|         if itemID:  | 
|             overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList([itemID])  | 
|           | 
|           | 
|     # Í¨Öª½á¹û  | 
|     __SendOverInfo(curPlayer, overDict)  | 
|       | 
|     # ½øÈëÀ뿪½×¶Î  | 
|     FBCommon.SetFBStep(FB_Step_Over, tick)  | 
|     FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttLeaveMap, fbCfg[Def_LeaveTime] * 1000)  | 
|       | 
|     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  |