| | |
| | | def __GetRobotLVRange():
|
| | | ## 获取赛季机器人等级范围
|
| | | worldLV = max(1, PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv))
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | maxCnt = ipyDataMgr.GetWorldLVCount()
|
| | | worldLVTime = 0
|
| | | if worldLV <= maxCnt:
|
| | | worldLVIpyData = ipyDataMgr.GetWorldLVByIndex(worldLV - 1)
|
| | | worldLVTime = worldLVIpyData.GetOpenServerSecond()
|
| | | |
| | | minLV, maxLV = IpyGameDataPY.GetFuncEvalCfg("ArenaRobot", 2) # 机器人最小、最大等级
|
| | | robotMaxLV = eval(IpyGameDataPY.GetFuncCfg("ArenaRobot", 3))
|
| | | |
| | | robotMaxLV = minLV
|
| | | maxWorldLVTime = eval(IpyGameDataPY.GetFuncCfg("ArenaRobot", 3))
|
| | | for i in xrange(worldLV - 1, maxCnt):
|
| | | ipyData = ipyDataMgr.GetWorldLVByIndex(i)
|
| | | if i == maxCnt - 1:
|
| | | robotMaxLV = ipyData.GetWorldLV()
|
| | | else:
|
| | | nextIpyData = IpyGameDataPY.IPY_Data().GetWorldLVByIndex(i + 1)
|
| | | if ipyData.GetOpenServerSecond() <= maxWorldLVTime < nextIpyData.GetOpenServerSecond():
|
| | | robotMaxLV = ipyData.GetWorldLV()
|
| | | break
|
| | | |
| | | robotMaxLV = max(minLV, min(maxLV, robotMaxLV))
|
| | | GameWorld.Log(" 机器人等级范围: worldLV=%s,minLV=%s,maxLV=%s,robotMaxLV=%s" |
| | | % (worldLV, minLV, maxLV, robotMaxLV))
|
| | | GameWorld.Log(" 机器人等级范围: worldLV=%s,worldLVTime=%s,maxWorldLVTime=%s,minLV=%s,robotMaxLV=%s" |
| | | % (worldLV, worldLVTime, maxWorldLVTime, minLV, robotMaxLV))
|
| | | return minLV, robotMaxLV
|
| | |
|
| | | def __RandRobotScoreList(robotMaxCount):
|
| | |
| | | if gmMatchOrder in matchOrderList:
|
| | | continue
|
| | | gmMatchOrderList.append(gmMatchOrder)
|
| | | GameWorld.DebugAnswer(curPlayer, "指定匹配ID(%s),order(%s)" % (gmMatchID, gmMatchOrder), playerID)
|
| | | GameWorld.DebugAnswer(curPlayer, "指定匹配ID(%s),order(%s)" % (gmMatchID, gmMatchOrder))
|
| | |
|
| | | GameWorld.DebugLog("matchOrderList=%s,needMatchCount=%s" % (str(matchOrderList), needMatchCount))
|
| | | if matchOrderList:
|
| | |
| | |
|
| | | opInfo = ""
|
| | | # 结算自己
|
| | | addScore = __CalcBattleAddScore(curScore, tagScore, isWin)
|
| | | addScore = __CalcBattleAddScore(playerID, curScore, tagScore, isWin)
|
| | | updScore = max(0, playerScore + addScore)
|
| | | GameWorld.DebugLog(" 更新自身积分: addScore=%s,updScore=%s" % (addScore, updScore), playerID)
|
| | |
|
| | |
| | | randItemList = IpyGameDataPY.GetFuncEvalCfg("ArenaBattleAward", 3)
|
| | | awardItemInfo = GameWorld.GetResultByRandomList(randItemList)
|
| | | if awardItemInfo:
|
| | | awardItemList.append(awardItemInfo)
|
| | | |
| | | awardItemList.append(awardItemInfo[:3])
|
| | | isWorldNotify = awardItemInfo[3] if len(awardItemInfo) > 3 else 0
|
| | | if isWorldNotify:
|
| | | PlayerControl.WorldNotify(0, "ArenaWinerItem", [curPlayer.GetName(), awardItemInfo[0], "", awardItemInfo[1]])
|
| | | |
| | | # 结算对手,仅玩家时结算,机器人不处理
|
| | | if tagPlayerID > MaxRobotID:
|
| | | tagAddScore = __CalcBattleAddScore(tagScore, curScore, not isWin)
|
| | | tagAddScore = __CalcBattleAddScore(tagPlayerID, tagScore, curScore, not isWin)
|
| | | updTagScore = max(0, tagScore + tagAddScore)
|
| | | GameWorld.DebugLog(" 更新对手积分: tagAddScore=%s,updTagScore=%s" % (tagAddScore, updTagScore), playerID)
|
| | | tagCache = PlayerViewCache.FindViewCache(tagPlayerID)
|
| | |
| | | cmdStr, len(cmdStr), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | | def __CalcBattleAddScore(curScore, tagScore, isWin):
|
| | | def __CalcBattleAddScore(playerID, curScore, tagScore, isWin):
|
| | | ## 计算对战增加积分
|
| | | diffScore = curScore - tagScore # 积分差,有正负
|
| | | calcScoreFormatDict = IpyGameDataPY.GetFuncEvalCfg("ArenaBattleAward", 1) if isWin else IpyGameDataPY.GetFuncEvalCfg("ArenaBattleAward", 2)
|
| | | scoreKeyList = calcScoreFormatDict.keys()
|
| | | scoreKeyList.sort()
|
| | | calcKey = ""
|
| | | calcKey = None
|
| | | for scoreKey in scoreKeyList:
|
| | | if diffScore <= scoreKey:
|
| | | calcKey = scoreKey
|
| | | break
|
| | |
|
| | | if not calcKey:
|
| | | if calcKey == None:
|
| | | GameWorld.ErrLog(" 计算得分公式: playerID=%s,diffScore=%s,scoreKeyList=%s,isWin=%s 找不到对应key公式" |
| | | % (playerID, diffScore, scoreKeyList, isWin))
|
| | | return 0
|
| | |
|
| | | compileKey = "ArenaBattleScore_%s_%s" % (int(isWin), str(calcKey))
|
| | | formatStr = calcScoreFormatDict[calcKey]
|
| | | addScore = eval(FormulaControl.GetCompileFormula(compileKey, formatStr))
|
| | | GameWorld.DebugLog(" 计算得分公式: diffScore=%s,isWin=%s,compileKey=%s,formatStr=%s,addScore=%s" |
| | | % (diffScore, isWin, compileKey, formatStr, addScore))
|
| | | GameWorld.DebugLog(" 计算得分公式: playerID=%s,diffScore=%s,scoreKeyList=%s,isWin=%s,compileKey=%s,formatStr=%s,addScore=%s" |
| | | % (playerID, diffScore, scoreKeyList, isWin, compileKey, formatStr, addScore))
|
| | | return addScore
|
| | |
|
| | | #// A9 A8 查看竞技场对战记录 #tagCGQueryArenaBattleRecord
|