模块:舰娘:修订间差异
舰R百科,玩家自由编辑的战舰少女R百科
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第23行: | 第23行: | ||
p['评分'] = function(frame) | p['评分'] = function(frame) | ||
local stat = stats[frame.args[3]] | local stat = stats[frame.args[3]] | ||
local default = frame.args[ | local default = frame.args[5] | ||
if default == nil then default = '' end | if default == nil then default = '' end | ||
if stat == nil then return default end | if stat == nil then return default end | ||
if ship[frame.args[1]] == 0 then return '-' end | local val | ||
if frame.args[2] == '自定义' then | |||
val = frame.args[4] | |||
if val == nil then return default end | |||
else | |||
local ship = ships[frame.args[2]] | |||
if ship == nil then return default end | |||
val = ship[frame.args[1]] | |||
end | |||
if val == 0 then return '-' end | |||
if stat[frame.args[1]].stddev == 0 then return 100 end | if stat[frame.args[1]].stddev == 0 then return 100 end | ||
if stat[frame.args[1]].stddev == NaN then | if stat[frame.args[1]].stddev == NaN then | ||
if | if val > 0 then return 200 | ||
else return '-' end | else return '-' end | ||
end | end | ||
local stdval = ( | local stdval = (val - stat[frame.args[1]].mean) / stat[frame.args[1]].stddev | ||
local score = (stdval / 3 * 100) + 100 | local score = (stdval / 3 * 100) + 100 | ||
if score > 200 then score = 200 end | if score > 200 then score = 200 end | ||