diff --git a/mods/ctf_bounties/init.lua b/mods/ctf_bounties/init.lua index a98762c..a668545 100644 --- a/mods/ctf_bounties/init.lua +++ b/mods/ctf_bounties/init.lua @@ -1,9 +1,10 @@ local bountied_player = nil +local bounty_score = 0 local function announce(name) minetest.chat_send_player(name, minetest.colorize("#fff326", "The next person to kill " .. bountied_player .. - " will receive 150 points!")) + " will receive " .. bounty_score .. " points!")) end local function announce_all() @@ -23,9 +24,9 @@ local function bounty_player(target) bountied_player = target - if minetest.global_exists("irc") then - irc:say("Player " .. bountied_player .. " has a bounty on their head!") - end + -- if minetest.global_exists("irc") then + -- irc:say("Player " .. bountied_player .. " has a bounty on their head!") + -- end minetest.after(0.1, announce_all) end @@ -43,6 +44,14 @@ local function bounty_find_new_target() if #players > 0 then bounty_player(players[math.random(1, #players)].name) + + -- Score * K/D + -- bounty_score = -----------, or 500 (whichever is lesser) + -- 10000 + bounty_score = (pstat.score * (pstat.kills / pstat.deaths)) / 10000 + if bounty_score > 500 + bounty_score = 500 + end end minetest.after(math.random(500, 1000), bounty_find_new_target) @@ -65,16 +74,16 @@ ctf.register_on_killedplayer(function(victim, killer) if victim == bountied_player then local main, match = ctf_stats.player(killer) if main and match then - main.score = main.score + 150 - match.score = match.score + 150 + main.score = main.score + bounty_score + match.score = match.score + bounty_score ctf.needs_save = true end bountied_player = nil local msg = killer .. " has killed " .. victim .. " and received the prize!" - if minetest.global_exists("irc") then - irc:say(msg) - end + -- if minetest.global_exists("irc") then + -- irc:say(msg) + -- end minetest.chat_send_all(msg) end end) diff --git a/mods/ctf_stats/gui.lua b/mods/ctf_stats/gui.lua index 5ed5b57..282f008 100644 --- a/mods/ctf_stats/gui.lua +++ b/mods/ctf_stats/gui.lua @@ -44,7 +44,7 @@ function ctf_stats.get_formspec(title, players) "," .. pstat.captures .. "," .. pstat.attempts .. "," .. math.floor(pstat.score*10)/10 - if i > 40 then + if i > 49 then break end end @@ -86,7 +86,7 @@ function ctf_stats.get_html(title, players) "