]> git.lizzy.rs Git - coronaserver.git/blob - spirit.lua
Add event-manager role
[coronaserver.git] / spirit.lua
1 local spirit = false
2
3 function coronaserver.spirit(player)
4         minetest.add_particlespawner({
5                 amount = 50,
6                 time = 2,
7                 minpos = {x = -0.1, y = 0, z = -0.1},
8                 maxpos = {x =  0.1, y = 1, z =  0.1},
9                 minvel = {x = -0.1, y = 0, z = -0.1},
10                 maxvel = {x =  0.1, y = 0, z = -0.1},
11                 minacc = {x = -0.1, y = 5, z = -0.1},
12                 maxacc = {x =  0.1, y = 7, z =  0.1},
13                 minexptime = 0.7,
14                 maxexptime = 1,
15                 minsize = 5,
16                 maxsize = 7,
17                 collisiondetection = true,
18                 vertical = false,
19                 texture = "fire_basic_flame.png",
20                 attached = player,
21         })
22 end
23
24 minetest.register_on_joinplayer(function(player)
25         if spirit then
26                 coronaserver.spirit(player)
27         end
28 end)
29
30 minetest.register_chatcommand("spirit", {
31         privs = {server = true},
32         func = function()
33                 spirit = true
34                 for _, player in pairs(minetest.get_connected_players()) do
35                         coronaserver.spirit(player)
36                 end
37         end
38 })