| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package GameWorldLogic.FBProcess.GameLogic_AllFamilyBoss  | 
| #  | 
| # @todo:¶àÏÉÃËBOSS  | 
| # @author xdh  | 
| # @date 2019-01-18  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ¶àÏÉÃËBOSS  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2019-01-18 14:30"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
| import FBCommon  | 
| import GameWorld  | 
| import IPY_GameWorld  | 
| import GameWorldProcess  | 
| import IpyGameDataPY  | 
| import ChConfig  | 
| import PyGameData  | 
| import PlayerControl  | 
| import ShareDefine  | 
| import NPCCustomRefresh  | 
| import PlayerAuctionHouse  | 
| import ItemControler  | 
| import PlayerActivity  | 
| import EventReport  | 
| import GameObj  | 
|   | 
| FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV'  # ¹ÄÎèµÈ¼¶  | 
| FBDict_IsOver = 'FBDict_IsOver'  #ÊÇ·ñÒѽáËã, ½áËãʱµÄtick  | 
| FBDict_IsEncourage = 'FBDict_IsEncourage'  #ÊÇ·ñ¹ÄÎè¹ý  | 
|   | 
|   | 
| (  | 
|     Def_BossTime,  #BOSSʱ¼ä  | 
|     Def_LeaveTime,  #À뿪ʱ¼ä  | 
|     Def_HPSpeed,  #µôѪËٶȹ«Ê½  | 
|     ) = range(3)  | 
|   | 
| #µ±Ç°¸±±¾µØÍ¼µÄ״̬  | 
| (  | 
| FB_Step_Open,  # ¸±±¾¿ªÆô  | 
| FB_Step_Fighting,  # ¸±±¾½øÐÐÖÐ  | 
| FB_Step_Over,  # ¸±±¾½áÊø  | 
| FB_Step_Close,  # ¸±±¾¹Ø±Õ  | 
| ) = range(4)  | 
|   | 
|   | 
| def OnFBPlayerOnLogin(curPlayer):  | 
|   | 
|     return  | 
|   | 
|   | 
| def OnFBPlayerOnDay(curPlayer):  | 
|       | 
|     return  | 
|   | 
|   | 
| ## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param mapID µØÍ¼ID  | 
| #  @param lineID Ïß·id  | 
| #  @param tick Ê±¼ä´Á  | 
| #  @return ²¼¶ûÖµ  | 
| def OnEnterFBEvent(curPlayer, mapID, lineID, tick):  | 
|     if not curPlayer.GetFamilyID():  | 
|         GameWorld.DebugLog("OnEnterFBEvent not family!")  | 
|         return False  | 
|     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 tick Ê±¼ä´Á  | 
| ##  @return ²¼¶ûÖµ  | 
| def OnCanOpen(tick):  | 
|     return  | 
|   | 
|   | 
| ##²éѯÊÇ·ñ¿ÉÒÔ½øÈëµØÍ¼  | 
| # @param ask:ÇëÇó½á¹¹Ìå(IPY_BMChangeMapAsk)  | 
| # @param tick:ʱ¼ä´Á  | 
| # @return IPY_GameWorld.cme Ã¶¾Ù  | 
| def OnChangeMapAsk(ask, tick):  | 
|     return IPY_GameWorld.cmeAccept  | 
|   | 
|   | 
| ##¿ªÆô¸±±¾  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¿ªÆô¸±±¾  | 
| def OnOpenFB(tick):  | 
|     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1  | 
|     bossID = CurFBLineBOSSID(lineID)  | 
|     if not bossID:  | 
|         return  | 
|     NPCCustomRefresh.SetNPCRefresh(101, [bossID])  | 
|     return  | 
|   | 
|   | 
| def OnAllFamilyBossStateChange(state, tick):  | 
|     #»î¶¯×´Ì¬±ä¸ü  | 
|     mapID = GameWorld.GetMap().GetMapID()  | 
|     if mapID != ChConfig.Def_FBMapID_AllFamilyBoss:  | 
|         return  | 
|     GameWorld.DebugLog('    ¶àÏÉÃËBOSS»î¶¯×´Ì¬±ä¸ü state=%s' % state)  | 
|   | 
|     if not state:  | 
|         if not GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_IsOver):  | 
|             GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)  | 
|             __DoLogicAllFamilyBossOver(0, tick)  | 
|     return  | 
|   | 
|   | 
| ## ½ø¸±±¾  | 
| #  @param curPlayer  | 
| #  @param tick  | 
| #  @return None  | 
| def DoEnterFB(curPlayer, tick):  | 
|     playerID = curPlayer.GetPlayerID()  | 
|   | 
|     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1      | 
|       | 
|     playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()  | 
|     GameWorld.DebugLog("DoEnterFB...playerCnt=%s,lineID=%s" % (playerCnt, lineID), playerID)  | 
|     familyID = curPlayer.GetFamilyID()  | 
|     fbStep = GameWorld.GetGameFB().GetFBStep()  | 
|     hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)  | 
|     if not hadDelTicket:  | 
|         FBCommon.SetHadDelTicket(curPlayer)  | 
|         FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_AllFamilyBoss, 1)  | 
|           | 
|         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyBoss1, 1)  | 
|           | 
|         if fbStep == FB_Step_Open:  | 
|             FBCommon.SetFBStep(FB_Step_Fighting, tick)  | 
|   | 
|         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_AllFamilyBoss, 0, ChConfig.CME_Log_Start)  | 
|     if fbStep >= FB_Step_Over:  | 
|         PlayerControl.PlayerLeaveFB(curPlayer)  | 
|         return  | 
|   | 
|     if familyID not in PyGameData.g_allfamilyBossDict:  | 
|         PyGameData.g_allfamilyBossDict[familyID] = [curPlayer.GetFamilyName(), 0, [playerID]]  | 
|     elif playerID not in PyGameData.g_allfamilyBossDict[familyID][2]:  | 
|         PyGameData.g_allfamilyBossDict[familyID][2].append(playerID)  | 
|       | 
|     gameFB = GameWorld.GetGameFB()  | 
|     # ÉϹÄÎèbuff  | 
|     encourageLV = gameFB.GetPlayerGameFBDictByKey(familyID, FBPlayerDict_EncourageLV)  | 
|     if encourageLV > 0:  | 
|         FBCommon.AddFbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, tick, familyID)  | 
|     else:  | 
|         FBCommon.SendFBEncourageInfo(curPlayer, encourageLV, familyID)  | 
|           | 
|     DoFBHelp(curPlayer, tick)  | 
|     return  | 
|   | 
|   | 
| ##¹Ø±Õ¸±±¾  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ÎÞÒâÒå  | 
| # @remarks   | 
| def OnCloseFB(tick):  | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|   | 
|     gameWorld.SetPropertyID(0)  | 
|     PyGameData.g_allfamilyBossDict = {}  | 
|     return  | 
|   | 
|   | 
| ##Íæ¼ÒÍ˳ö¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ÎÞÒâÒå  | 
| def DoExitFB(curPlayer, tick):  | 
|     # Çå³ý¹ÄÎèbuff  | 
|     FBCommon.ClearEncourageBuff(curPlayer, tick)  | 
| #    #×îºóÒ»ÈË  | 
| #    if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:  | 
| #        lineID = gameWorld.GetPropertyID() - 1  | 
| #        PyGameData.g_AllFamilyBossPlayerHurtDict[lineID] = {}  | 
| #        gameWorld.SetGameWorldDict(FBDict_StartTick, 0)  | 
| #        GameWorld.GetGameFB().ClearGameFBDict()  | 
| #        GameWorldProcess.CloseFB(tick)  | 
| #        return  | 
|           | 
|     return  | 
|   | 
|   | 
| ##Íæ¼ÒÖ÷¶¯À뿪¸±±¾.  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| def DoPlayerLeaveFB(curPlayer, tick):  | 
| #    FBCommon.SetHadDelTicket(curPlayer, 0)  | 
|     #Ö÷¶¯Í˳öµÄÈ¥µôÅÅÐаñÐÅÏ¢  | 
|     familyHurtInfo = PyGameData.g_allfamilyBossDict.get(curPlayer.GetFamilyID(), [])  | 
|     if familyHurtInfo:  | 
|         playerID = curPlayer.GetPlayerID()  | 
|         if playerID in familyHurtInfo[2]:  | 
|             familyHurtInfo[2].remove(playerID)  | 
|             FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)  | 
|     return  | 
|   | 
|   | 
| ## ÊÇ·ñ¸±±¾¸´»î  | 
| #  @param None  | 
| #  @return ÊÇ·ñ¸±±¾¸´»î  | 
| def OnPlayerReborn():  | 
|     return True  | 
|   | 
|   | 
| ## »ñµÃ¸±±¾°ïÖúÐÅÏ¢  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò£¨±»Í¨Öª¶ÔÏó£©  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| def DoFBHelp(curPlayer, tick):  | 
|     #É˺¦ÅÅÐÐÐÅÏ¢  | 
|     if GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_IsOver):  | 
|         return  | 
|     hurtInfo = []  | 
|     familyHurtList = __GetSortHurtList()  | 
|     myFamilyID = curPlayer.GetFamilyID()  | 
|     myRank, myHurt, myMenberCnt = 0, 0, 0  | 
|     for i, info in enumerate(familyHurtList, 1):  | 
|         familyID = info[0]  | 
|         name, hurt, menberList = info[1][:3]  | 
|         if myFamilyID == familyID:  | 
|             myRank, myHurt, myMenberCnt = i, hurt, len(menberList)  | 
|         if i <= 3:  | 
|             hurtDict = {}  | 
|             hurtDict["rank"] = i  | 
|             hurtDict["playerName"] = name  | 
|             hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue  | 
|             hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue  | 
|             hurtInfo.append(hurtDict)  | 
|     remainHPPer = GetBossRemainHPPer(0, tick)  | 
|     playerID = curPlayer.GetPlayerID()  | 
|     IsEncourage = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBDict_IsEncourage)  | 
|     fbHelpDict = {"hurtInfo":hurtInfo, 'IsEncourage':IsEncourage,'remainHPPer':remainHPPer,  | 
|                   'myHurt':myHurt % ChConfig.Def_PerPointValue,  | 
|                   'myHurtEx':myHurt / ChConfig.Def_PerPointValue, 'myRank':myRank, 'myMenberCnt':myMenberCnt  | 
|                   }  | 
|     GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, playerID)  | 
|     FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)  | 
|     return  | 
|   | 
|   | 
| ## ¸±±¾ÐÐΪ  | 
| #  @param curPlayer Íæ¼Ò  | 
| #  @param actionType ÐÐΪÀàÐÍ  | 
| #  @param actionInfo ÐÐΪÐÅÏ¢  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| def DoFBAction(curPlayer, actionType, actionInfo, tick):  | 
|     if actionType == 0:  | 
|         playerID = curPlayer.GetID()  | 
|         gameFB = GameWorld.GetGameFB()  | 
|         if gameFB.GetPlayerGameFBDictByKey(playerID, FBDict_IsEncourage):  | 
|             GameWorld.DebugLog('Ö»ÄܹÄÎèÒ»´Î£¡', playerID)  | 
|             return  | 
|         if FBCommon.FbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, actionInfo, tick, curPlayer.GetFamilyID()):  | 
|             gameFB.SetPlayerGameFBDict(playerID, FBDict_IsEncourage, 1)  | 
|             #¸ø¹ÄÎè½±Àø  | 
|             itemList = IpyGameDataPY.GetFuncEvalCfg('LeagueBOSSReward1')  | 
|             giveItemList = [[itemID, itemCnt, 0] for itemID, itemCnt in itemList]  | 
|             ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)  | 
|     return  | 
|   | 
|   | 
| ## Íæ¼Ò¶ÔNPCÔì³ÉÉ˺¦  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param curNPC   | 
| #  @param hurtHP   | 
| #  @return None  | 
| def DoFB_Player_HurtNPC(curPlayer, curNPC, hurtHP):  | 
|     UpdateHurtInfo(curPlayer, hurtHP)  | 
|     return  | 
|   | 
|   | 
| #  | 
| def UpdateHurtInfo(curPlayer, hurtHP, isAdd=False):  | 
|     familyID = curPlayer.GetFamilyID()  | 
|     if familyID not in PyGameData.g_allfamilyBossDict:  | 
|         GameWorld.DebugLog('PyGameData.g_allfamilyBossDict Ã»ÓиüÒ×壡£¡')  | 
|         return  | 
|   | 
|     PyGameData.g_allfamilyBossDict[familyID][1] += hurtHP  | 
|           | 
|     return  | 
|   | 
|   | 
| ##---¸±±¾×ÜÂß¼¼ÆÊ±Æ÷---  | 
| # @param tick:ʱ¼ä´Á  | 
| # @return ÎÞÒâÒå  | 
| # @remarks ¸±±¾×ÜÂß¼¼ÆÊ±Æ÷  | 
| def OnProcess(tick):  | 
|     gameFB = GameWorld.GetGameFB()  | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|     overTick = gameFB.GetGameFBDictByKey(FBDict_IsOver)  | 
|     fbStep = gameFB.GetFBStep()  | 
|     lineID = gameWorld.GetPropertyID() - 1  | 
|     if lineID < 0:  | 
|         return  | 
|     if fbStep == FB_Step_Over:  | 
|         mapID = GameWorld.GetMap().GetMapID()  | 
|         leaveTick = FBCommon.GetFBLineStepTime(mapID, lineID)[Def_LeaveTime] * 1000  | 
|         if tick - GameWorld.GetGameFB().GetFBStepTick() > leaveTick:  | 
|             GameWorld.Log("Ç¿ÖÆÌß³öÍæ¼Ò¹Ø±Õ¸±±¾: overTick=%s,tick=%s" % (overTick, tick))  | 
|             gameWorld.SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_FBCanEnter % ChConfig.Def_FBMapID_AllFamilyBoss, 0)  | 
|             GameWorldProcess.CloseFB(tick)  | 
|             FBCommon.SetFBStep(FB_Step_Close, tick)  | 
|             return  | 
|       | 
|     elif fbStep == FB_Step_Fighting:  | 
|         if overTick:  | 
|             return  | 
|                   | 
|         FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)  | 
|           | 
|     return  | 
|   | 
|   | 
| def __GetSortHurtList():  | 
|     playerHurtList = sorted(PyGameData.g_allfamilyBossDict.iteritems(), key=lambda asd:asd[1][1], reverse=True)  | 
|     return playerHurtList  | 
|   | 
|   | 
| def __DoLogicAllFamilyBossOver(isPass, tick):  | 
|     #½áËã  | 
|     FBCommon.SetFBStep(FB_Step_Over, tick)  | 
|     msgStr = str([])  | 
|     GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'AllFamilyBossOver', msgStr, len(msgStr))  | 
|       | 
|     mapID = GameWorld.GetMap().GetMapID()  | 
|     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1  | 
|     leaveTick = FBCommon.GetFBLineStepTime(mapID, lineID)[Def_LeaveTime] * 1000  | 
|     playerHurtList = __GetSortHurtList()  | 
|     if not playerHurtList:  | 
|         GameWorld.Log(' __DoLogicAllFamilyBossOver£¬ É˺¦°ñÉÏûÓÐÈË£¡£¡lineID=%s')  | 
|         return  | 
|       | 
|     playerManager = GameWorld.GetMapCopyPlayerManager()  | 
|       | 
|     if isPass:  | 
|         worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)  | 
|         familyAuctionItemDict = {}  #{ÏÉÃËID:[[ÏíÊÜÊÕÒæµÄ³ÉÔ±ID, ...], [[ÅÄÆ·ID,×ܸöÊý,ÅÄÆ·×éÊý], ...]], ...}  | 
|         batchPlayerIDList, batchAddItemList, batchParamList, batchDetailList = [], [], [], []  | 
|         event = ["AllFamilyBoss", False, {}]  | 
|         needMemberCnt = IpyGameDataPY.GetFuncCfg('LeagueBOSSNumber1')  | 
|         for rank, hurtInfo in enumerate(playerHurtList, 1):  | 
|             familyID = hurtInfo[0]  | 
|             memberIDList = hurtInfo[1][2]  | 
|             memberCnt = len(memberIDList)  | 
|             familyAuctionItemList, menberItemList = __GetFamilyBossAward(rank, worldLV)  | 
|             GameWorld.Log('rank=%s,worldLV=%s,familyAuctionItemList=%s,menberItemList=%s,memberCnt=%s' % (rank, worldLV, familyAuctionItemList, menberItemList, memberCnt), familyID)  | 
|               | 
|             overDict = {FBCommon.Over_rank:rank, 'memberCnt':len(memberIDList)}  | 
|             if memberCnt >= needMemberCnt and familyAuctionItemList:  #ÏÉÃËÅÄÆ·  | 
|                 familyAuctionItemDict[familyID] = [memberIDList, familyAuctionItemList]  | 
|                 overDict['AuctionItem'] = FBCommon.GetJsonItemList(familyAuctionItemList)  | 
|             if menberItemList:  #³ÉÔ±½±Àø  | 
|                 overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(menberItemList)  | 
|                   | 
|             mailPlayerIDList = []  | 
|             for memberID in memberIDList:  | 
|                 member = playerManager.FindPlayerByID(memberID)  | 
|                 if member:  | 
|                     if menberItemList:  | 
|                         ItemControler.GivePlayerItemOrMail(member, menberItemList, 'LeagueBOSS1', event)  | 
|                     member.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)  | 
|                     FBCommon.NotifyFBOver(member, ChConfig.Def_FBMapID_AllFamilyBoss, lineID, isPass, overDict)  | 
|                 elif menberItemList:  | 
|                     mailPlayerIDList.append(memberID)  | 
|             if mailPlayerIDList:  | 
|                 batchPlayerIDList.append(mailPlayerIDList)  | 
|                 batchAddItemList.append(menberItemList)  | 
|                 batchParamList.append([])  | 
|                 batchDetailList.append({'rank':rank})  | 
|     | 
|         if batchPlayerIDList:  | 
|             PlayerControl.SendMailBatch("LeagueBOSS2", batchPlayerIDList, batchAddItemList, batchParamList, batchDetail=batchDetailList)  | 
|         if familyAuctionItemDict:  | 
|             GameWorld.Log('familyAuctionItemDict=%s' % familyAuctionItemDict)  | 
|             PlayerAuctionHouse.DoAddFamilyAuctionItem(familyAuctionItemDict)  | 
|     else:  | 
|         playerCount = playerManager.GetPlayerCount()  | 
|         for index in xrange(playerCount):  | 
|             curPlayer = playerManager.GetPlayerByIndex(index)  | 
|             if not curPlayer:  | 
|                 continue  | 
|             curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)  | 
|             FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_AllFamilyBoss, lineID, isPass)  | 
|     | 
|     return  | 
|   | 
|   | 
| def __GetFamilyBossAward(rank, worldLV):  | 
|     familyAuctionItemList, menberItemList = [], []  | 
|     awardRateList = []  | 
|     awardPieRateDict = {}  | 
|     ipyMgr = IpyGameDataPY.IPY_Data()  | 
|     for i in xrange(ipyMgr.GetFamilyBossAwardCount()):  | 
|         ipyData = ipyMgr.GetFamilyBossAwardByIndex(i)  | 
|         worldLVList = ipyData.GetWorldLV()  | 
|         if worldLV < worldLVList[0] or worldLV > worldLVList[1]:  | 
|             continue  | 
|         rankList = ipyData.GetRank()  | 
|         if rank < rankList[0] or rank > rankList[1]:  | 
|             continue  | 
|         awardRateList = ipyData.GetAward1()  | 
|         awardPieRateDict = ipyData.GetAward2()  | 
|     if not awardRateList and not awardPieRateDict:  | 
|         GameWorld.ErrLog('ÏÉÃËBoss½±Àø±í Î´ÅäÖøý±Àø rank=%s,worldLV=%s' % (rank, worldLV))  | 
|         return familyAuctionItemList, menberItemList  | 
|     for rate, itemInfo in awardRateList:  | 
|         if not GameWorld.CanHappen(rate, 10000):  | 
|             continue  | 
|         if len(itemInfo) != 3:  | 
|             GameWorld.ErrLog('ÏÉÃËBoss½±Àø±íÅäÖôíÎó itemInfo=%s' % itemInfo)  | 
|             continue  | 
|         if itemInfo[2]:  | 
|             familyAuctionItemList.append(itemInfo)  | 
|         else:  | 
|             menberItemList.append(itemInfo)  | 
|     for doCnt, awardPieRateList in awardPieRateDict.items():  | 
|         for _ in xrange(doCnt):  | 
|             resultItem = GameWorld.GetResultByRandomList(awardPieRateList)  | 
|             if len(resultItem) != 3:  | 
|                 GameWorld.ErrLog('ÏÉÃËBoss½±Àø±íÅäÖôíÎó itemInfo=%s' % resultItem)  | 
|                 continue  | 
|             if resultItem[2]:  | 
|                 familyAuctionItemList.append(resultItem)  | 
|             else:  | 
|                 menberItemList.append(resultItem)  | 
|       | 
|     return familyAuctionItemList, menberItemList  | 
|   | 
|   | 
| def DoFB_Npc_KillNPC(attacker, curNPC, tick):  | 
|     __FBNPCOnKilled(curNPC, tick)  | 
|     return  | 
| def DoFB_Player_KillNPC(curPlayer, curNPC, tick):  | 
|     __FBNPCOnKilled(curNPC, tick)  | 
|     return  | 
|   | 
| ## Ö´Ðи±±¾É±¹ÖÂß¼  | 
| def __FBNPCOnKilled(curNPC, tick):  | 
|     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1  | 
|     bossID = CurFBLineBOSSID(lineID)  | 
|     if curNPC.GetNPCID() != bossID:  | 
|         return  | 
|     FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)  | 
|     GameWorld.DebugLog('½áÊø ÉèÖÃBOSSËÀÍö')  | 
|   | 
|     GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)  | 
|       | 
|     __DoLogicAllFamilyBossOver(1, tick)  | 
|     return  | 
|   | 
|   | 
|   | 
| def GetBossRemainHPPer(copyMapID, tick):  | 
|     bossID = CurFBLineBOSSID()  | 
|     curBoss = GameWorld.FindNPCByNPCIDEx(copyMapID, bossID)  | 
|     if not curBoss:  | 
|         return 100  | 
|     return GameObj.GetHP(curBoss) * 100 / GameObj.GetMaxHP(curBoss)  | 
|   | 
|   | 
| def CurFBLineBOSSID(lineID=-1):  | 
|     #¸Ã·ÖÏßË¢µÄBOSSID  | 
|     if lineID == -1:  | 
|         lineID = GameWorld.GetGameWorld().GetPropertyID() - 1  | 
|     refreshNPCInfo = FBCommon.GetFBLineRefreshNPC(ChConfig.Def_FBMapID_AllFamilyBoss, lineID)  | 
|     if not refreshNPCInfo:  | 
|         return 0  | 
|     bossID = int(refreshNPCInfo)  | 
|     return bossID  | 
|   | 
|   | 
| ##Íæ¼ÒËÀÍö.  | 
| # @param curPlayer:ËÀÍöµÄÍæ¼Ò   | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks Íæ¼ÒÖ÷¶¯À뿪¸±±¾.  | 
| def DoPlayerDead(curPlayer):  | 
|     return  | 
|   | 
|   | 
| ## ¼ì²éÊÇ·ñ¿É¹¥»÷£¬ Ö÷Åж¨²»¿É¹¥»÷µÄÇé¿ö£¬ÆäËûÂß¼ÓÉÍâ²ã¾ö¶¨  | 
| #  @param attacker ¹¥»÷·½  | 
| #  @param defender ·ÀÊØ·½  | 
| #  @return bool  | 
| def CheckCanAttackTagObjInFB(attacker, defender):  | 
|    | 
|     return True  | 
|   | 
|   | 
| ##´¦Àí¸±±¾ÖÐɱËÀÍæ¼ÒÂß¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param defender ·ÀÊØÕß  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ²¼¶ûÖµ  | 
| # @remarks ´¦Àí¸±±¾ÖÐɱËÀÍæ¼ÒÂß¼  | 
| def DoFBOnKill_Player(atkobj, defender, tick):  | 
|     return True  |