From 08e3e6cea67b249564abac36ea1e8aefa17982e4 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 12 三月 2019 16:36:47 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py |   73 ++++++++++++++++++++++--------------
 1 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
index 45f3a77..472774c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
@@ -36,23 +36,24 @@
 FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV'  # 鼓舞等级
 FBDict_IsOver = 'FBDict_IsOver'  #是否已结算, 结算时的tick
 FBDict_IsReduceing = 'FBDict_IsReduceing'  #是否掉血中
-FBPlayerDict_Rank = "FBPlayerDict_Rank"  # 玩家排名
 FBDict_BossTotalHP = 'FBDict_BossTotalHP'  #BOSS血量
 FBDict_LastHurtTick = 'FBDict_LastHurtTick'  #上次伤害时间
 FBDict_IsEncourage = 'FBDict_IsEncourage'  #是否鼓舞过
+FBDict_LastHPNotify = 'FBDict_LastHPNotify'  #上一个血量广播
 
 (
-    Def_BossTime, #BOSS时间
-    Def_LeaveTime,#离开时间
+    Def_BossTime,  #BOSS时间
+    Def_LeaveTime,  #离开时间
     ) = range(2)
 
 #当前副本地图的状态
 (
-FB_Step_Open, # 副本开启
-FB_Step_Fighting, # 副本进行中
-FB_Step_Over, # 副本结束
-FB_Step_Close, # 副本关闭
+FB_Step_Open,  # 副本开启
+FB_Step_Fighting,  # 副本进行中
+FB_Step_Over,  # 副本结束
+FB_Step_Close,  # 副本关闭
 ) = range(4)
+
 
 def OnFBPlayerOnLogin(curPlayer):
 
@@ -189,7 +190,7 @@
     gameWorld.SetGameWorldDict(FBDict_StartTick, 0)
     gameWorld.SetGameWorldDict(FBDict_Speed, 0)
     gameWorld.SetGameWorldDict(FBDict_RemainHP, 0)
-    
+    gameWorld.SetGameWorldDict(FBDict_IsReduceing, 0)
     gameWorld.SetPropertyID(0)
     PyGameData.g_allfamilyBossDict = {}
     return
@@ -279,7 +280,7 @@
     remainHPPer = min(1000000, remainHP * 1000000 / totalHP) if totalHP else 0
     playerID = curPlayer.GetPlayerID()
     IsEncourage = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBDict_IsEncourage)
-    fbHelpDict = {"hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed,'IsEncourage':IsEncourage,
+    fbHelpDict = {"hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'IsEncourage':IsEncourage,
                   'remainHPPer':remainHPPer, 'isReduceing':isReduceing, 'myHurt':myHurt % ChConfig.Def_PerPointValue,
                   'myHurtEx':myHurt / ChConfig.Def_PerPointValue, 'myRank':myRank, 'myMenberCnt':myMenberCnt
                   }
@@ -356,7 +357,6 @@
             GameWorldProcess.CloseFB(tick)
             FBCommon.SetFBStep(FB_Step_Close, tick)
             return
-
     
     elif fbStep == FB_Step_Fighting:
         startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick)
@@ -396,22 +396,22 @@
     
     if isPass:
         worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
-        familyAuctionItemDict = {} #{仙盟ID:[[享受收益的成员ID, ...], [[拍品ID,总个数,拍品组数], ...]], ...}
+        familyAuctionItemDict = {}  #{仙盟ID:[[享受收益的成员ID, ...], [[拍品ID,总个数,拍品组数], ...]], ...}
         batchPlayerIDList, batchAddItemList, batchParamList, batchDetailList = [], [], [], []
-        event=["AllFamilyBoss", False, {}]
+        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)
+            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:#仙盟拍品
+            if memberCnt >= needMemberCnt and familyAuctionItemList:  #仙盟拍品
                 familyAuctionItemDict[familyID] = [memberIDList, familyAuctionItemList]
                 overDict['AuctionItem'] = FBCommon.GetJsonItemList(familyAuctionItemList)
