From ed212e33cd50eca6ff3b7d5f4cac7de975a1e0b7 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 17 七月 2019 15:20:59 +0800
Subject: [PATCH] 8017 【开发】【主干】玩家退出副本或自定义场景时,如果非死亡状态则血量恢复满血状态
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 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 89a7e9c..b59703e 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
@@ -30,6 +30,8 @@
import GameWorld
import FBCommon
import ChConfig
+import IpyGameDataPY
+import random
#---------------------------------------------------------------------
#全局变量
#---------------------------------------------------------------------
@@ -69,8 +71,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)
@@ -82,14 +87,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) # 开启副本
@@ -172,7 +192,7 @@
notifyMark = "DemonJar_Text4"
break
elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss:
- if GameLogic_ZhuXianBoss.GetBossRemainHPPer(index, tagMapLineID, tick) < 15:
+ if GameLogic_ZhuXianBoss.GetBossRemainHPPer(index, tagMapLineID, tick) < IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 4):
findGameWord = None
findPlayerManager = None
notifyMark = "DemonJar_Text4"
--
Gitblit v1.8.0