43 lines
1.0 KiB
Lua
Raw Normal View History

2018-04-25 18:51:52 -05:00
-- CAPTURE THE FLAG
-- by Andrew "rubenwardy" Ward
-----------------------------------------
ctf = {}
-- Fix for https://github.com/minetest/minetest/issues/2383
local csa = minetest.chat_send_all
function minetest.chat_send_all(msg)
minetest.after(0, function()
csa(msg)
end)
end
-- Privs
minetest.register_privilege("ctf_team_mgr", {
description = "Team manager",
})
minetest.register_privilege("ctf_admin", {
description = "Can create teams, manage players, assign team owners.",
})
-- Modules
dofile(minetest.get_modpath("ctf") .. "/core.lua")
dofile(minetest.get_modpath("ctf") .. "/teams.lua")
dofile(minetest.get_modpath("ctf") .. "/diplomacy.lua")
dofile(minetest.get_modpath("ctf") .. "/gui.lua")
dofile(minetest.get_modpath("ctf") .. "/hud.lua")
2018-12-27 19:42:59 -05:00
dofile(minetest.get_modpath("ctf") .. "/power.lua")
2018-04-25 18:51:52 -05:00
-- Init
ctf.init()
ctf.clean_player_lists()
2018-12-27 19:42:59 -05:00
-- Start power ticker
local power_tick = 300 -- 5 mins
local function power_tick_func()
ctf.on_power_tick()
minetest.after(power_tick, power_tick_func)
end
minetest.after(power_tick, power_tick_func)