-            if menberItemList: #成员奖励
+            if menberItemList:  #成员奖励
                 overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(menberItemList)
                 
             mailPlayerIDList = []
@@ -433,7 +433,7 @@
         if batchPlayerIDList:
             PlayerControl.SendMailBatch("LeagueBOSS2", batchPlayerIDList, batchAddItemList, batchParamList, batchDetail=batchDetailList)
         if familyAuctionItemDict:
-            GameWorld.Log('familyAuctionItemDict=%s'%familyAuctionItemDict)
+            GameWorld.Log('familyAuctionItemDict=%s' % familyAuctionItemDict)
             PlayerAuctionHouse.DoAddFamilyAuctionItem(familyAuctionItemDict)
     else:
         playerCount = playerManager.GetPlayerCount()
@@ -445,6 +445,7 @@
             FBCommon.NotifyFBOver(member, ChConfig.Def_FBMapID_AllFamilyBoss, lineID, isPass)
   
     return
+
 
 def __GetFamilyBossAward(rank, worldLV):
     familyAuctionItemList, menberItemList = [], []
@@ -460,13 +461,13 @@
             continue
         awardRateList = ipyData.GetAward()
     if not awardRateList:
-        GameWorld.ErrLog('仙盟Boss奖励表 未配置该奖励 rank=%s,worldLV=%s'%(rank, worldLV))
+        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)
+            GameWorld.ErrLog('仙盟Boss奖励表配置错误 itemInfo=%s' % itemInfo)
             continue
         if itemInfo[2]:
             familyAuctionItemList.append(itemInfo)
@@ -480,17 +481,31 @@
     gameFB = GameWorld.GetGameFB()
     isOver = gameFB.GetGameFBDictByKey(FBDict_IsOver)
  
-    if not isOver and GetBossRemainHP(tick) == 0:
-        
-        #结束 设置BOSS死亡
-        FBCommon.ClearFBNPC()
-        FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
-        GameWorld.DebugLog('结束 设置BOSS死亡')
+    if not isOver: 
+        if GetBossRemainHP(tick) == 0:
+            #结束 设置BOSS死亡
+            FBCommon.ClearFBNPC()
+            FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
+            GameWorld.DebugLog('结束 设置BOSS死亡')
+    
+            gameFB.SetGameFBDict(FBDict_IsOver, tick)
+            
+            __DoLogicAllFamilyBossOver(1, tick)
+        else:
+            #血量广播
+            needNotifyHPPerList = [50, 20]
+            lastIndex = gameFB.GetGameFBDictByKey(FBDict_LastHPNotify)
+            if lastIndex >= len(needNotifyHPPerList):
+                return
+            remainPer = GetBossRemainHPPer(tick)
+            notifyHPPer = needNotifyHPPerList[lastIndex]
+            if remainPer == notifyHPPer or remainPer - 1 == notifyHPPer:
+                gameFB.SetGameFBDict(FBDict_LastHPNotify, lastIndex + 1)
+                lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+                bossID = CurFBLineBOSSID(lineID)
+                msgMark = 'AllianceBossHP1' if lineID == 0 else 'AllianceBossHP2'
+                PlayerControl.WorldNotify(0, msgMark, [bossID, remainPer])
 
-        gameFB.SetGameFBDict(FBDict_IsOver, tick)
-        
-        __DoLogicAllFamilyBossOver(1, tick)
-        
     return
 
 
@@ -562,7 +577,7 @@
     lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed) 
     remainHP = gameWorld.GetGameWorldDictByKey(FBDict_RemainHP)
     if not gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing):
-        return remainHP
+        return remainHP if startTick else __GetBossTotalHP()
     if not startTick:
         startTick = tick
         remainHP = __GetBossTotalHP()

--
Gitblit v1.8.0