parent
9427ec4d38
commit
9c884d2228
15
auto.lua
15
auto.lua
@ -16,24 +16,31 @@ arena_lib.on_start("tnttag", function(arena)
|
||||
tnttag.newwave(arena)
|
||||
end)
|
||||
|
||||
arena_lib.on_join("tnttag", function(p_name, arena, as_spectator)
|
||||
if as_spectator then
|
||||
tnttag.generate_HUD(arena, p_name)
|
||||
end
|
||||
end)
|
||||
|
||||
arena_lib.on_quit("tnttag", function(arena, p_name, is_spectator, reason)
|
||||
if not is_spectator then
|
||||
tnttag.remove_tnthead(p_name)
|
||||
tnttag.remove_HUD(arena, p_name)
|
||||
end
|
||||
tnttag.remove_HUD(arena, p_name)
|
||||
end)
|
||||
|
||||
arena_lib.on_eliminate("tnttag", function(arena, p_name)
|
||||
tnttag.remove_tnthead(p_name)
|
||||
tnttag.remove_HUD(arena, p_name)
|
||||
end)
|
||||
|
||||
arena_lib.on_celebration("tnttag", function(arena, winner)
|
||||
arena.current_time = 0
|
||||
for p_name,stats in pairs(arena.players) do
|
||||
for p_name in pairs(arena.players) do
|
||||
tnttag.remove_tnthead(p_name)
|
||||
end
|
||||
tnttag.remove_HUD(arena, winner)
|
||||
for p_name in pairs(arena.players_and_spectators) do
|
||||
tnttag.remove_HUD(arena, p_name)
|
||||
end
|
||||
end)
|
||||
|
||||
arena_lib.on_time_tick("tnttag", function(arena)
|
||||
|
6
hud.lua
6
hud.lua
@ -93,21 +93,21 @@ function tnttag.remove_HUD(arena, p_name)
|
||||
end
|
||||
|
||||
function tnttag.update_player_count_hud(arena)
|
||||
for p_name in pairs(arena.players) do
|
||||
for p_name in pairs(arena.players_and_spectators) do
|
||||
local player = minetest.get_player_by_name(p_name)
|
||||
player:hud_change(tnttag.saved_huds[p_name].player_count, "text", tostring(arena.players_amount) .. "/" .. tostring(arena.original_player_amount))
|
||||
end
|
||||
end
|
||||
|
||||
function tnttag.update_wave_timer_hud(arena)
|
||||
for p_name in pairs(arena.players) do
|
||||
for p_name in pairs(arena.players_and_spectators) do
|
||||
local player = minetest.get_player_by_name(p_name)
|
||||
player:hud_change(tnttag.saved_huds[p_name].wave_timer, "text", arena.current_time%arena.wavetime)
|
||||
end
|
||||
end
|
||||
|
||||
function tnttag.update_wave_counter_hud(arena)
|
||||
for p_name in pairs(arena.players) do
|
||||
for p_name in pairs(arena.players_and_spectators) do
|
||||
local player = minetest.get_player_by_name(p_name)
|
||||
player:hud_change(tnttag.saved_huds[p_name].wave_counter, "text", tostring(arena.current_wave).."/"..tostring(arena.waves))
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user