| | |
| | | import PlayerSuccess
|
| | | import IpyGameDataPY
|
| | | import PlayerOnline
|
| | | import PlayerPreset
|
| | | import NPCCommon
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | |
| | | self.lineupInfo = {} # 传入初始化的阵容信息
|
| | | self.shapeType = 0 # 阵型
|
| | | self.fightPower = 0 # 阵容总战力
|
| | | self.minggeObj = None # 命格战斗对象
|
| | | self.posObjIDDict = {} # 站位对应战斗实体 {站位编号:batObjID, ...}, 站位编号小于0为非主战单位,如主公、红颜等
|
| | | self.heroObjIDDict = {} # 武将ID对应ObjID {heroID:batObjID, ...}
|
| | | self.lingshouObjIDDict = {} # 灵兽战斗单位 {位置编号:batObjID, ...}
|
| | | self.beautyObjIDDict = {} # 红颜战斗单位 {位置编号:batObjID, ...}
|
| | | self.actionNum = ActionNumStart # 行动位置,从1开始
|
| | | self.totalHurt = 0 # 阵容总输出
|
| | |
|
| | |
| | |
|
| | | def isEmpty(self): return not self.posObjIDDict
|
| | |
|
| | | def setLineup(self, lineupInfo):
|
| | | def setLineupInfo(self, lineupInfo):
|
| | | ## 设置阵容
|
| | | # @param lineupInfo: 阵容信息
|
| | | self.clearLineup()
|
| | |
| | | batObjMgr.delBatObj(objID)
|
| | | for objID in self.lingshouObjIDDict.values():
|
| | | batObjMgr.delBatObj(objID)
|
| | | for objID in self.beautyObjIDDict.values():
|
| | | batObjMgr.delBatObj(objID)
|
| | | if self.minggeObj:
|
| | | batObjMgr.delBatObj(self.minggeObj.GetID())
|
| | | self.lineupInfo = {}
|
| | | self.posObjIDDict = {}
|
| | | self.heroObjIDDict = {}
|
| | | self.lingshouObjIDDict = {}
|
| | | self.beautyObjIDDict = {}
|
| | | self.fightPower = 0
|
| | | self.totalHurt = 0
|
| | | return
|
| | |
| | | if heroID not in self.heroObjIDDict:
|
| | | return
|
| | | return BattleObj.GetBatObjMgr().getBatObj(self.heroObjIDDict[heroID])
|
| | | |
| | | def getMinggeObj(self): return self.minggeObj
|
| | |
|
| | | class BatFaction():
|
| | | ## 战斗阵营
|
| | |
| | | if not lineupInfo:
|
| | | continue
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | batLineup.setLineup(lineupInfo)
|
| | | batLineup.setLineupInfo(lineupInfo)
|
| | | return
|
| | |
|
| | | def sortActionQueue(self):
|
| | |
| | | % (chapterID, levelNum, nowChapterID, fixNowValue), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
|
| | | def GetCacheLineupFightPower(tagViewCache, lineupID):
|
| | | lineupInfo = GetCacheLineupInfo(tagViewCache, lineupID)
|
| | | return lineupInfo.get("FightPower", 0)
|
| | | def GetCacheLineupInfo(tagViewCache, lineupID):
|
| | | def GetCacheLineupFightPower(tagViewCache, batPresetType=ShareDefine.BatPreset_Main):
|
| | | if not tagViewCache:
|
| | | return 0
|
| | | lineupInfo = GetCacheLineupInfo(tagViewCache, batPresetType)
|
| | | return lineupInfo.get("FightPower", tagViewCache.GetFightPowerTotal())
|
| | | def GetCacheLineupInfo(tagViewCache, batPresetType=ShareDefine.BatPreset_Main):
|
| | | ## 根据查看缓存获取阵容信息,一般是 GetPlayerLineupInfo 返回的结果
|
| | | plusDict = tagViewCache.GetPlusDict()
|
| | | batPresetDict = plusDict.get("BatPreset", {})
|
| | | batTypePresetDict = batPresetDict.get("%s" % batPresetType, {})
|
| | | batPresetID = batTypePresetDict.get("%s" % ShareDefine.FuncPreset_Battle, 1)
|
| | | |
| | | lineupDict = plusDict.get("Lineup", {})
|
| | | lineupInfo = lineupDict.get("%s" % lineupID, {})
|
| | | lineupInfo = lineupDict.get("%s" % batPresetID, {})
|
| | | if not lineupInfo:
|
| | | lineupInfo = lineupDict.get("%s" % ShareDefine.Lineup_Main, {})
|
| | | defBatPresetID = 1
|
| | | lineupInfo = lineupDict.get("%s" % defBatPresetID, {})
|
| | | return lineupInfo
|
| | |
|
| | | def GetPlayerLineupFightPower(curPlayer, lineupID=ShareDefine.Lineup_Main):
|
| | | def GetPlayerLineupFightPower(curPlayer, batPresetType=ShareDefine.BatPreset_Main, exclusiveMapID=0):
|
| | | ## 获取玩家阵容战力,一般用于直接获取阵容战力记录用
|
| | | return GetPlayerLineup(curPlayer, lineupID).fightPower
|
| | | def GetPlayerLineup(curPlayer, lineupID=ShareDefine.Lineup_Main, exclusiveMapID=0):
|
| | | return GetPlayerLineupByType(curPlayer, batPresetType, exclusiveMapID).fightPower
|
| | | def GetPlayerLineupByType(curPlayer, batPresetType=ShareDefine.BatPreset_Main, exclusiveMapID=0):
|
| | | batPresetID = PlayerPreset.GetBatPresetID(curPlayer, batPresetType)
|
| | | return GetPlayerLineupByID(curPlayer, batPresetID, exclusiveMapID)
|
| | | def GetPlayerLineupByID(curPlayer, batPresetID=0, exclusiveMapID=0):
|
| | | ## 获取玩家阵容
|
| | | mainBatPresetID = PlayerPreset.GetBatPresetID(curPlayer, ShareDefine.BatPreset_Main)
|
| | | if not batPresetID:
|
| | | batPresetID = mainBatPresetID
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | lineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | GameWorld.DebugLogEx("玩家没有目标阵容默认取主阵容! lineupID=%s", lineupID, curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
|
| | | lineup = olPlayer.GetPresetLineup(batPresetID, exclusiveMapID=exclusiveMapID)
|
| | | if lineup.IsEmpty() and batPresetID != mainBatPresetID:
|
| | | GameWorld.DebugLogEx("玩家没有目标阵容默认取主线阵容! batPresetID=%s,mainBatPresetID=%s", (batPresetID, mainBatPresetID), curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetPresetLineup(mainBatPresetID, exclusiveMapID=exclusiveMapID)
|
| | | return lineup
|
| | |
|
| | | def GetPlayerLineupInfo(curPlayer, lineupID, exclusiveMapID=0):
|
| | | def GetPlayerLineupInfo(curPlayer, batPresetType=ShareDefine.BatPreset_Main, exclusiveMapID=0):
|
| | | ## 获取玩家阵容信息,可用于战斗或查看缓存,因为可能取玩家的缓存进行对战,所以统一使用json格式,前端通用
|
| | | # @param lineupID: 阵容ID
|
| | | # @param exclusiveMapID: 专享阵容的地图ID,如定军阁
|
| | | # @return: 阵容全部信息json字典,前端通用格式
|
| | | |
| | | batPresetID = PlayerPreset.GetBatPresetID(curPlayer, batPresetType)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | lineup = GetPlayerLineup(curPlayer, lineupID, exclusiveMapID)
|
| | | lineup = GetPlayerLineupByID(curPlayer, batPresetID, exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | return {}
|
| | | batPresetID = lineup.batPresetID
|
| | |
|
| | | heroDict = {}
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptHero)
|
| | |
| | | heroID = hero.heroID
|
| | | itemIndex = hero.itemIndex
|
| | | heroLV = 1
|
| | | star = 0
|
| | | star, breakLV, awakeLV = 0, 0, 0
|
| | | userData = "{}"
|
| | | if itemIndex >= 0 and itemIndex < curPack.GetCount():
|
| | | heroItem = curPack.GetAt(itemIndex)
|
| | | if heroItem and not heroItem.IsEmpty():
|
| | | heroLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroLV)
|
| | | star = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
|
| | | #breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | #awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
|
| | | breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
|
| | | awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
|
| | | userData = heroItem.GetUserData()
|
| | |
|
| | | skillIDlist = []
|
| | |
| | | "LV":heroLV,
|
| | | "Star":star,
|
| | | "Data":userData,
|
| | | #"BreakLV":breakLV,
|
| | | #"AwakeLV":awakeLV,
|
| | | "BreakLV":breakLV,
|
| | | "AwakeLV":awakeLV,
|
| | | "FightPower":hero.fightPower,
|
| | | "AttrDict":{str(k):v for k, v in hero.heroBatAttrDict.items() if v > 0},
|
| | | "SkillIDList":skillIDlist,
|
| | |
| | | if not heroDict:
|
| | | return {}
|
| | |
|
| | | lineupInfo = {"PlayerID":playerID, "FightPower":lineup.fightPower, "ShapeType":lineup.shapeType, "Hero":heroDict}
|
| | | mgPresetID = PlayerPreset.GetFuncPresetID(curPlayer, batPresetID, ShareDefine.FuncPreset_Mingge)
|
| | | olPlayer = PlayerOnline.GetOnlineMgr().GetOnlinePlayer(curPlayer)
|
| | | mgSkillLVDict = olPlayer.GetCalcSpecInfo(ChConfig.Def_CalcAttr_Mingge, mgPresetID)
|
| | | mgSkillIDList = []
|
| | | for skillTypeID, skillLV in mgSkillLVDict.items():
|
| | | skillID = skillTypeID + skillLV - 1
|
| | | if skillID not in mgSkillIDList:
|
| | | mgSkillIDList.append(skillID)
|
| | | #shapeType = 0
|
| | | lineupInfo = {"PlayerID":playerID, "FightPower":lineup.fightPower, "BatPresetID":batPresetID, "Hero":heroDict}
|
| | | if mgSkillIDList:
|
| | | lineupInfo["MGSkillIDList"] = mgSkillIDList
|
| | | return lineupInfo
|
| | |
|
| | | def GetNPCLineupInfo(lineupID, strongerLV=0, difficulty=0, isLog=True):
|
| | | def GetNPCLineupInfo(lineupID, strongerLV=0, difficulty=0, isLog=True, viewNPCID=0):
|
| | | ## 获取NPC阵容信息
|
| | | # @param lineupID: 阵容ID
|
| | | # @param npcLV: 成长NPC等级
|
| | | # @param difficulty: 成长NPC难度系数
|
| | | # @param viewNPCID: 查看指定的NPCID,供前端查询NPC属性用
|
| | | # @return: 阵容全部信息json字典,前端通用格式
|
| | | lineupInfo = GetGMTestNPCLineupInfo(lineupID, strongerLV, difficulty)
|
| | | if lineupInfo:
|
| | |
| | | npcID = getattr(ipyData, "GetPosNPCID%s" % posNum)()
|
| | | if not npcID:
|
| | | continue
|
| | | if viewNPCID and viewNPCID != npcID:
|
| | | continue
|
| | | battleDict = GetNPCBattleDict(ipyData, npcID, strongerLV, difficulty, isLog)
|
| | | if not battleDict:
|
| | | continue
|
| | | heroDict[str(posNum)] = battleDict
|
| | | if viewNPCID:
|
| | | break
|
| | |
|
| | | lineupInfo = {"NPCLineupID":lineupID, "Hero":heroDict, "BossID":bossID, "BossPosView":bossPosView}
|
| | | return lineupInfo
|
| | |
| | | if not tagViewCache:
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, ShareDefine.Lineup_Main)
|
| | | lineupDictA = {1:GetPlayerLineupInfo(curPlayer, ShareDefine.Lineup_Main)}
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache)
|
| | | lineupDictA = {1:GetPlayerLineupInfo(curPlayer)}
|
| | | lineupDictB = {1:defLineupInfo}
|
| | | turnFight = DoTurnFightPVP(guid, mapID, funcLineID, lineupDictA, lineupDictB)
|
| | | return turnFight.costTime if turnFight else None
|
| | |
| | | "SkinID":skinID,
|
| | | "LV":npcLV,
|
| | | "Star":star,
|
| | | #"BreakLV":breakLV,
|
| | | #"AwakeLV":awakeLV,
|
| | | "BreakLV":breakLV,
|
| | | "AwakeLV":awakeLV,
|
| | | "AttrDict":{str(k):v for k, v in batAttrDict.items() if v > 0},
|
| | | "SkillIDList":skillIDList,
|
| | | }
|
| | |
| | | skillID = breakIpyData.GetSkillID()
|
| | | if skillID:
|
| | | skillIDList.append(skillID)
|
| | | skillIDExList = breakIpyData.GetSkillIDExList()
|
| | | if skillIDExList:
|
| | | skillIDList += skillIDExList
|
| | |
|
| | | awakeIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("HeroAwake", heroID)
|
| | | if awakeIpyDataList:
|
| | |
| | | lineupPlayerID = lineupInfo.get("PlayerID", 0) # 阵容所属玩家ID
|
| | | npcLineupID = lineupInfo.get("NPCLineupID", 0)
|
| | | GameWorld.DebugLogEx("SummonLineupObjs faction:%s,num:%s,npcLineupID=%s,lineupPlayerID=%s", faction, num, npcLineupID, lineupPlayerID)
|
| | | mgSkillIDList = lineupInfo.get("MGSkillIDList", [])
|
| | |
|
| | | turnFight = batLineup.turnFight
|
| | | tfGUID = turnFight.guid
|
| | | heroDict = lineupInfo.get("Hero", {})
|
| | |
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | |
| | | # 命格
|
| | | #mgSkillIDList = [9000014] # 测试用
|
| | | if mgSkillIDList:
|
| | | minggeObj = batObjMgr.addBatObj()
|
| | | if minggeObj:
|
| | | batLineup.minggeObj = minggeObj
|
| | | minggeObj.SetOwnerID(lineupPlayerID)
|
| | | minggeObj.SetTFGUID(tfGUID)
|
| | | minggeObj.SetFaction(faction)
|
| | | minggeObj.SetLineupPos(ChConfig.TFPosNum_Mingge, num)
|
| | | skillManager = minggeObj.GetSkillManager()
|
| | | skillManager.SkillReset()
|
| | | for skillID in mgSkillIDList:
|
| | | skillManager.LearnSkillByID(skillID)
|
| | | GameWorld.DebugLogEx("AddBatObj 命格: faction:%s,num:%s,objID=%s,skillIDList=%s", faction, num, minggeObj.GetID(), skillManager.GetSkillIDList())
|
| | | ResetObjSkill(minggeObj)
|
| | | minggeObj.InitBatAttr({ChConfig.AttrID_MaxHP:1})
|
| | | |
| | | # 武将
|
| | | initXP = IpyGameDataPY.GetFuncCfg("AngerXP", 1)
|
| | | for posNumKey, heroInfo in heroDict.items():
|
| | | posNum = int(posNumKey)
|
| | |
| | | playerServerID = GameWorld.GetPlayerServerID(curPlayer)
|
| | | guid = GameWorld.GetGUID()
|
| | |
|
| | | atkLineupID = ShareDefine.Lineup_Main # 进攻方默认使用主阵容
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID, mapID)
|
| | | atkBatPresetType = ChConfig.MapAtkBatPresetTypeDict.get(mapID, ShareDefine.BatPreset_Main)
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkBatPresetType, exclusiveMapID=mapID)
|
| | | if not atkLineupInfo:
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s,mapID=%s", atkLineupID, mapID, playerID)
|
| | | GameWorld.DebugLogEx("玩家没有主线阵容数据! mapID=%s", mapID, playerID)
|
| | | return
|
| | |
|
| | | # 玩家
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | |
|
| | | defLineupID = ChConfig.MapLineIDDict.get(mapID, ShareDefine.Lineup_Main)
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
|
| | | defBatPresetType = ChConfig.MapDefBatPresetTypeDict.get(mapID, ShareDefine.BatPreset_Main)
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defBatPresetType)
|
| | | if not defLineupInfo:
|
| | | GameWorld.DebugLogEx("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s", tagPlayerID, defLineupID, playerID)
|
| | | GameWorld.DebugLogEx("目标玩家没有该阵容预设数据! tagPlayerID=%s,defBatPresetType=%s", tagPlayerID, defBatPresetType, playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoLineup")
|
| | | return
|
| | |
|
| | |
| | | return
|
| | | lineupID = lineupIDList[0] # NPC阵容ID
|
| | |
|
| | | lineupMainInfo = GetPlayerLineupInfo(curPlayer, ShareDefine.Lineup_Main)
|
| | | lineupMainInfo = GetPlayerLineupInfo(curPlayer)
|
| | | if not lineupMainInfo:
|
| | | GameWorld.DebugLogEx("没有设置主阵容!", playerID)
|
| | | return
|
| | |
| | | batLineup.totalHurt = 0
|
| | | facDRLineupInfo[str(num)] = batLineup.lineupInfo
|
| | | GameWorld.DebugLogEx("阵容明细: faction=%s,num=%s", faction, num)
|
| | | for posNum, objID in batLineup.posObjIDDict.items():
|
| | | posObjIDList = [[posNum, objID] for posNum, objID in batLineup.posObjIDDict.items()]
|
| | | mgObj = batLineup.minggeObj # 命格
|
| | | if mgObj:
|
| | | posObjIDList.append([mgObj.GetPosNum(), mgObj.GetID()])
|
| | | # 灵兽
|
| | | for posNum, objID in posObjIDList:
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | continue
|
| | | heroCount += 1
|
| | | objID = batObj.GetID()
|
| | | npcID = batObj.GetNPCID()
|
| | | heroID = batObj.GetHeroID()
|
| | |
| | | batLineup.totalHurt += atkHurt
|
| | | batFaction.totalHurt += atkHurt
|
| | | dead = 0 if batObj.IsAlive() else 1
|
| | | if heroID:
|
| | | heroCount += 1
|
| | | GameWorld.DebugLogEx(" Pos:%s ID=%s,npcID=%s,heroID=%s,HP=%s/%s, 输出=%s,承伤=%s,治疗=%s",
|
| | | posNum, objID, npcID, heroID, batObj.GetHP(), batObj.GetMaxHP(), atkHurt, defHurt, cureHP)
|
| | | lineupStatInfo[str(posNum)] = {"ObjID":objID, "HeroID":heroID, "NPCID":npcID, "AtkHurt":atkHurt, "DefHurt":defHurt, "CureHP":cureHP,
|
| | |
| | | # 流向记录
|
| | | if mapID != ChConfig.Def_FBMapID_Main and reqPlayerID:
|
| | | DataRecordPack.DR_FightStat(reqPlayerID, mapID, funcLineID, turnFight.isWin, turnFight.turnNum, turnFight.turnMax,
|
| | | heroCount, turnFight.costTime, statInfo, drLineupInfo)
|
| | | heroCount, turnFight.costTime, statInfo, drLineupInfo, guid)
|
| | | return
|
| | |
|
| | | #// B4 14 查看战报 #tagCSTurnFightReportView
|
| | |
| | | # char GUID[40]; //战报guid
|
| | | #};
|
| | | def OnTurnFightReportView(index, clientData, tick):
|
| | | ## 改为下载文件
|
| | | return
|
| | |
|
| | | #// B4 16 查看NPC属性 #tagCSViewNPCAttr
|
| | | #
|
| | | #struct tagCSViewNPCAttr
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID; // 自定义地图ID,可用于绑定战斗地图场景功能(如主线boss、爬塔、竞技场等)
|
| | | # DWORD FuncLineID; // MapID对应的扩展值,如具体某个关卡等
|
| | | # DWORD ViewNPCID; // 指定查看某个NPCID,发0则查看该关卡阵容所有NPC
|
| | | #};
|
| | | def OnViewNPCAttr(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | guid = clientData.GUID
|
| | | mapID = clientData.MapID
|
| | | funcLineID = clientData.FuncLineID
|
| | | viewNPCID = clientData.ViewNPCID |
| | | SyncLineupNPCAttr(curPlayer, mapID, funcLineID, viewNPCID)
|
| | | return
|
| | |
|
| | | def SyncLineupNPCAttr(curPlayer, mapID, funcLineID, viewNPCID=0):
|
| | | lineupIDList = []
|
| | | strongerLV, difficulty = 0, 0
|
| | |
|
| | | lastBatBufferInfo = PlayerOnline.GetOnlinePlayer(curPlayer).GetLastBatBuffer()
|
| | | if lastBatBufferInfo and len(lastBatBufferInfo) == 2 and guid == lastBatBufferInfo[0]:
|
| | | guid, reprot = lastBatBufferInfo
|
| | | SyncTurnFightReport(curPlayer, guid, reprot)
|
| | | if mapID == ChConfig.Def_FBMapID_MainBoss:
|
| | | chapterID = funcLineID / 100
|
| | | levelNum = funcLineID % 100
|
| | | levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum)
|
| | | if not levelIpyData:
|
| | | return
|
| | | lineupIDList = levelIpyData.GetBossLineupIDList() # Boss波阵容ID列表,小队1阵容ID|小队2阵容ID|...
|
| | | strongerLV = levelIpyData.GetNPCLV()
|
| | | difficulty = levelIpyData.GetDifficulty()
|
| | | |
| | | else:
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, funcLineID)
|
| | | if fbLineIpyData:
|
| | | lineupIDList = fbLineIpyData.GetLineupIDList()
|
| | | strongerLV = fbLineIpyData.GetNPCLV()
|
| | | difficulty = fbLineIpyData.GetDifficulty()
|
| | | else:
|
| | | ret = FBLogic.GetFBNPCLineupInfo(curPlayer, mapID, funcLineID)
|
| | | if not ret:
|
| | | return
|
| | | lineupIDList, strongerLV, difficulty = ret
|
| | | |
| | | if not lineupIDList:
|
| | | return
|
| | |
|
| | | # 其他战报,一般是入库存储的,待扩展
|
| | | |
| | | # 战报已过期
|
| | | PlayerControl.NotifyCode(curPlayer, "FightReportExpired")
|
| | | npcAttrList = []
|
| | | for lineupID in lineupIDList:
|
| | | lineupInfo = GetNPCLineupInfo(lineupID, strongerLV, difficulty, False, viewNPCID=viewNPCID)
|
| | | if not lineupInfo:
|
| | | continue
|
| | | heroDict = lineupInfo["Hero"]
|
| | | for posNum, attrInfo in heroDict.items():
|
| | | posNum = int(posNum)
|
| | | npcAttr = ChPyNetSendPack.tagSCViewNPCAttr()
|
| | | npcAttr.PosNum = posNum
|
| | | npcAttr.NPCID = attrInfo["NPCID"]
|
| | | npcAttr.HeroID = attrInfo["HeroID"]
|
| | | npcAttr.LV = attrInfo["LV"]
|
| | | npcAttr.Star = attrInfo["Star"]
|
| | | npcAttr.BreakLV = attrInfo["BreakLV"]
|
| | | npcAttr.AwakeLV = attrInfo["AwakeLV"]
|
| | | npcAttr.AttrMsg = json.dumps(attrInfo["AttrDict"], ensure_ascii=False).replace(" ", "")
|
| | | npcAttr.AttrLen = len(npcAttr.AttrMsg)
|
| | | npcAttrList.append(npcAttr)
|
| | | if not npcAttrList:
|
| | | return
|
| | | clientPack = ChPyNetSendPack.tagSCViewNPCAttrRet()
|
| | | clientPack.MapID = mapID
|
| | | clientPack.FuncLineID = funcLineID
|
| | | clientPack.ViewNPCID = viewNPCID
|
| | | clientPack.NPCAttrList = npcAttrList
|
| | | clientPack.NPCCnt = len(clientPack.NPCAttrList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def SyncTurnFightReport(curPlayer, guid, reprot):
|