From 011fc7f573e78d0f9fe97089122895dee5c3123b Mon Sep 17 00:00:00 2001 From: philipmi Date: Fri, 19 Feb 2021 18:12:25 +0100 Subject: [PATCH] Make a Capture Rate of 33% and 10 captures a requirement for pro players --- mods/ctf/ctf_map/ctf_map_core/chest.lua | 5 +++-- mods/ctf/ctf_stats/init.lua | 3 ++- mods/other/random_messages/init.lua | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mods/ctf/ctf_map/ctf_map_core/chest.lua b/mods/ctf/ctf_map/ctf_map_core/chest.lua index 7d878c3..13596c2 100644 --- a/mods/ctf/ctf_map/ctf_map_core/chest.lua +++ b/mods/ctf/ctf_map/ctf_map_core/chest.lua @@ -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 .. diff --git a/mods/ctf/ctf_stats/init.lua b/mods/ctf/ctf_stats/init.lua index 4c10bd2..b312c8b 100644 --- a/mods/ctf/ctf_stats/init.lua +++ b/mods/ctf/ctf_stats/init.lua @@ -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) diff --git a/mods/other/random_messages/init.lua b/mods/other/random_messages/init.lua index a6f9612..60955f6 100644 --- a/mods/other/random_messages/init.lua +++ b/mods/other/random_messages/init.lua @@ -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.",