| | |
| | |
|
| | | 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):
|
| | | # 随机生成大奖任务
|
| | |
| | | self.eventNPCHP = 0
|
| | | self.eventEndTick = 0
|
| | | self.lastEventEndTick = tick # 上个事件结束tick
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | self.updEventNPCHelp(tick)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | 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}
|
| | | 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)
|
| | |
|
| | |
| | | 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):
|
| | |
| | | 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)
|
| | |
| | | self.crystalCollCnt = 0 # 采集水晶资源次数
|
| | | self.wallCollCnt = 0 # 采集积分墙次数
|
| | | self.superItemContribution = 0 # 大奖进度贡献值,也是大奖获奖权重
|
| | | |
| | | self.playerHelpDict = {} # 未通知的玩家变更信息
|
| | | return
|
| | |
|
| | | def getFactionObj(self):
|
| | |
| | | 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
|
| | |
| | | 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:
|
| | |
| | | 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:
|
| | |
| | |
|
| | | 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:
|
| | |
| | | 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
|
| | |
|
| | | ##玩家退出副本
|
| | |
| | | continue
|
| | | allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | NotifyBattlefieldHelp(True)
|
| | | PlayerControl.FBNotify("CrossBattlefieldStartFighting")
|
| | | return
|
| | |
|
| | |
| | |
|
| | | 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():
|
| | |
| | | __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)
|
| | |
| | | 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):
|
| | |
| | | NPCCommon.SetDeadEx(auraNPC)
|
| | |
|
| | | worldObj.setEventEnd(tick)
|
| | | NotifyBattlefieldHelp()
|
| | |
|
| | | return
|
| | |
|
| | |
| | | wallScore = IpyGameDataPY.GetFuncCfg("CrossBattlefieldScoreWall", 3)
|
| | | PlayerControl.FBNotify("CrossBattlefieldEventWall", [npcID, wallScore, worldObj.eventNPCHP])
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | worldObj.updEventNPCHelp(tick)
|
| | | NotifyBattlefieldHelp()
|
| | |
|
| | | return
|
| | |
|
| | |
| | | #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):
|
| | |
| | |
|
| | | #factionScore += ... # 其他加分
|
| | | atkFactionObj.addFactionScore(factionScore)
|
| | | |
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | NotifyBattlefieldHelp(False, atkObj) # 击杀的暂只实时通知自己
|
| | | return
|
| | |
|
| | | def DoFB_NPCDead(curNPC):
|
| | |
| | | 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, {})
|
| | |
| | |
|
| | | ## 开始采集
|
| | | 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
|
| | |
| | | __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():
|
| | |
| | | # 更新归属信息
|
| | | 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"
|
| | |
| | | PlayerControl.FBFactionNotify(curPlayer.GetFaction(), "CrossBattlefieldOccupiedSelf", [battleObj.name],
|
| | | "CrossBattlefieldOccupiedOther", [battleObj.name])
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | NotifyBattlefieldHelp()
|
| | | return
|
| | |
|
| | | def __OnCollectOK_PersonBuff(curPlayer, curNPC, tick):
|
| | |
| | | worldObj = GetBattleWorld()
|
| | | if worldObj.factionBuffNPCInfo and npcID == worldObj.factionBuffNPCInfo[0]:
|
| | | worldObj.factionBuffNPCInfo = []
|
| | | worldObj.worldHelpDict["factionBuffNPCInfo"] = []
|
| | | worldObj.factionBuffCalcTick = tick
|
| | |
|
| | | # 增加buff效果
|
| | |
| | | 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
|
| | |
|
| | |
| | | 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):
|
| | |
| | | battleObj = GetBattlePlayerObj(ownerPlayerID)
|
| | | battleObj.addKillCount(1)
|
| | | battleObj.addPlayerScore(ownerPlayer, guardKillPlayerScore, ScoreType_GuardKillPlayer)
|
| | | if ownerPlayer:
|
| | | NotifyBattlefieldHelp(False, ownerPlayer)
|
| | | return
|
| | |
|
| | | def __OnPlayerKillEventBoss(curPlayer, curNPC, tick):
|
| | |
| | | # 伤害相同时,归属最后一击玩家所属阵营
|
| | | 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)
|
| | |
| | | worldObj = GetBattleWorld()
|
| | | worldObj.setEventEnd(tick)
|
| | | if not checkBattleOver(tick):
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | NotifyBattlefieldHelp()
|
| | | return
|
| | |
|
| | | def GetFBPlayerHurtNPCMultiValue(curPlayer, curNPC):
|
| | |
| | |
|
| | | # 累加伤害
|
| | | 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)
|