From e8bcf8fe14446915da4e4a0fc5c93fceb1feb22e Mon Sep 17 00:00:00 2001 From: philipmi Date: Wed, 26 May 2021 22:13:10 +0200 Subject: [PATCH] Reset pro requirements to original, but with second option --- mods/ctf/ctf_map/ctf_map_core/chest.lua | 6 +++--- mods/ctf/ctf_stats/chat.lua | 10 ++-------- mods/ctf/ctf_stats/init.lua | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/mods/ctf/ctf_map/ctf_map_core/chest.lua b/mods/ctf/ctf_map/ctf_map_core/chest.lua index 3ed9619..a9ef0ba 100644 --- a/mods/ctf/ctf_map/ctf_map_core/chest.lua +++ b/mods/ctf/ctf_map/ctf_map_core/chest.lua @@ -100,10 +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.5;" .. minetest.formspec_escape("You need at least 10000" .. - "\nscore and 1.3+ KD, 10+\ncaptures and a Capture\nRate of at least 33%" .. - "\nto access the pro section") .. "]" + "\nscore and either 1.5+\nKD & 10+ captures or\n1.0+ KD & 30+ captures\nwith a Capture Rate of" .. + "\nat least 33% to access\nthe pro section") .. "]" end formspec = formspec .. diff --git a/mods/ctf/ctf_stats/chat.lua b/mods/ctf/ctf_stats/chat.lua index 5e3eed4..d37942a 100644 --- a/mods/ctf/ctf_stats/chat.lua +++ b/mods/ctf/ctf_stats/chat.lua @@ -236,14 +236,8 @@ minetest.register_chatcommand("makepro", { local stats = ctf_stats.player(param) local deaths = math.max(stats.deaths, 1) - if stats.kills < 1.3 * deaths then - stats.kills = math.ceil(1.31 * 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) + if stats.kills < 1.5 * deaths then + stats.kills = math.ceil(1.51 * deaths) modified = true end diff --git a/mods/ctf/ctf_stats/init.lua b/mods/ctf/ctf_stats/init.lua index b312c8b..f450f25 100644 --- a/mods/ctf/ctf_stats/init.lua +++ b/mods/ctf/ctf_stats/init.lua @@ -208,7 +208,7 @@ function ctf_stats.is_pro(name) local stats = ctf_stats.player(name) local kd = stats.kills / (stats.deaths == 0 and 1 or stats.deaths) 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 ctf.register_on_join_team(function(name, tname, oldteam)