From e9487c6bde63a692c7d3b9245540b4a3fd2fed2f Mon Sep 17 00:00:00 2001 From: MinetestSam <42088654+MinetestSam@users.noreply.github.com> Date: Wed, 24 Feb 2021 22:23:07 +0530 Subject: [PATCH 1/3] Consider captures as a requirement for pro players (#541) Co-authored-by: LoneWolfHT --- mods/ctf/ctf_map/ctf_map_core/chest.lua | 2 +- mods/ctf/ctf_stats/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 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..6fd8775 100644 --- a/mods/ctf/ctf_map/ctf_map_core/chest.lua +++ b/mods/ctf/ctf_map/ctf_map_core/chest.lua @@ -102,7 +102,7 @@ for _, chest_color in pairs(colors) do else formspec = formspec .. "label[4.75,3;" .. minetest.formspec_escape("You need at least 10000" .. - "\nscore and 1.5+ KD to\naccess the pro section") .. "]" + "\nscore, 1.5+ KD and 10+\ncaptures to access the\npro section") .. "]" end formspec = formspec .. diff --git a/mods/ctf/ctf_stats/init.lua b/mods/ctf/ctf_stats/init.lua index 4c10bd2..8531dcd 100644 --- a/mods/ctf/ctf_stats/init.lua +++ b/mods/ctf/ctf_stats/init.lua @@ -207,7 +207,7 @@ 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 + return stats.score >= 10000 and kd >= 1.5 and stats.captures >= 10 end ctf.register_on_join_team(function(name, tname, oldteam) From 0282bce349c200ed53fd048bf1edae844590df92 Mon Sep 17 00:00:00 2001 From: Toby1710 <69259430+DiamondPlane@users.noreply.github.com> Date: Thu, 25 Feb 2021 16:27:49 +0200 Subject: [PATCH 2/3] Change grapple hook warning message (#808) Co-authored-by: Toby1710 <69259430+Toby1710@users.noreply.github.com> --- mods/ctf/ctf_classes/ranged.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ctf/ctf_classes/ranged.lua b/mods/ctf/ctf_classes/ranged.lua index c0ebf4c..2abcffa 100644 --- a/mods/ctf/ctf_classes/ranged.lua +++ b/mods/ctf/ctf_classes/ranged.lua @@ -49,7 +49,7 @@ local function check_grapple(itemname) on_use = function(itemstack, user, ...) if not ctf_classes.get(user).properties.allow_grapples then minetest.chat_send_player(user:get_player_name(), - "Your class can't use that weapon! Change your class at spawn") + "Your class can't use that weapon! Change your class at base") return itemstack end From 9e20609ed633c07d46e2dd36fde6f3a602871057 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Thu, 25 Feb 2021 06:42:13 -0800 Subject: [PATCH 3/3] Fix /makepro not handling captures --- mods/ctf/ctf_stats/chat.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ctf/ctf_stats/chat.lua b/mods/ctf/ctf_stats/chat.lua index a3f3aa5..0d5e921 100644 --- a/mods/ctf/ctf_stats/chat.lua +++ b/mods/ctf/ctf_stats/chat.lua @@ -240,6 +240,11 @@ minetest.register_chatcommand("makepro", { modified = true end + if stats.captures < 10 then + stats.captures = 10 + modified = true + end + if modified then ctf_stats.request_save() return true, "Made " .. param .. " a pro!"