Display kill score as a HUD element (#182)

This commit is contained in:
ClobberXD 2018-11-12 11:45:51 +05:30 committed by GitHub
parent d111d8673a
commit 77cdecc15e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 83 additions and 1 deletions

View file

@ -44,6 +44,9 @@ local function bounty_player(target)
end
bounty_score = math.floor(bounty_score)
ctf_stats.current_bounty["name"] = bountied_player
ctf_stats.current_bounty["score"] = bounty_score
minetest.after(0.1, announce_all)
end
@ -70,6 +73,7 @@ minetest.after(math.random(500, 1000), bounty_find_new_target)
minetest.register_on_leaveplayer(function(player)
if bountied_player == player:get_player_name() then
bountied_player = nil
ctf_stats.current_bounty = {}
end
end)
@ -92,6 +96,7 @@ ctf.register_on_killedplayer(function(victim, killer)
ctf.needs_save = true
end
bountied_player = nil
ctf_stats.current_bounty = {}
local msg = killer .. " has killed " .. victim .. " and received the prize!"
minetest.chat_send_all(msg)