Reset pro requirements to original, but with second option

This commit is contained in:
philipmi 2021-05-26 22:13:10 +02:00
parent b117cf0ea9
commit e8bcf8fe14
3 changed files with 6 additions and 12 deletions

View file

@ -100,10 +100,10 @@ for _, chest_color in pairs(colors) do
"label[5,-0.2;" .. "label[5,-0.2;" ..
minetest.formspec_escape("Pro players only") .. "]" minetest.formspec_escape("Pro players only") .. "]"
else else
formspec = formspec .. "label[4.75,3;" .. formspec = formspec .. "label[4.5,2.5;" ..
minetest.formspec_escape("You need at least 10000" .. minetest.formspec_escape("You need at least 10000" ..
"\nscore and 1.3+ KD, 10+\ncaptures and a Capture\nRate of at least 33%" .. "\nscore and either 1.5+\nKD & 10+ captures or\n1.0+ KD & 30+ captures\nwith a Capture Rate of" ..
"\nto access the pro section") .. "]" "\nat least 33% to access\nthe pro section") .. "]"
end end
formspec = formspec .. formspec = formspec ..

View file

@ -236,14 +236,8 @@ minetest.register_chatcommand("makepro", {
local stats = ctf_stats.player(param) local stats = ctf_stats.player(param)
local deaths = math.max(stats.deaths, 1) local deaths = math.max(stats.deaths, 1)
if stats.kills < 1.3 * deaths then if stats.kills < 1.5 * deaths then
stats.kills = math.ceil(1.31 * deaths) stats.kills = math.ceil(1.51 * deaths)
modified = true
end
local attempts = math.max(stats.attempts, 1)
if stats.captures < 0.33 * attempts then
stats.captures = math.ceil(0.331 * attempts)
modified = true modified = true
end end

View file

@ -208,7 +208,7 @@ function ctf_stats.is_pro(name)
local stats = ctf_stats.player(name) local stats = ctf_stats.player(name)
local kd = stats.kills / (stats.deaths == 0 and 1 or stats.deaths) local kd = stats.kills / (stats.deaths == 0 and 1 or stats.deaths)
local ca = stats.captures / (stats.attempts == 0 and 1 or stats.attempts) local ca = stats.captures / (stats.attempts == 0 and 1 or stats.attempts)
return stats.score >= 10000 and kd >= 1.3 and ca >= 0.33 and stats.captures >= 10 return (stats.score >= 10000 and kd >= 1.5 and stats.captures >= 10) or (stats.score >= 10000 and kd >= 1.0 and ca >= 0.33 and stats.captures >= 30)
end end
ctf.register_on_join_team(function(name, tname, oldteam) ctf.register_on_join_team(function(name, tname, oldteam)