xdh
2019-01-22 ccaefa2a93fb82d0db5fc7e74832a292fb860984
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py
@@ -27,16 +27,10 @@
import ItemCommon
import ChPyNetSendPack
import ShareDefine
import EventShell
import NPCCustomRefresh
import PlayerSuccess
import PlayerActivity
import NetPackCommon
import ItemControler
import PlayerMagicWeapon
import PlayerBossReborn
import PlayerFairyCeremony
import PlayerWeekParty
import EventReport
FBDict_StartTick = 'FBDict_StartTick%s' #开始时间
@@ -48,7 +42,7 @@
FBPlayerDict_Rank = "FBPlayerDict_Rank" # 玩家排名
FBDict_BossTotalHP = 'FBDict_BossTotalHP%s' #BOSS血量
g_npcHurtDict = {}
g_heroHurtDict = {} #{playerID:hurt}
def OnFBPlayerOnLogin(curPlayer):
@@ -151,9 +145,9 @@
#  @param tick
#  @return None
def DoEnterFB(curPlayer, tick):
    global g_heroHurtDict
    playerID = curPlayer.GetPlayerID()
    mapID = GameWorld.GetMap().GetMapID()
    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1    
    
    playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
@@ -166,6 +160,7 @@
    if not hadDelTicket:
        FBCommon.SetHadDelTicket(curPlayer)
        PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
        g_heroHurtDict.pop(playerID, 0)
#        if playerCnt == 1:
#            posX, posY = IpyGameDataPY.GetFuncEvalCfg('ZhuXianBossFirstPos')
#            GameWorld.ResetPlayerPos(curPlayer, posX, posY)
@@ -204,7 +199,6 @@
# @param tick 时间戳
# @return 无意义
def DoExitFB(curPlayer, tick):
    global g_npcHurtDict
    gameWorld = GameWorld.GetGameWorld()
    # 清除鼓舞buff
    FBCommon.ClearEncourageBuff(curPlayer, tick)
@@ -212,7 +206,6 @@
    if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
        lineID = gameWorld.GetPropertyID() - 1
        PyGameData.g_ZhuXianBossPlayerHurtDict[lineID] = {}
        g_npcHurtDict[lineID] = {}
        gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
        GameWorld.GetGameFB().ClearGameFBDict()
        GameWorldProcess.CloseFB(tick)
@@ -255,12 +248,13 @@
#  @return None
def DoFBHelp(curPlayer, tick):
    #伤害排行信息
    if GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_IsOver):
        return
    hurtInfo = []
    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
    playerHurtList = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {}).items()
    npcHurtList = g_npcHurtDict.get(lineID, {}).items()
    syncHurtList = (playerHurtList + npcHurtList)[:5]
    syncHurtList = playerHurtList[:5]
    syncHurtList.sort(key=lambda asd:asd[1][1], reverse=True)
        
    for i, info in enumerate(syncHurtList, 1):
@@ -271,16 +265,16 @@
        hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
        hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
        hurtInfo.append(hurtDict)
    myRank = __GetSelfHurtRank(curPlayer)
    if myRank and myRank > 5:
        hurtDict = {}
        hurtDict["rank"] = myRank
        info = playerHurtList[myRank - 1]
        playerName, hurt = info[1][:2]
        hurtDict["playerName"] = playerName
        hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
        hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
        hurtInfo.append(hurtDict)
#    myRank = __GetSelfHurtRank(curPlayer)
#    if myRank and myRank > 5:
#        hurtDict = {}
#        hurtDict["rank"] = myRank
#        info = playerHurtList[myRank - 1]
#        playerName, hurt = info[1][:2]
#        hurtDict["playerName"] = playerName
#        hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
#        hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
#        hurtInfo.append(hurtDict)
    
    curSpeed = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_Speed % lineID) 
    isReduceing = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_IsReduceing % lineID) 
@@ -288,7 +282,11 @@
    totalHP = __GetBossTotalHP(lineID)
    hpReduceSpeed = curSpeed * 10000 / totalHP if totalHP else 0
    remainHPPer = min(100, remainHP * 100 / totalHP) if totalHP else 0
    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'remainHPPer':remainHPPer, 'isReduceing':isReduceing}
    myHurt = g_heroHurtDict.get(curPlayer.GetID(), 0)
    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed,
                  'remainHPPer':remainHPPer, 'isReduceing':isReduceing,'myHurt':myHurt % ChConfig.Def_PerPointValue,
                  'myHurtEx':myHurt / ChConfig.Def_PerPointValue
                  }
    GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
    FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
    return
@@ -328,6 +326,10 @@
    return
#
def UpdateHurtInfo(curPlayer, hurtHP, isAdd=False):
    global g_heroHurtDict
    playerID = curPlayer.GetPlayerID()
    g_heroHurtDict[playerID] = g_heroHurtDict.get(playerID, 0) + hurtHP
    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianBoss)
    if enterCnt >= FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_ZhuXianBoss):
        #没归属的不进伤害榜
@@ -335,7 +337,7 @@
    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
    
    playerName = curPlayer.GetName() 
    playerID = curPlayer.GetPlayerID()
    familyID = curPlayer.GetFamilyID()
    playerHurtDict = PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {})
    if playerID not in playerHurtDict:
@@ -361,14 +363,13 @@
        GameWorld.Log("强制踢出玩家关闭副本: overTick=%s,tick=%s" % (overTick, tick))
        FBCommon.DoLogic_FBKickAllPlayer()
        return
    mapID = GameWorld.GetMap().GetMapID()
    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
    if lineID <0:
        return
    gameWorld = GameWorld.GetGameWorld()
    startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
    if not startTick:
    if not startTick or overTick:
        return
    FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
    __CheckBossHP(tick)
@@ -405,7 +406,7 @@
    playerManager = GameWorld.GetMapCopyPlayerManager()#GameWorld.GetPlayerManager()
    firstPlayer = playerManager.FindPlayerByID(firstPlayerID)
    if firstPlayer:
        #gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_Rank, rank)
        gameFB.SetPlayerGameFBDict(firstPlayerID, FBPlayerDict_Rank, 1)
        if not dropPosX or not dropPosY:
            dropPosX, dropPosY = firstPlayer.GetPosX(), firstPlayer.GetPosY()
        prizeItemList = GiveZhuXianBossAward(firstPlayer, lineID, dropItemMapInfo=[dropPosX, dropPosY, True])
@@ -548,7 +549,7 @@
            dropPosX, dropPosY = curBoss.GetPosX(), curBoss.GetPosY()
        
        #结束 设置BOSS死亡
        FBCommon.ClearFBNPC()
        FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
        GameWorld.DebugLog('结束 设置BOSS死亡 lineID=%s' % lineID)
        playerHurtList = __GetSortHurtList(lineID)