Formula

CommonFun.CalcTripleSeasonScore

function CommonFun.CalcTripleSeasonScore(myscore, avescore, teamrank, legendrank, maxscore)
  if teamrank ~= 1 and teamrank ~= 2 and teamrank ~= 3 and teamrank ~= 7 and teamrank ~= 8 and teamrank ~= 9 then
    return myscore
  end
  local basicscore = {
    [1] = 8,
    [2] = 10,
    [3] = 12,
    [7] = -12,
    [8] = -10,
    [9] = -8
  }
  local rankscore = 1
  if legendrank == 1 then
    rankscore = 0.5
  elseif 2 <= legendrank and legendrank <= 4 then
    rankscore = 0.6
  elseif 5 <= legendrank and legendrank <= 10 then
    rankscore = 0.65
  elseif 11 <= legendrank and legendrank <= 30 then
    rankscore = 0.73
  elseif 31 <= legendrank and legendrank <= 60 then
    rankscore = 0.82
  elseif 61 <= legendrank and legendrank <= 100 then
    rankscore = 0.9
  end
  local ajustscore = 0
  local maxscorelv = (maxscore - 600) / 200
  if 1 <= maxscorelv then
    for i = 1, maxscorelv do
      ajustscore = ajustscore + 10 / (i + 2)
    end
    ajustscore = ajustscore * basicscore[teamrank] / basicscore[2]
  end
  local teamajust = {
    [0] = 0,
    [1] = 0.2,
    [2] = 0.47,
    [3] = 0.88,
    [4] = 1.34,
    [5] = 1.85,
    [6] = 2.37,
    [7] = 3.0,
    [8] = 3.8,
    [9] = 4.8,
    [10] = 6.0,
    [11] = 7.5
  }
  local Finalscore = 1
  if avescore == 0 then
    Finalscore = (basicscore[teamrank] + ajustscore) * rankscore + myscore
  else
    local gaplevel = math.min(math.abs(math.ceil((myscore - avescore) / 50)), 11)
    Finalscore = (basicscore[teamrank] + ajustscore + (avescore - myscore) / math.max(myscore, avescore) * teamajust[gaplevel]) * rankscore + myscore
  end
  if Finalscore < 0 then
    Finalscore = 0
  end
  return Finalscore
end