| | |
| | | def getWorldAllHelpInfo(self, tick):
|
| | | worldInfo = {"superItemInfo":self.superItemInfo, "crystalFactionInfo":self.crystalFactionInfo,
|
| | | "factionBuffNPCInfo":self.factionBuffNPCInfo, "crystalAtkedList":self.crystalAtkedDict.keys()}
|
| | | worldInfo.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos, |
| | | 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, |
| | | self.worldHelpDict.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
|
| | | "eventEndTick":max(0, self.eventEndTick - tick), "eventNPCHP":self.eventNPCHP})
|
| | | return
|
| | |
|
| | |
| | |
|
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | NotifyBattlefieldHelp(False, atkObj) # 击杀的暂只实时通知自己
|
| | | |
| | | # 玩家被玩家击杀,掉落个人buff
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | DoDropPersonBuffOnKilled(atkObj, defObj, tick)
|
| | | |
| | | return
|
| | |
|
| | | def DoFB_NPCDead(curNPC):
|
| | |
| | | GameWorld.Log("zoneID=%s,hmNum=%s,allCallPlayerIDList=%s" % (zoneID, hmNum, allCallPlayerIDList), fbPropertyID)
|
| | |
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | drDict = {"mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":gameWorld.GetCopyMapID(), |
| | | "zoneID":zoneID, "funcLineID":funcLineID, "fbPropertyID":fbPropertyID, "hmNum":hmNum, |
| | | "superItemInfo":worldObj.superItemInfo, "finalSuperItemPlayerID":finalSuperItemPlayerID, |
| | | "crystalFactionInfo":worldObj.crystalFactionInfo, "callTeamInfo":callTeamInfo, |
| | | drDict = {"mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":gameWorld.GetCopyMapID(),
|
| | | "zoneID":zoneID, "funcLineID":funcLineID, "fbPropertyID":fbPropertyID, "hmNum":hmNum,
|
| | | "superItemInfo":worldObj.superItemInfo, "finalSuperItemPlayerID":finalSuperItemPlayerID,
|
| | | "crystalFactionInfo":worldObj.crystalFactionInfo, "callTeamInfo":callTeamInfo,
|
| | | "winnerFaction":winnerFaction, "fightTimeTotal":(int(time.time()) - worldObj.startTime)}
|
| | | factionInfoList = []
|
| | | for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
|
| | | factionObj = GetBattleFactionObj(faction)
|
| | | rankPlayerList = []
|
| | | for battleObj in factionObj.battlePlayerSortList[:syncRankCount]:
|
| | | rankPlayerList.append({"name":battleObj.name, "job":battleObj.job, "score":battleObj.score, |
| | | rankPlayerList.append({"name":battleObj.name, "job":battleObj.job, "score":battleObj.score,
|
| | | "killCount":battleObj.killCount, "crystalCollCnt":battleObj.crystalCollCnt})
|
| | |
|
| | | callPlayerName = ""
|
| | |
| | | callPlayerName = callBattleObj.name
|
| | | break
|
| | |
|
| | | factionInfoList.append({"faction":faction, "rankPlayerList":rankPlayerList, "callPlayerName":callPlayerName, |
| | | factionInfoList.append({"faction":faction, "rankPlayerList":rankPlayerList, "callPlayerName":callPlayerName,
|
| | | "superItemPlayerName":factionObj.superItemPlayerName})
|
| | |
|
| | | costTime = int((tick - GameWorld.GetGameFB().GetFBStepTick()) / 1000.0)
|
| | | overDict = {"winnerFaction":winnerFaction, "factionInfoList":factionInfoList, FBCommon.Over_costTime:costTime, |
| | | overDict = {"winnerFaction":winnerFaction, "factionInfoList":factionInfoList, FBCommon.Over_costTime:costTime,
|
| | | "finalSuperItemPlayerName":finalSuperItemPlayerName}
|
| | |
|
| | | scoreKingID, scoreKingName = 0, "" # 本场积分王: 获胜方在线第一名积分
|
| | |
| | | factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt]
|
| | | battlePlayerList.append(playerInfo)
|
| | |
|
| | | drPlayerList.append({"playerID":playerID, "accID":battleObj.accID, "fightPower":battleObj.fightPower, |
| | | "score":score, "auraScore":auraScore, "wallCollCnt":wallCollCnt, |
| | | drPlayerList.append({"playerID":playerID, "accID":battleObj.accID, "fightPower":battleObj.fightPower,
|
| | | "score":score, "auraScore":auraScore, "wallCollCnt":wallCollCnt,
|
| | | "superItemAwardCnt":superItemAwardCnt, "superItemContribution":battleObj.superItemContribution})
|
| | |
|
| | | player = copyMapMgr.FindPlayerByID(playerID)
|
| | |
| | | overDict.update({FBCommon.Over_rank:rank, "score":score, "highScoreToday":highScoreToday, "onlineTimes":onlineTimes, "faction":faction})
|
| | | FBCommon.NotifyFBOver(player, ChConfig.Def_FBMapID_CrossBattlefield, lineID, isWinner, overDict)
|
| | |
|
| | | drFactionInfo = {"faction":faction, "score":factionObj.score, "hurtBossPlayerDict":factionObj.hurtBossPlayerDict, |
| | | "superItemProgress":factionObj.superItemProgress, "superItemPlayerID":factionObj.superItemPlayerID, |
| | | drFactionInfo = {"faction":faction, "score":factionObj.score, "hurtBossPlayerDict":factionObj.hurtBossPlayerDict,
|
| | | "superItemProgress":factionObj.superItemProgress, "superItemPlayerID":factionObj.superItemPlayerID,
|
| | | "drPlayerList":drPlayerList}
|
| | | drDict["faction_%s" % faction] = drFactionInfo
|
| | |
|
| | |
| | | NotifyBattlefieldHelp()
|
| | | return
|
| | |
|
| | | def DoDropPersonBuffOnKilled(atkPlayer, defPlayer, tick):
|
| | | dropPersonBuffNPCList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldDropPersonBuff", 1)
|
| | | if not dropPersonBuffNPCList:
|
| | | return
|
| | | |
| | | dropNPCIDList = []
|
| | | for npcID in dropPersonBuffNPCList:
|
| | | npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
|
| | | if not npcData:
|
| | | continue
|
| | | buffID = npcData.GetSkill1()
|
| | | if not buffID:
|
| | | continue
|
| | | findBuff = SkillCommon.FindBuffByID(defPlayer, buffID)[0]
|
| | | if not findBuff:
|
| | | continue
|
| | | |
| | | if findBuff.GetLayer():
|
| | | dropNPCIDList.extend([npcID] * findBuff.GetLayer())
|
| | | else:
|
| | | dropNPCIDList.append(npcID)
|
| | | |
| | | count = 0
|
| | | defPosX, defPosY = defPlayer.GetPosX(), defPlayer.GetPosY()
|
| | | while dropNPCIDList and count < 100:
|
| | | count += 1
|
| | | dropX, dropY = GameMap.GetNearbyPosByDis(defPosX, defPosY, 5)
|
| | | if not dropX:
|
| | | continue
|
| | | npcID = dropNPCIDList.pop(0)
|
| | | NPCCommon.SummonMapNpc(npcID, dropX, dropY, playerID=atkPlayer.GetPlayerID())
|
| | | |
| | | return
|
| | |
|
| | | def OnCanMoveTouchNPC(curPlayer, curNPC, tick):
|
| | | ## 检查可否触碰NPC逻辑
|
| | | summonPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SummonMapNPCPlayerID)
|
| | | if not summonPlayerID:
|
| | | return True
|
| | | if summonPlayerID == curPlayer.GetPlayerID():
|
| | | #GameWorld.DebugLog("OnCanMoveTouchNPC summonPlayerID=%s,owner=True" % summonPlayerID, curNPC.GetID())
|
| | | return True
|
| | | protectTick = IpyGameDataPY.GetFuncCfg("CrossBattlefieldDropPersonBuff", 2) * 1000
|
| | | passTick = tick - curNPC.GetActionTick()
|
| | | if passTick < protectTick:
|
| | | #GameWorld.DebugLog("OnCanMoveTouchNPC in protect! passTick=%s < protectTick=%s" % (passTick, protectTick), curNPC.GetID())
|
| | | return False
|
| | | return True
|
| | |
|
| | | def OnMoveTouchNPC(curPlayer, curNPC, tick):
|
| | | ## 触碰NPC处理逻辑
|
| | | npcID = curNPC.GetNPCID()
|