From 29a0861aefe9693f7b39220861dadc27a39dfe78 Mon Sep 17 00:00:00 2001 From: ANAND Date: Tue, 19 Mar 2019 22:34:41 +0530 Subject: [PATCH] Add HUD score elements for flag pickup and capture (#378) --- mods/ctf/ctf_stats/init.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_stats/init.lua b/mods/ctf/ctf_stats/init.lua index abfd305..24beeca 100644 --- a/mods/ctf/ctf_stats/init.lua +++ b/mods/ctf/ctf_stats/init.lua @@ -157,6 +157,12 @@ table.insert(ctf_flag.registered_on_capture, 1, function(name, flag) ctf.needs_save = true end winner_player = name + + hud_score.new(name, { + name = "ctf_stats:flag_capture", + color = "0xFF00FF", + value = 25 + }) end) ctf_match.register_on_winner(function(winner) @@ -207,11 +213,17 @@ ctf_flag.register_on_pick_up(function(name, flag) local main, match = ctf_stats.player(name) if main and match then main.attempts = main.attempts + 1 - main.score = main.score + 5 + main.score = main.score + 10 match.attempts = match.attempts + 1 match.score = match.score + 10 ctf.needs_save = true end + + hud_score.new(name, { + name = "ctf_stats:flag_pick_up", + color = "0xAA00AA", + value = 10 + }) end) ctf_flag.register_on_precapture(function(name, flag)