389 流向记录(简化战斗流向记录,只统计出场的武将ID;)
| | |
| | | heroCount = 0
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | statInfo = {}
|
| | | drLineupInfo = {}
|
| | | drHeroIDDict = {}
|
| | | for faction in turnFight.factionDict.keys():
|
| | | if str(faction) not in statInfo:
|
| | | statInfo[str(faction)] = {}
|
| | | facStatInfo = statInfo[str(faction)]
|
| | | if str(faction) not in drLineupInfo:
|
| | | drLineupInfo[str(faction)] = {}
|
| | | facDRLineupInfo = drLineupInfo[str(faction)]
|
| | | if str(faction) not in drHeroIDDict:
|
| | | drHeroIDDict[str(faction)] = {}
|
| | | facDRHeroIDDict = drHeroIDDict[str(faction)]
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batFaction.totalHurt = 0
|
| | | for num in batFaction.lineupDict.keys():
|
| | | if str(num) not in facStatInfo:
|
| | | facStatInfo[str(num)] = {}
|
| | | lineupStatInfo = facStatInfo[str(num)]
|
| | | if str(num) not in facDRHeroIDDict:
|
| | | facDRHeroIDDict[str(num)] = {}
|
| | | posHeroIDDict = facDRHeroIDDict[str(num)]
|
| | | batLineup = batFaction.getBatlineup(num)
|
| | | batLineup.totalHurt = 0
|
| | | facDRLineupInfo[str(num)] = batLineup.lineupInfo
|
| | | GameWorld.DebugLogEx("阵容明细: faction=%s,num=%s", faction, num)
|
| | | for posNum, objID in batLineup.getPosObjIDDict().items():
|
| | | if posNum == ChConfig.TFPosNum_Mingge:
|
| | |
| | | dead = 0 if batObj.IsAlive() else 1
|
| | | if heroID:
|
| | | heroCount += 1
|
| | | posHeroIDDict[str(posNum)] = heroID
|
| | | 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, guid)
|
| | | heroCount, turnFight.costTime, drHeroIDDict, guid)
|
| | | return
|
| | |
|
| | | #// B4 14 查看战报 #tagCSTurnFightReportView
|
| | |
| | | SendEventPack("FBPass_%s" % mapID, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_FightStat(reqPlayerID, mapID, funcLineID, isWin, turnNum, turnMax, heroCount, costTime, statInfo, drLineupInfo, guid):
|
| | | def DR_FightStat(reqPlayerID, mapID, funcLineID, isWin, turnNum, turnMax, heroCount, costTime, drHeroIDDict, guid):
|
| | | ## 战斗统计
|
| | | dataDict = {'PlayerID':reqPlayerID, 'mapID':mapID, 'funcLineID':funcLineID, 'isWin':isWin,
|
| | | 'turnNum':turnNum, 'turnMax':turnMax, 'heroCount':heroCount, 'costTime':costTime, 'guid':guid}
|
| | |
| | | if mapID in mapPassDict:
|
| | | drLineID = mapPassDict[mapID]
|
| | | if funcLineID >= drLineID:
|
| | | failDRDict = {"statInfo":statInfo, "drLineupInfo":drLineupInfo}
|
| | | failDRDict = {"heroIDDict":drHeroIDDict}
|
| | | failDRDict.update(dataDict)
|
| | | SendEventPack("FightPass_%s" % mapID, failDRDict, checkBatServer=False)
|
| | | #SendEventPack("FightFail_%s" % mapID, failDRDict, checkBatServer=False)
|