From 586febfe813233aa833385095d2ac003ee6818dc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 23 五月 2022 17:00:15 +0800
Subject: [PATCH] 9415 【BT】【后端】古神战场(战场帮助信息同步优化;个人buff支持触碰采集;去除复活后无法出战宠物多余提示)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py | 19 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py | 242 ++++++++++++++++++++++++++++++---------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 17 +-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py | 11 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/CrossBattle.py | 10
6 files changed, 227 insertions(+), 76 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/CrossBattle.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/CrossBattle.py
index cf66546..294314a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/CrossBattle.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/CrossBattle.py
@@ -54,7 +54,7 @@
battleObj = GameLogic_CrossBattlefield.GetBattlePlayerObj(tagPlayerID)
battleObj.addPlayerScore(curPlayer, setScore - battleObj.score)
GameWorld.DebugAnswer(curPlayer, "玩家(%s)积分: %s" % (tagPlayerID, battleObj.score))
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, GameLogic_CrossBattlefield.DoFBHelp, 0, GameLogic_CrossBattlefield.refreshCrossBattlefield) # 触发刷新FBHelp
+ GameLogic_CrossBattlefield.NotifyBattlefieldHelp()
return
# 设置玩家击杀
@@ -64,7 +64,7 @@
battleObj = GameLogic_CrossBattlefield.GetBattlePlayerObj(tagPlayerID)
battleObj.addKillCount(setCount - battleObj.killCount)
GameWorld.DebugAnswer(curPlayer, "玩家(%s)击杀数: %s, 连杀数: %s" % (tagPlayerID, battleObj.killCount, battleObj.continueKillCount))
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, GameLogic_CrossBattlefield.DoFBHelp, 0, GameLogic_CrossBattlefield.refreshCrossBattlefield) # 触发刷新FBHelp
+ GameLogic_CrossBattlefield.NotifyBattlefieldHelp()
return
# 设置玩家贡献度
@@ -74,7 +74,7 @@
battleObj = GameLogic_CrossBattlefield.GetBattlePlayerObj(tagPlayerID)
battleObj.addSuperItemContribution(setProgress - battleObj.superItemContribution)
GameWorld.DebugAnswer(curPlayer, "玩家(%s)贡献度: %s" % (tagPlayerID, battleObj.superItemContribution))
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, GameLogic_CrossBattlefield.DoFBHelp, 0, GameLogic_CrossBattlefield.refreshCrossBattlefield) # 触发刷新FBHelp
+ GameLogic_CrossBattlefield.NotifyBattlefieldHelp()
return
# 设置阵营积分
@@ -87,7 +87,7 @@
factionObj = GameLogic_CrossBattlefield.GetBattleFactionObj(tagFaction)
factionObj.addFactionScore(setScore - factionObj.score)
GameWorld.DebugAnswer(curPlayer, "阵营(%s)积分: %s" % (tagFaction, factionObj.score))
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, GameLogic_CrossBattlefield.DoFBHelp, 0, GameLogic_CrossBattlefield.refreshCrossBattlefield) # 触发刷新FBHelp
+ GameLogic_CrossBattlefield.NotifyBattlefieldHelp()
return
# 重置大奖信息
@@ -95,7 +95,7 @@
worldObj = GameLogic_CrossBattlefield.GetBattleWorld()
worldObj.RandSuperTask()
GameWorld.DebugAnswer(curPlayer, "重新随机大奖OK! %s" % worldObj.superItemInfo)
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, GameLogic_CrossBattlefield.DoFBHelp, 0, GameLogic_CrossBattlefield.refreshCrossBattlefield) # 触发刷新FBHelp
+ GameLogic_CrossBattlefield.NotifyBattlefieldHelp(True)
return
# 复活阵营守卫
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
index c668d83..6951c7d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -971,6 +971,14 @@
callFunc(curPlayer, curNPC)
return
+## 退出采集
+def OnExitCollect(curPlayer, curNPC):
+ do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
+ callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnExitCollect"))
+ if callFunc:
+ callFunc(curPlayer, curNPC)
+ return
+
## 收集中(家族战副本中的棋和塔)
# @param curPlayer 当前玩家
# @param tick 当前时间
@@ -1475,6 +1483,17 @@
return callFunc(curNPC)
+def OnRandomRobotJob(curNPC, lineRobotJobDict):
+ ## 随机机器人职业
+ do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
+
+ callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnRandomRobotJob"))
+
+ if callFunc == None:
+ return
+
+ return callFunc(curNPC, lineRobotJobDict)
+
#---------------------------------------------------------------------
## 杀怪奖励是否给最后一个补刀的玩家
# @param 无
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
index 6f5553c..4c756f4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -109,24 +109,34 @@
self.RandSuperTask()
self.__randEventList()
+
+ self.crystalAtkedDict = {} # 被攻击中的水晶 {npcID:被攻击计数, ...}
+ self.worldHelpDict = {} # 未通知的世界变更信息
return
- def getWorldHelpInfo(self, tick):
+ def getWorldAllHelpInfo(self, tick):
worldInfo = {"superItemInfo":self.superItemInfo, "crystalFactionInfo":self.crystalFactionInfo,
- "factionBuffNPCInfo":self.factionBuffNPCInfo, "eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos}
- if self.eventEndTick:
- worldInfo["eventEndTick"] = max(0, self.eventEndTick - tick) # 事件结束剩余时间,单位毫秒
- if self.eventNPCHP:
- worldInfo["eventNPCHP"] = self.eventNPCHP
- crystalAtkedList = []
- for npcID in GetCrystalNPCIDList():
- curNPC = GameWorld.FindNPCByNPCID(npcID)
- if not curNPC:
- continue
- if curNPC.GetPlayerHurtList().GetHurtCount() > 0:
- crystalAtkedList.append(npcID)
- worldInfo["crystalAtkedList"] = crystalAtkedList
- return {"worldInfo":worldInfo}
+ "factionBuffNPCInfo":self.factionBuffNPCInfo, "crystalAtkedList":self.crystalAtkedDict.keys()}
+ worldInfo.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
+ "eventEndTick":max(0, self.eventEndTick - tick), "eventNPCHP":self.eventNPCHP})
+ return worldInfo
+
+ def updEventNPCHelp(self, tick):
+ self.worldHelpDict.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
+ "eventEndTick":max(0, self.eventEndTick - tick), "eventNPCHP":self.eventNPCHP})
+ return
+
+ def updCrystalAtkedHelp(self, npcID, atkValue):
+ crystalAtkedList = self.crystalAtkedDict.keys()
+
+ self.crystalAtkedDict[npcID] = self.crystalAtkedDict.get(npcID, 0) + atkValue
+ if self.crystalAtkedDict[npcID] <= 0:
+ self.crystalAtkedDict.pop(npcID)
+
+ if self.crystalAtkedDict.keys() == crystalAtkedList:
+ return
+ self.worldHelpDict["crystalAtkedList"] = self.crystalAtkedDict.keys()
+ return True
def RandSuperTask(self):
# 随机生成大奖任务
@@ -182,7 +192,7 @@
self.eventNPCHP = 0
self.eventEndTick = 0
self.lastEventEndTick = tick # 上个事件结束tick
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ self.updEventNPCHelp(tick)
return
@@ -215,22 +225,24 @@
self.superItemPlayerName = "" # 阵营大奖中奖者玩家名
self.robotObjIDList = [] # 本阵营当前机器人实例ID列表
+
+ self.factionHelpDict = {} # 未通知的阵营变更信息
return
- def getFactionHelpInfo(self):
+ def getFactionAllHelpInfo(self):
if self.factionBuffInfo and time.time() >= self.factionBuffInfo[1]:
self.factionBuffInfo = []
factionInfo = {"faction":self.faction, "score":self.score, "superItemPlayerName":self.superItemPlayerName,
"superItemProgress":self.superItemProgress, "factionBuffInfo":self.factionBuffInfo}
- if self.hurtBossValue:
- factionInfo["hurtBossValue"] = self.hurtBossValue
- return {"factionInfo_%s" % self.faction:factionInfo}
+ factionInfo["hurtBossValue"] = self.hurtBossValue
+ return factionInfo
def addSuperItemProgress(self, addProgress):
if self.superItemPlayerID:
# 阵营大奖已开奖,不再增加阵营大奖进度,但是依然会增加个人大奖贡献
return
self.superItemProgress = max(0, self.superItemProgress + addProgress)
+ self.factionHelpDict["superItemProgress"] = self.superItemProgress
GameWorld.DebugLog(" 增加阵营大奖进度: faction=%s,addProgress=%s,superItemProgress=%s"
% (self.faction, addProgress, self.superItemProgress), self.fbPropertyID)
@@ -255,15 +267,16 @@
battleObj = GetBattlePlayerObj(superItemPlayerID)
self.superItemPlayerID = superItemPlayerID
self.superItemPlayerName = battleObj.name
+ self.factionHelpDict["superItemPlayerName"] = self.superItemPlayerName
battleObj.superItemContribution = 0 # 重置贡献
+ battleObj.playerHelpDict["superItemContribution"] = battleObj.superItemContribution
battleObj.superItemAwardCnt += 1
itemID, itemCount = worldObj.superItemInfo[0], worldObj.superItemInfo[1]
GameWorld.Log("阵营大奖开奖: faction=%s,weightList=%s,superItemPlayerID=%s,itemID=%s,itemCount=%s"
% (self.faction, weightList, superItemPlayerID, itemID, itemCount), self.fbPropertyID)
PlayerControl.FBNotify("CrossBattlefieldSuperItemPlayer", [battleObj.faction, battleObj.name, itemID, itemCount])
- tick = GameWorld.GetGameWorld().GetTick()
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp()
return
def __checkPerScoreAddSuperItemProgress(self, befScore):
@@ -290,6 +303,7 @@
return
befScore = self.score
self.score = max(0, self.score + addValue)
+ self.factionHelpDict["score"] = self.score
calcTime = 3471264000 #GameWorld.ChangeTimeStrToNum("2080-01-01 00:00:00")
self.scoreSortTime = max(0, calcTime - int(time.time()))
GameWorld.DebugLog(" 增加阵营积分: faction=%s,addValue=%s,updScore=%s" % (self.faction, addValue, self.score), self.fbPropertyID)
@@ -380,6 +394,8 @@
self.crystalCollCnt = 0 # 采集水晶资源次数
self.wallCollCnt = 0 # 采集积分墙次数
self.superItemContribution = 0 # 大奖进度贡献值,也是大奖获奖权重
+
+ self.playerHelpDict = {} # 未通知的玩家变更信息
return
def getFactionObj(self):
@@ -387,12 +403,10 @@
self.factionObj = GetBattleFactionObj(self.faction)
return self.factionObj
- def getPlayerHelpInfo(self, exInfo=None):
+ def getPlayerAllHelpInfo(self):
helpInfo = {"score":self.score, "superItemContribution":self.superItemContribution, "itemRebornCount":self.itemRebornCount,
"killCount":self.killCount, "continueKillCount":self.continueKillCount}
- if exInfo:
- helpInfo.update(exInfo)
- return {"playerInfo":helpInfo}
+ return helpInfo
def addPlayerScore(self, curPlayer, addValue, scoreType=ScoreType_Default, scoreTimes=1, isCheckVictory=True):
addValue *= scoreTimes
@@ -406,9 +420,8 @@
if scoreType == ScoreType_Aura and addValue > 0:
self.auraScore += addValue
- if curPlayer:
- FBCommon.Notify_FBHelp(curPlayer, self.getPlayerHelpInfo({"addScore":[addValue, scoreType, scoreTimes]}))
-
+ self.playerHelpDict.update({"score":self.score, "addScore":[addValue, scoreType, scoreTimes]})
+
superScorePer = IpyGameDataPY.GetFuncCfg("CrossBattlefieldAwardSuper2", 1)
if superScorePer:
befTimes = befScore / superScorePer
@@ -431,6 +444,7 @@
befContKillCount = self.continueKillCount
self.killCount = max(0, self.killCount + addCount)
self.continueKillCount = max(0, self.continueKillCount + addCount) # 同步增加连杀
+ self.playerHelpDict.update({"killCount":self.killCount, "continueKillCount":self.continueKillCount})
superContKillPer = IpyGameDataPY.GetFuncCfg("CrossBattlefieldAwardSuper2", 2)
if superContKillPer:
@@ -454,6 +468,7 @@
def addSuperItemContribution(self, addProgress):
self.superItemContribution = max(0, self.superItemContribution + addProgress)
+ self.playerHelpDict["superItemContribution"] = self.superItemContribution
GameWorld.DebugLog(" 更新玩家大奖贡献: playerID=%s,addProgress=%s,superItemContribution=%s" % (self.playerID, addProgress, self.superItemContribution), self.playerID)
factionObj = self.getFactionObj()
if factionObj:
@@ -621,26 +636,88 @@
curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
+ NotifyBattlefieldHelp(True, curPlayer)
+ return
+
+def NotifyBattlefieldHelp(isAllInfo=False, curPlayer=None, helpEx=None):
+ ## 广播战场帮助信息,针对所有玩家
+ gameWorld = GameWorld.GetGameWorld()
+ lineID = gameWorld.GetLineID()
+
+ worldInfoKey = "worldInfo"
+ factionInfoKey = "factionInfo_%s"
+ playerInfoKey = "playerInfo"
+
+ worldObj = GetBattleWorld()
+
+ helpDict = {}
+ factionObjList = []
+
+ # 通知完整内容
+ if isAllInfo:
+ tick = GameWorld.GetGameWorld().GetTick()
+ helpDict[worldInfoKey] = worldObj.getWorldAllHelpInfo(tick)
+ for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
+ factionObj = GetBattleFactionObj(faction)
+ helpDict[factionInfoKey % faction] = factionObj.getFactionAllHelpInfo()
+ helpDict[FBCommon.Help_robotJob] = PyGameData.g_fbRobotJobDict.get(lineID, {})
+
+ # 通知未通知内容
+ else:
+ if worldObj.worldHelpDict:
+ helpDict[worldInfoKey] = worldObj.worldHelpDict
+
+ for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
+ factionObj = GetBattleFactionObj(faction)
+ if factionObj.factionHelpDict:
+ factionObj.factionHelpDict["faction"] = faction
+ helpDict[factionInfoKey % faction] = factionObj.factionHelpDict
+ factionObjList.append(factionObj)
+
+ if helpEx:
+ helpDict.update(helpEx)
+
+ if curPlayer:
+ playerID = curPlayer.GetPlayerID()
+ battleObj = GetBattlePlayerObj(playerID)
+ if isAllInfo:
+ helpDict[playerInfoKey] = battleObj.getPlayerAllHelpInfo()
+ elif battleObj.playerHelpDict:
+ helpDict[playerInfoKey] = battleObj.playerHelpDict
+ if helpDict:
+ FBCommon.Notify_FBHelp(curPlayer, helpDict)
+ battleObj.playerHelpDict = {}
+ else:
+ playerManager = GameWorld.GetMapCopyPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ player = playerManager.GetPlayerByIndex(index)
+ if not player:
+ continue
+ helpDict.pop(playerInfoKey, None)
+ playerID = player.GetPlayerID()
+ battleObj = GetBattlePlayerObj(playerID)
+ if isAllInfo:
+ helpDict[playerInfoKey] = battleObj.getPlayerAllHelpInfo()
+ elif battleObj.playerHelpDict:
+ helpDict[playerInfoKey] = battleObj.playerHelpDict
+ if helpDict:
+ FBCommon.Notify_FBHelp(player, helpDict)
+ battleObj.playerHelpDict = {}
+
+ # 重置未通知的
+ if not curPlayer:
+ worldObj.worldHelpDict = {}
+ for factionObj in factionObjList:
+ factionObj.factionHelpDict = {}
+ return
+
+def OnRandomRobotJob(curNPC, lineRobotJobDict):
+ ## 随机机器人职业
+ NotifyBattlefieldHelp(helpEx={FBCommon.Help_robotJob:lineRobotJobDict})
return
##获得副本帮助信息, 用于通知阵营比分条
def DoFBHelp(curPlayer, tick):
- gameWorld = GameWorld.GetGameWorld()
- playerID = curPlayer.GetPlayerID()
- lineID = gameWorld.GetLineID()
-
- worldObj = GetBattleWorld()
- battleObj = GetBattlePlayerObj(playerID)
-
- helpDict = {}
- helpDict.update(battleObj.getPlayerHelpInfo())
- helpDict.update(worldObj.getWorldHelpInfo(tick))
- for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
- factionObj = GetBattleFactionObj(faction)
- helpDict.update(factionObj.getFactionHelpInfo())
- helpDict[FBCommon.Help_robotJob] = PyGameData.g_fbRobotJobDict.get(lineID, {})
- #GameWorld.DebugLog("DoFBHelp %s" % helpDict, playerID)
- FBCommon.Notify_FBHelp(curPlayer, helpDict)
return
##玩家退出副本
@@ -761,7 +838,7 @@
continue
allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp(True)
PlayerControl.FBNotify("CrossBattlefieldStartFighting")
return
@@ -849,12 +926,15 @@
if rebornType == ChConfig.rebornType_UseItem:
battleObj.itemRebornCount += 1
+ battleObj.playerHelpDict["itemRebornCount"] = battleObj.itemRebornCount
GameWorld.DebugLog("更新使用道具复活次数! itemRebornCount=%s, 且不中断连杀=%s"
% (battleObj.itemRebornCount, battleObj.continueKillCount), playerID)
else:
GameWorld.DebugLog("非原地复活,中断连杀! %s" % battleObj.continueKillCount, playerID)
battleObj.continueKillCount = 0 # 非原地复活的中断连杀数
+ battleObj.playerHelpDict["continueKillCount"] = battleObj.continueKillCount
+ NotifyBattlefieldHelp(False, curPlayer)
return
def OnPlayerReborn():
@@ -928,7 +1008,13 @@
__RefreshPersonBuff(tick, passSeconds)
__RefreshFactionBuff(tick, passSeconds)
__RefreshBattlefieldEvent(tick, passSeconds)
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, FightRefreshInterval, refreshCrossBattlefield)
+
+ gameFB = GameWorld.GetGameFB()
+ lastTick = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NotifyFBHelpTick)
+ if tick - lastTick >= FightRefreshInterval:
+ gameFB.SetGameFBDict(ChConfig.Def_FB_NotifyFBHelpTick, tick)
+ refreshCrossBattlefield(tick)
+ NotifyBattlefieldHelp()
return
jFactionObj = GetBattleFactionObj(ShareDefine.CampType_Justice)
@@ -1065,10 +1151,11 @@
return
worldObj.factionBuffNPCInfo = [randBuffNPCID, posX, posY]
+ worldObj.worldHelpDict["factionBuffNPCInfo"] = worldObj.factionBuffNPCInfo
GameWorld.DebugLog("刷新阵营buff: randBuffNPCID=%s,nearFaction=%s,nearFactionWeightList=%s"
% (randBuffNPCID, nearFaction, nearFactionWeightList), fbPropertyID)
PlayerControl.FBNotify("CrossBattlefieldBuff_%s" % randBuffNPCID, [randBuffNPCID])
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp()
return
def __GetRandPos(posList):
@@ -1109,6 +1196,7 @@
NPCCommon.SetDeadEx(auraNPC)
worldObj.setEventEnd(tick)
+ NotifyBattlefieldHelp()
return
@@ -1209,7 +1297,8 @@
wallScore = IpyGameDataPY.GetFuncCfg("CrossBattlefieldScoreWall", 3)
PlayerControl.FBNotify("CrossBattlefieldEventWall", [npcID, wallScore, worldObj.eventNPCHP])
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ worldObj.updEventNPCHelp(tick)
+ NotifyBattlefieldHelp()
return
@@ -1236,6 +1325,7 @@
#GameWorld.DebugLog("积分光环给玩家加积分: addValue=%s,auraScoreRange=%s" % (addValue, auraScoreRange), playerID)
battleObj = GetBattlePlayerObj(playerID)
battleObj.addPlayerScore(curPlayer, addValue, ScoreType_Aura)
+ NotifyBattlefieldHelp(False, curPlayer)
return
def __DoLogic_FB_Leave(tick):
@@ -1361,6 +1451,9 @@
#factionScore += ... # 其他加分
atkFactionObj.addFactionScore(factionScore)
+
+ if atkObjType == IPY_GameWorld.gotPlayer:
+ NotifyBattlefieldHelp(False, atkObj) # 击杀的暂只实时通知自己
return
def DoFB_NPCDead(curNPC):
@@ -1520,7 +1613,7 @@
GameWorld.Log("跨服战场结算! zoneID=%s,funcLineID=%s,winnerFaction=%s" % (zoneID, funcLineID, winnerFaction), fbPropertyID)
refreshCrossBattlefield(tick, False) # 结算前强刷一次
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
+ NotifyBattlefieldHelp(True)
#awardOnlineTimes = IpyGameDataPY.GetFuncCfg("CrossBattlefieldAward", 1) # 结算奖励需参与活动时长,秒钟
winnerOrderAwardDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldAward", 2, {})
@@ -1689,13 +1782,36 @@
## 开始采集
def OnBeginCollect(curPlayer, curNPC):
- tick = GameWorld.GetGameWorld().GetTick()
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ npcID = curNPC.GetNPCID()
+ if npcID in GetCrystalNPCIDList():
+ worldObj = GetBattleWorld()
+ if worldObj.updCrystalAtkedHelp(npcID, 1):
+ NotifyBattlefieldHelp()
+ return
+
+## 退出采集
+def OnExitCollect(curPlayer, curNPC):
+ if not curNPC or not hasattr(curNPC, "GetNPCID"):
+ return
+ npcID = curNPC.GetNPCID()
+ if npcID in GetCrystalNPCIDList():
+ worldObj = GetBattleWorld()
+ if worldObj.updCrystalAtkedHelp(npcID, -1):
+ NotifyBattlefieldHelp()
+ return
+
+def OnMoveTouchNPC(curPlayer, curNPC, tick):
+ ## 触碰NPC处理逻辑
+ npcID = curNPC.GetNPCID()
+ GameWorld.DebugLog("OnMoveTouchNPC npcID=%s" % npcID, curPlayer.GetPlayerID())
+ # 个人buff
+ if npcID in GetPersonBuffIDList():
+ __OnCollectOK_PersonBuff(curPlayer, curNPC, tick)
return
##玩家收集成功(塔, 旗)
def OnCollectOK(curPlayer, npcID, tick):
- GameWorld.DebugLog("OnCollectOK npcID=%s" % npcID, curPlayer.GetPlayerID())
+ #GameWorld.DebugLog("OnCollectOK npcID=%s" % npcID, curPlayer.GetPlayerID())
tagObj = curPlayer.GetActionObj()
if not tagObj:
return
@@ -1711,8 +1827,8 @@
__OnCollectOK_Crystal(curPlayer, curNPC, tick)
# 个人buff
- elif npcID in GetPersonBuffIDList():
- __OnCollectOK_PersonBuff(curPlayer, curNPC, tick)
+ #elif npcID in GetPersonBuffIDList():
+ # __OnCollectOK_PersonBuff(curPlayer, curNPC, tick)
# 阵营buff
elif npcID in GetFactionBuffIDList():
@@ -1742,6 +1858,7 @@
# 更新归属信息
worldObj.crystalFactionInfo[npcID] = faction
worldObj.crystalAwardTick[npcID] = tick
+ worldObj.worldHelpDict["crystalFactionInfo"] = worldObj.crystalFactionInfo
battleObj.crystalCollCnt += 1
GameWorld.Log("玩家占领水晶: objID=%s,npcID=%s,lastOwnerFaction=%s,playerID=%s,faction=%s"
@@ -1753,7 +1870,7 @@
PlayerControl.FBFactionNotify(curPlayer.GetFaction(), "CrossBattlefieldOccupiedSelf", [battleObj.name],
"CrossBattlefieldOccupiedOther", [battleObj.name])
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp()
return
def __OnCollectOK_PersonBuff(curPlayer, curNPC, tick):
@@ -1797,6 +1914,7 @@
worldObj = GetBattleWorld()
if worldObj.factionBuffNPCInfo and npcID == worldObj.factionBuffNPCInfo[0]:
worldObj.factionBuffNPCInfo = []
+ worldObj.worldHelpDict["factionBuffNPCInfo"] = []
worldObj.factionBuffCalcTick = tick
# 增加buff效果
@@ -1840,12 +1958,13 @@
buffTime = buffSkill.GetLastTime()
endTime = int(time.time()) + int(buffTime / 1000)
gainBuffFactionObj.factionBuffInfo = [addSkillID, endTime]
+ gainBuffFactionObj.factionHelpDict["factionBuffInfo"] = gainBuffFactionObj.factionBuffInfo
if npcID == 30908112:
gainBuffFactionObj.crystalScorePlusRate = buffSkill.GetEffect(0).GetEffectValue(0)
gainBuffFactionObj.crystalScorePlusEndTick = tick + buffTime
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp()
NPCCommon.SetDeadEx(curNPC)
return
@@ -1881,7 +2000,8 @@
if worldObj.eventNPCHP <= 0:
worldObj.setEventEnd(tick)
else:
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ worldObj.worldHelpDict["eventNPCHP"] = worldObj.eventNPCHP
+ NotifyBattlefieldHelp()
return
def DoFBOnNPCKill_Player(curNPC, curPlayer, tick):
@@ -1961,6 +2081,8 @@
battleObj = GetBattlePlayerObj(ownerPlayerID)
battleObj.addKillCount(1)
battleObj.addPlayerScore(ownerPlayer, guardKillPlayerScore, ScoreType_GuardKillPlayer)
+ if ownerPlayer:
+ NotifyBattlefieldHelp(False, ownerPlayer)
return
def __OnPlayerKillEventBoss(curPlayer, curNPC, tick):
@@ -1985,6 +2107,7 @@
# 伤害相同时,归属最后一击玩家所属阵营
ownerFaction = jFactionObj if killerFaction == jFactionObj.faction else eFactionObj
ownerFaction.hurtBossValue += 100 # 随机归属方额外增加伤害
+ ownerFaction.factionHelpDict["hurtBossValue"] = ownerFaction.hurtBossValue
GameWorld.Log(" 伤害相同,归属最后一击玩家阵营! ", fbPropertyID)
GameWorld.Log(" Boss归属阵营: faction=%s" % ownerFaction.faction, fbPropertyID)
ownerFactionScore = IpyGameDataPY.GetFuncCfg("CrossBattlefieldBoss", 3)
@@ -2003,7 +2126,7 @@
worldObj = GetBattleWorld()
worldObj.setEventEnd(tick)
if not checkBattleOver(tick):
- FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
+ NotifyBattlefieldHelp()
return
def GetFBPlayerHurtNPCMultiValue(curPlayer, curNPC):
@@ -2035,6 +2158,7 @@
# 累加伤害
factionObj.hurtBossValue = factionObj.hurtBossValue + hurtHP
+ factionObj.factionHelpDict["hurtBossValue"] = factionObj.hurtBossValue
factionObj.hurtBossPlayerDict[playerID] = factionObj.hurtBossPlayerDict.get(playerID, 0) + hurtHP
GameWorld.DebugLog("玩家攻击boss: faction=%s,hurtHP=%s,factionHurtBossValue=%s,playerHurtBossValue=%s,npcHP=%s"
% (faction, hurtHP, factionObj.hurtBossValue, factionObj.hurtBossPlayerDict[playerID], GameObj.GetHP(curNPC)), playerID)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py
index 71090be..44dec7b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py
@@ -504,6 +504,17 @@
FBCommon.Notify_FBHelp(curPlayer, helpDict)
return
+def OnRandomRobotJob(curNPC, lineRobotJobDict):
+ ## 随机机器人职业
+ tick = GameWorld.GetGameWorld().GetTick()
+ playerManager = GameWorld.GetMapCopyPlayerManager()
+ for index in xrange(playerManager.GetPlayerCount()):
+ curPlayer = playerManager.GetPlayerByIndex(index)
+ if not curPlayer:
+ continue
+ DoFBHelp(curPlayer, tick)
+ return
+
def DoFBOnNPCKill_Player(curNPC, curPlayer, tick):
if curNPC.GetNPCID() in IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 2, {}).values():
DoFBOnKill_Player(curNPC, curPlayer, tick)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 3193394..a262245 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -254,7 +254,6 @@
return
def __OnFBRobotReborn(curNPC, npcLV):
- tick = GameWorld.GetGameWorld().GetTick()
lineID = GameWorld.GetGameWorld().GetLineID()
objID = curNPC.GetID()
jobSkillDict = IpyGameDataPY.GetFuncEvalCfg("FBRobotCfg", 1)
@@ -275,12 +274,7 @@
skillManager = curNPC.GetSkillManager()
for skillID in skillIDList:
skillManager.LearnSkillByID(skillID)
- playerManager = GameWorld.GetMapCopyPlayerManager()
- for index in xrange(playerManager.GetPlayerCount()):
- curPlayer = playerManager.GetPlayerByIndex(index)
- if not curPlayer:
- continue
- FBLogic.DoFBHelp(curPlayer, tick)
+ FBLogic.OnRandomRobotJob(curNPC, lineRobotJobDict)
return
@@ -2154,7 +2148,6 @@
tick = GameWorld.GetGameWorld().GetTick()
#---初始化NPC相关 设NPCID 最大仇恨数 AI类型 出生点 出生时间---
curSummon.SetNPCTypeID(npcId)
- curSummon.Reborn(rebornX, rebornY)
curSummon.SetBornTime(tick)
if aiType > 0:
curSummon.SetAIType(aiType)
@@ -2168,9 +2161,10 @@
if curSummon.GetType() == ChConfig.ntRobot:
__OnFBRobotReborn(curSummon, curSummon.GetLV())
-
+ curSummon.Reborn(rebornX, rebornY)
+
FBLogic.DoFBRebornSummonNPC(curSummon, tick)
- __NotifyMapPlayerSummonMapNPC(npcId, rebornX, rebornY)
+ #__NotifyMapPlayerSummonMapNPC(npcId, rebornX, rebornY)
return curSummon
## 通知地图内玩家,地图出现召唤NPC
@@ -5652,6 +5646,7 @@
if not canCollTogether and not SetCollectNPC(curPlayer, curNPC):
GameWorld.ErrLog("SetCollectNPC fail!")
return
+ curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectNPCObjID, curNPC.GetID())
# 采集耗时
prepareTime = collectNPCIpyData.GetPrepareTime() * 1000
@@ -5720,6 +5715,8 @@
curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectNPCObjID, 0)
#GameWorld.DebugLog(" set collectNPCObjID 0")
+
+ FBLogic.OnExitCollect(curPlayer, curNPC)
return
def DoCollectNPCOK(curPlayer, npcID, tick):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
index f6c47cf..371a3c2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
@@ -463,7 +463,7 @@
def CheckPetCanFight(curPlayer, curPetObj):
if not GetMapCanOutPet(curPlayer):
#Pet_liubo_314885 此地图禁止宠物
- PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
+ #PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
return False
petData = curPetObj.GetPetData()
@@ -589,7 +589,7 @@
return
#Pet_liubo_314885 此地图禁止宠物
- PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
+ #PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
return
def GetMapCanOutPet(curPlayer):
--
Gitblit v1.8.0