跳转到内容

模組:Scoring/DC18

维基百科,自由的百科全书

这是本页的一个历史版本,由Sanmosa留言 | 贡献2020年6月30日 (二) 00:27 (VIA W+编辑。这可能和当前版本存在着巨大的差异。

local final_assessment = {}
function final_assessment.calculate()
	local args = mw.getCurrentFrame().args
	local score = 0
	local length = tonumber(args.length, 10)
	local spokenlength = tonumber(args.spokenlength, 10)
	local picnum = tonumber(args.picnum, 10)
	local pictranslength = tonumber(args.pictranslength, 10)
	local videolength = tonumber(args.videolength, 10)
	if args.rank == 'FA' then
		score = 20 + 1.5 * (length / 1000)
	elseif args.rank == 'FL' then
		score = 20 + (length / 1000)
	elseif args.rank == 'GA' then
		score = 15 + (length / 1000)
	elseif args.rank == 'normal' then
		if length <= 100000 then
			score = -0.003 * (length / 1000) ^ 2 + 0.6 * (length / 1000)
		else
			score = 30
		end
	end
	--如果长度不合标准则归零
	if length < 3500 then
		score = 0
	end
	if args.isnew == '0' then
		--如果不是新条目
		if length == 3500 then
			score = 0
		end
		if args.rank == 'normal' then
			score = score * 1.05
		elseif args.rank == 'FA' then
			score = score * 1.2
		else
			score = score * 1.1
		end
	end
	--大中小动员令加成
	score = score * tonumber(args.cat, 10)
	--如果有有聲條目則加成
	if args.spokencheck == '1' then
		if (spokenlength / 1000) * 0.1 < 1 then
			score = score + 1.5
		else
			score = score + 0.15 * (spokenlength / 1000)
		end
	end
	--如果有原創圖片條目則加成
	if args.piccheck == '1' then
		score = score + (10 * math.min(6, math.min(length/2000, picnum))) ^ 0.7
		score = score + 0.3 * (pictranslength) ^ 0.7
	end
	--如果有原創影片則加成
	if args.videocheck == '1' then
		if videolength >= 45 then
			score = score + 7 * (45) ^ 0.3 - 6
		else
			score = score + 7 * (videolength) ^ 0.3 - 6
		end
	end
	--精确到 0.1,四舍五入(Lua 没有 math.round)
	score = math.floor(score * 10 + 5) / 10
	return score
end
return final_assessment