Make a Capture Rate of 33% and 10 captures a requirement for pro players

This commit is contained in:
philipmi 2021-02-19 18:12:25 +01:00
parent 380a252c7e
commit 011fc7f573
3 changed files with 6 additions and 4 deletions

View file

@ -100,9 +100,10 @@ for _, chest_color in pairs(colors) do
"label[5,-0.2;" ..
minetest.formspec_escape("Pro players only") .. "]"
else
formspec = formspec .. "label[4.75,3;" ..
formspec = formspec .. "label[4.5,2.75;" ..
minetest.formspec_escape("You need at least 10000" ..
"\nscore and 1.5+ KD to\naccess the pro section") .. "]"
"\nscore and 1.3+ KD, 10+\ncaptures and a Capture\nRate of at least 33%" ..
"\nto access the pro section") .. "]"
end
formspec = formspec ..

View file

@ -207,7 +207,8 @@ end
function ctf_stats.is_pro(name)
local stats = ctf_stats.player(name)
local kd = stats.kills / (stats.deaths == 0 and 1 or stats.deaths)
return stats.score >= 10000 and kd >= 1.5
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
end
ctf.register_on_join_team(function(name, tname, oldteam)

View file

@ -56,7 +56,7 @@ function random_messages.read_messages()
"You gain more score the better the opponent you defeat.",
"Find weapons in chests or mine and use furnaces to make stronger swords.",
"Players are immune to attack for 5 seconds after they respawn.",
"Access the pro section of the chest by achieving a 10k+ score and killing 3 people for every 2 deaths.",
"Access the pro section of the chest by achieving a 10k+ score, killing 4 people for every 3 deaths, capturing the flag on every 3rd attempt and at least 10 times.",
"Use team doors (steel) to stop the enemy walking into your base.",
"Craft 6 cobbles and 1 steel ingot together to make reinforced cobble.",
"Sprint by pressing the fast key (E) when you have stamina.",