#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package GameWorldLogic.FBProcess.GameLogic_MirrorBattle # # @todo:¾µÏñPKÇдè # @author hxp # @date 2024-10-17 # @version 1.0 # # ÏêϸÃèÊö: ¾µÏñPKÇдè # #------------------------------------------------------------------------------- #"""Version = 2024-10-17 15:00""" #------------------------------------------------------------------------------- import GameWorld import MirrorAttack import FBCommon import GameObj ## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë def OnEnterFBEvent(curPlayer, mapID, lineID, tick): return True ## ¿Í»§¶Ë½øÈë×Ô¶¨Ò峡¾° def OnEnterCustomScene(curPlayer, mapID, lineID): return ##´¦Àí¸±±¾ÖÐɱËÀÍæ¼ÒÂß¼­ def DoFBOnKill_Player(atkobj, defender, tick): GameWorld.DebugLog("¾µÏñÇдè»÷É±Íæ¼Ò: defID=%s" % (defender.GetID()), atkobj.GetID()) return True def OnMirrorBattleOver(battleID): ## ¾µÏñÕ½¶·½áÊø battle = MirrorAttack.GetMirrorBattleByID(battleID) if not battle: return isLogout = battle.isLogout mapID = battle.mapID funcLineID = battle.funcLineID winFaction = battle.winFaction curPlayerID = battle.requestID # ¸±±¾ËùÊôÍæ¼ÒID£¬¸ÃÍæ¼Ò²»Ò»¶¨²ÎÓëʵ¼ÊÕ½¶· curIsWin = 0 GameWorld.DebugLog("¾µÏñÕ½¶·½áËã: mapID=%s,funcLineID=%s,winFaction=%s,isLogout=%s" % (mapID, funcLineID, winFaction, isLogout), battleID) playerMgr = GameWorld.GetMapCopyPlayerManager() for playerID, faction in battle.playerFactionDict.items(): curPlayer = playerMgr.FindPlayerByID(playerID) if not curPlayer: continue realPlayerID = curPlayer.GetRealPlayerID() isWin = (faction == winFaction) GameWorld.DebugLog("Ê£ÓàѪÁ¿: %s/%s,playerID=%s,realPlayerID=%s,faction=%s,isWin=%s" % (GameObj.GetHP(curPlayer), GameObj.GetMaxHP(curPlayer), playerID, realPlayerID, faction, isWin), battleID) if isWin and faction == 1: curIsWin = 1 if not curPlayerID: return curPlayer = playerMgr.FindPlayerByID(curPlayerID) if not curPlayer: return # ½áËã½±Àø£¬Í¨Öª½á¹û giveItemList = [] overDict = {"isWin":curIsWin, FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)} FBCommon.NotifyFBOver(curPlayer, mapID, funcLineID, isWin, overDict) return