From cc912d58ed06ee42583a997318677bb25148b991 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 11 一月 2020 21:40:20 +0800
Subject: [PATCH] 8346 【恺英】【后端】协助系统(缥缈讨伐妖魔组队副本进入条件改为验证缥缈事件;奖励改为掉落模式)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
index 81478ab..fb0caad 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
@@ -31,6 +31,7 @@
 import FBCommon
 import ChConfig
 import IpyGameDataPY
+import random
 #---------------------------------------------------------------------
 #全局变量
 #---------------------------------------------------------------------
@@ -59,6 +60,7 @@
     tagMapID = packCMDList[0]  # 目标地图id
     tagMapLineID = packCMDList[1]  # 目标地图线路属性,从0开始
     resultLineID = -1  # 结果lineID
+    hpPer = -1
     notifyMark = 'GeRen_chenxin_500807' #不能进的提示
     if tagMapID in ChConfig.Def_MapID_LineIDToPropertyID:        
         GameWorld.Log("    DoLogic() tagMapID in ChConfig.Def_MapID_LineIDToPropertyID")
@@ -70,8 +72,11 @@
         maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID, tagMapLineID)
         
         GameWorld.Log("    DoLogic()  tagMapID=%s,tagMapLineID=%s,maxPlayerCount=%s" % (tagMapID, tagMapLineID,maxPlayerCount))
+        if not maxPlayerCount:
+            pass
         firstEmptyGameWorld = None
-        sameLineGameWorldList = []
+        sameLineGameWorldList = [] #人数未满的线路列表
+        fullLineGameWorldList = [] #人数已满的线路列表
         for index in xrange(gameWorldManager.GetGameWorldCount()):
             gameWorld = IPY_GameWorld.IPY_GameWorld(index)
             playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
@@ -83,14 +88,29 @@
                 firstEmptyGameWorld = gameWorld
             # 如果不是同一线路属性的,则跳过
             # 如果当前人数超过额定人数,则跳过
-            if propertyID == tagMapPropertyID and curPlayerCnt < maxPlayerCount:
-                sameLineGameWorldList.append([gameWorld, curPlayerCnt])
+            if propertyID == tagMapPropertyID:
+                if curPlayerCnt < maxPlayerCount:
+                    sameLineGameWorldList.append([gameWorld, curPlayerCnt])
+                else:
+                    fullLineGameWorldList.append([gameWorld, curPlayerCnt])
         findGameWorld = None
         if sameLineGameWorldList:
-            sameLineGameWorldList.sort(key=lambda asd:asd[1])
-            findGameWorld = sameLineGameWorldList[0][0]
+            #若是进入过副本则随机一个,否则选人数最少的一个
+            enterCnt = packCMDList[2]
+            if enterCnt:
+                #GameWorld.DebugLog('DoLogic() sameLineGameWorldList=%s'%len(sameLineGameWorldList))
+                findGameWorld = random.choice(sameLineGameWorldList)[0]
+            else:
+                sameLineGameWorldList.sort(key=lambda asd:asd[1])
+                findGameWorld = sameLineGameWorldList[0][0]
+                
         elif firstEmptyGameWorld:
             findGameWorld = firstEmptyGameWorld
+        elif fullLineGameWorldList:
+            #线路都满人了则取个人数相对较少的
+            fullLineGameWorldList.sort(key=lambda asd:asd[1])
+            findGameWorld = fullLineGameWorldList[0][0]
+            
         if findGameWorld:
             if findGameWorld.GetPropertyID() == 0:
                 findGameWorld.SetFBFirstOpen(1) # 开启副本
@@ -167,17 +187,10 @@
             # 如果不是同一线路属性的,则跳过
             if propertyID == tagMapPropertyID:
                 if tagMapID == ChConfig.Def_FBMapID_SealDemon:
-                    if GameLogic_SealDemon.GetBossRemainHPPer(index, tagMapLineID, tick) < 15:
-                        findGameWord = None
-                        findPlayerManager = None
-                        notifyMark = "DemonJar_Text4"
-                        break
+                    hpPer = GameLogic_SealDemon.GetBossRemainHPPer(index, tagMapLineID, tick)
+                    
                 elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
-                    if GameLogic_ZhuXianBoss.GetBossRemainHPPer(index, tagMapLineID, tick) < IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 4):
-                        findGameWord = None
-                        findPlayerManager = None
-                        notifyMark = "DemonJar_Text4"
-                        break
+                    hpPer = GameLogic_ZhuXianBoss.GetBossRemainHPPer(index, tagMapLineID, tick)
                     
                 findGameWord = gameWorld
                 findPlayerManager = playerManager
@@ -202,7 +215,7 @@
         #resultLineID = tagMapLineID
         resultLineID = 0
         
-    return ['%s' % packCMDList, '%d' % resultLineID, notifyMark]
+    return ['%s' % packCMDList, '%d' % resultLineID, notifyMark, hpPer]
 #---------------------------------------------------------------------
 
 
@@ -225,9 +238,10 @@
     tagMapInfo = eval(funResult[0])
     backFBID = int(funResult[1]) # 返回的切图线路id(0~N)
     notifyMark = funResult[2]
+    hpPer = funResult[3]
     mapID = tagMapInfo[0] # 请求的切图id
     funcLineID = tagMapInfo[1]   # 请求的场次线路id(0~6)
-    GameWorld.Log("GY_Query_EnterFB DoResult() mapID=%s,funcLineID=%s,backFBID=%s" % (mapID, funcLineID, backFBID), curPlayer.GetPlayerID())
+    GameWorld.Log("GY_Query_EnterFB DoResult() mapID=%s,funcLineID=%s,backFBID=%s,hpPer=%s" % (mapID, funcLineID, backFBID, hpPer), curPlayer.GetPlayerID())
     
     if backFBID == -1: # 未找到可进入的分线,则返回,提示人数已满
         PlayerControl.NotifyCode(curPlayer, notifyMark)
@@ -237,6 +251,18 @@
         #已在该地图就不让进了
         return
     
+    # 非协助玩家进入需要判断boss剩余血量是否允许进入
+    if hpPer >= 0 and not PlayerControl.GetAssistTagPlayerID(curPlayer):
+        minHPPer = 15
+        if mapID == ChConfig.Def_FBMapID_SealDemon:
+            minHPPer = IpyGameDataPY.GetFuncCfg('SealDemonFirstPos', 2)
+        elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
+            minHPPer = IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 4)
+        if hpPer < minHPPer:
+            GameWorld.DebugLog("boss血量少于可进入的最低血量百分比,无法进入!hpPer=%s,minHPPer=%s" % (hpPer, minHPPer))
+            PlayerControl.NotifyCode(curPlayer, "DemonJar_Text4")
+            return
+        
     # 请求进入FB点
     ipyEnterPosInfo = FBCommon.GetFBLineEnterPosInfo(mapID, funcLineID)
     retPos = FBLogic.OnGetFBEnterPos(curPlayer, mapID, funcLineID, ipyEnterPosInfo, tick)

--
Gitblit v1.8.0