| | |
| | | lineupInfo = lineupDict.get("%s" % ShareDefine.Lineup_Main, {})
|
| | | return lineupInfo
|
| | |
|
| | | def GetPlayerLineupFightPower(curPlayer, lineupID):
|
| | | def GetPlayerLineupFightPower(curPlayer, lineupID=ShareDefine.Lineup_Main):
|
| | | ## 获取玩家阵容战力,一般用于直接获取阵容战力记录用
|
| | | return GetPlayerLineup(curPlayer, lineupID).fightPower
|
| | | def GetPlayerLineup(curPlayer, lineupID):
|
| | | def GetPlayerLineup(curPlayer, lineupID=ShareDefine.Lineup_Main, exclusiveMapID=0):
|
| | | ## 获取玩家阵容
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | lineup = olPlayer.GetLineup(lineupID)
|
| | | lineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | GameWorld.DebugLogEx("玩家没有目标阵容默认取主阵容! lineupID=%s", lineupID, curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
|
| | | return lineup
|
| | |
|
| | | def GetPlayerLineupInfo(curPlayer, lineupID):
|
| | | def GetPlayerLineupInfo(curPlayer, lineupID, exclusiveMapID=0):
|
| | | ## 获取玩家阵容信息,可用于战斗或查看缓存,因为可能取玩家的缓存进行对战,所以统一使用json格式,前端通用
|
| | | # @param lineupID: 阵容ID
|
| | | # @param exclusiveMapID: 专享阵容的地图ID,如定军阁
|
| | | # @return: 阵容全部信息json字典,前端通用格式
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | lineup = GetPlayerLineup(curPlayer, lineupID)
|
| | | lineup = GetPlayerLineup(curPlayer, lineupID, exclusiveMapID)
|
| | | if lineup.IsEmpty():
|
| | | return {}
|
| | |
|
| | |
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | |
|
| | | # 攻防方所使用的阵容ID
|
| | | atkLineupID, defLineupID = FBLogic.GetFBPlayerLineupID(curPlayer, mapID, funcLineID)
|
| | | if atkLineupID not in ShareDefine.LineupList or defLineupID not in ShareDefine.LineupList:
|
| | | return
|
| | | |
| | | if CheckFightCD(curPlayer, tick, "TurnFightReqTick"):
|
| | | return
|
| | |
|
| | |
| | | playerServerID = GameWorld.GetPlayerServerID(curPlayer)
|
| | | guid = GameWorld.GetGUID()
|
| | |
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID)
|
| | | atkLineupID = ShareDefine.Lineup_Main # 进攻方默认使用主阵容
|
| | | atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID, mapID)
|
| | | if not atkLineupInfo:
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s", atkLineupID, playerID)
|
| | | GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s,mapID=%s", atkLineupID, mapID, playerID)
|
| | | return
|
| | |
|
| | | # 玩家
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | |
|
| | | defLineupID = ChConfig.MapLineIDDict.get(mapID, ShareDefine.Lineup_Main)
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
|
| | | if not defLineupInfo:
|
| | | GameWorld.DebugLogEx("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s", tagPlayerID, defLineupID, playerID)
|