Formula

CommonFun.CalcTripleSeasonScore

formula.lua
1function CommonFun.CalcTripleSeasonScore(myscore, avescore, teamrank, legendrank, maxscore)
2  if teamrank ~= 1 and teamrank ~= 2 and teamrank ~= 3 and teamrank ~= 7 and teamrank ~= 8 and teamrank ~= 9 then
3    return myscore
4  end
5  local basicscore = {
6    [1] = 8,
7    [2] = 10,
8    [3] = 12,
9    [7] = -12,
10    [8] = -10,
11    [9] = -8
12  }
13  local rankscore = 1
14  if legendrank == 1 then
15    rankscore = 0.5
16  elseif 2 <= legendrank and legendrank <= 4 then
17    rankscore = 0.6
18  elseif 5 <= legendrank and legendrank <= 10 then
19    rankscore = 0.65
20  elseif 11 <= legendrank and legendrank <= 30 then
21    rankscore = 0.73
22  elseif 31 <= legendrank and legendrank <= 60 then
23    rankscore = 0.82
24  elseif 61 <= legendrank and legendrank <= 100 then
25    rankscore = 0.9
26  end
27  local ajustscore = 0
28  local maxscorelv = (maxscore - 600) / 200
29  if 1 <= maxscorelv then
30    for i = 1, maxscorelv do
31      ajustscore = ajustscore + 10 / (i + 2)
32    end
33    ajustscore = ajustscore * basicscore[teamrank] / basicscore[2]
34  end
35  local teamajust = {
36    [0] = 0,
37    [1] = 0.2,
38    [2] = 0.47,
39    [3] = 0.88,
40    [4] = 1.34,
41    [5] = 1.85,
42    [6] = 2.37,
43    [7] = 3.0,
44    [8] = 3.8,
45    [9] = 4.8,
46    [10] = 6.0,
47    [11] = 7.5
48  }
49  local Finalscore = 1
50  if avescore == 0 then
51    Finalscore = (basicscore[teamrank] + ajustscore) * rankscore + myscore
52  else
53    local gaplevel = math.min(math.abs(math.ceil((myscore - avescore) / 50)), 11)
54    Finalscore = (basicscore[teamrank] + ajustscore + (avescore - myscore) / math.max(myscore, avescore) * teamajust[gaplevel]) * rankscore + myscore
55  end
56  if Finalscore < 0 then
57    Finalscore = 0
58  end
59  return Finalscore
60end
Formula Graph

Connected Archive Data

See which cards, equipment, headwears, buffs, and other archived records connect to this formula.

Loading graph filters

CommonFun.CalcTripleSeasonScore

commonfun-calctripleseasonscore

Nodes

0

Edges

0

Related Nodes

Select at least one node type.