Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing definition of pro #1122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions mods/ctf/ctf_modebase/features.lua
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,20 @@ return {

-- Remember to update /make_pro in ranking_commands.lua if you change anything here
if rank then
if (rank.score or 0) <= 8000 then
if (rank.score or 0) >= 10 then
return true, deny_pro
else
return false, deny_pro
end
end
if
(rank.score or 0) >= 8000 and
(rank.kills or 0) / (rank.deaths or 1) >= 1.4 and
(rank.flag_captures or 0) >= 5
((rank.kills or 0) + (rank.kill_assists or 0) * 0.34) / (rank.deaths or 1) >= 1.4 or
(rank.flag_captures or 0) / (rank.deaths or 1) >= 1/14 or
(rank.hp_healed or 0) / (rank.deaths or 1) >= 30
then
return true, true
end

if (rank.score or 0) >= 10 then
return true, deny_pro
end
end

return "You need at least 10 score to access this chest", deny_pro
Expand Down
2 changes: 1 addition & 1 deletion mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ minetest.register_chatcommand("make_pro", {
return false, string.format("Player '%s' has no rankings!", pname)
end

mode_data.rankings:add(pname, {score = 8000, kills = 7, deaths = 5, flag_captures = 5})
mode_data.rankings:add(pname, {score = 8000, kills = 7, deaths = 5, flag_captures = 1, hp_healed = 100})

minetest.log("action", string.format(
"[ctf_admin] %s made player '%s' a pro in mode %s: %s", name, pname, mode_name, dump(old_ranks)
Expand Down