From 82ca2dd1656364f93523af726ac81b7823cbc3d2 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期日, 06 十月 2019 21:20:08 +0800 Subject: [PATCH] 8298 【恺英】【开发】基础套装极/仙/神进阶(神、仙、极传奇属性支持) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py index c9c6d2d..faba8bf 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py @@ -198,7 +198,7 @@ gameFB = GameWorld.GetGameFB() fbStep = gameFB.GetFBStep() - if fbStep <= FB_State_Waiting and fbStep >= FB_State_Leave: + if fbStep <= FB_State_Waiting or fbStep >= FB_State_Leave: return leavePlayerID = curPlayer.GetPlayerID() @@ -296,14 +296,21 @@ playerInfoList = [] for playerID in [playerIDA, playerIDB]: player = copyMapPlayerManager.FindPlayerByID(playerID) + # 还是离线时间的,走掉线逻辑,越晚掉线的赢;需要加这个逻辑主要是因为当玩家没有触发完整登录流程导致玩家在线但是没有触发DoEnter + playerLeaveTick = gameFB.GetGameFBDictByKey(GameFBDict_PlayerLeaveTick % playerID) + if playerLeaveTick: + pvpDamage, sortTick, curHP, curMaxHP = 0, 0, 0, 0 + playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerLeaveTick, playerID, player]) + GameWorld.Log("PK超时: playerLeaveTick=%s" % (playerLeaveTick), playerID) + continue pvpDamage = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamage) pvpDamTick = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamUpdTick) sortTick = tick - pvpDamTick curHP = 0 if not player else player.GetHP() curMaxHP = 0 if not player else player.GetMaxHP() - playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerID, player]) - GameWorld.Log("PK超时: pvpDamge=%s,pvpDamTick=%s,tick=%s,sortTick=%s,HP=%s/%s" - % (pvpDamage, pvpDamTick, tick, sortTick, curHP, curMaxHP), playerID) + playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerLeaveTick, playerID, player]) + GameWorld.Log("PK超时: pvpDamge=%s,pvpDamTick=%s,tick=%s,sortTick=%s,HP=%s/%s,playerLeaveTick=%s" + % (pvpDamage, pvpDamTick, tick, sortTick, curHP, curMaxHP, playerLeaveTick), playerID) playerInfoList.sort(reverse=True) GameWorld.Log("PK超时, 进入结算!playerInfoList=%s" % str(playerInfoList)) @@ -317,6 +324,10 @@ for i in xrange(copyMapPlayerManager.GetPlayerCount()): player = copyMapPlayerManager.GetPlayerByIndex(i) if player == None or player.IsEmpty(): + continue + playerID = player.GetPlayerID() + if playerID not in [playerIDA, playerIDB]: + GameWorld.ErrLog("副本中玩家不在进入的玩家ID里,不处理! roomID=%s,playerID=%s" % (roomID, playerID)) continue winner = player winnerID = player.GetPlayerID() @@ -383,6 +394,9 @@ prepareTime = fbTimeList[Def_Time_MapPrepare] * 1000 helpDict["prepareTime"] = prepareTime + roundNum = gameFB.GetGameFBDictByKey(FB_RoundNum) + winnerID = gameFB.GetGameFBDictByKey(FB_RoundWinPlayerID % roundNum) + nextRoundNum = gameFB.GetGameFBDictByKey(FB_RoundNum) + 1 gameFB.SetGameFBDict(FB_RoundNum, nextRoundNum) @@ -399,6 +413,9 @@ GameWorld.DebugLog("复活玩家...", player.GetPlayerID()) ChPlayer.PlayerRebornByType(player, ChConfig.rebornType_System, tick, isAddSuperBuff=False) __ResetPlayerState(gameFB, player, playerID) + elif winnerID and playerID != winnerID: + GameWorld.DebugLog("平局,输的玩家回满血!", playerID) + __ResetPlayerState(gameFB, player, playerID) else: __ResetPlayerState(gameFB, player, playerID, False) @@ -474,6 +491,22 @@ GameWorld.Log("回合结束: roomID=%s,roundNum=%s,winnerID=%s,loserID=%s,updWinCnt=%s" % (roomID, roundNum, winnerID, loserID, updWinCnt)) isOver = (updWinCnt >= IpyGameDataPY.GetFuncCfg("CrossRealmPKFB", 3)) if not isOver: + if winner: + clearDeBuff = False + # 胜利者马上清除负面buff,防止死亡导致回合表现异常,如中毒 + for buffType in [IPY_GameWorld.bfDeBuff, IPY_GameWorld.bfProcessDeBuff, IPY_GameWorld.bfActionBuff]: + buffTuple = SkillCommon.GetBuffManagerByBuffType(winner, buffType) + if buffTuple: + buffState = buffTuple[0] + buffCount = buffState.GetBuffCount() + if buffCount: + clearDeBuff = True + buffState.Clear() + GameWorld.DebugLog("胜者马上清除 buffType=%s,buffCount=%s" % (buffType, buffCount), winner.GetPlayerID()) + + if clearDeBuff: + PlayerControl.PlayerControl(winner).RefreshAllState() + FBCommon.SetFBStep(FB_State_Reborn, tick) return -- Gitblit v1.8.0