]> git.lizzy.rs Git - coronaserver.git/blob - spirit.lua
Removed a whitespace
[coronaserver.git] / spirit.lua
1 function coronaserver.flame(name)
2         local player = minetest.get_player_by_name(name)
3         if not player then return end
4         local pos = player:get_pos()
5         minetest.add_particlespawner({
6                 amount = 50,
7                 time = 2,
8                 minpos = vector.add(pos, {x = -1, y = 2, z = -1}),
9                 maxpos = vector.add(pos, {x = 1, y = 3, z = 1}),
10                 minvel = {x=0, y=0, z=0},
11                 maxvel = {x=0, y=0, z=0},
12                 minacc = {x=0, y=-8, z=0},
13                 maxacc = {x=0, y=-8, z=0},
14                 minexptime = 0.7,
15                 maxexptime = 1,
16                 minsize = 5,
17                 maxsize = 10,
18                 collisiondetection = true,
19                 vertical = true,
20                 texture = "flowers_rose.png",
21         })
22         minetest.after(0.5, function() elidragon.flower_rain(name) end)
23 end
24 minetest.register_on_joinplayer(function(player)
25         local name = player:get_player_name()
26         if elidragon.savedata.birthday[name] == os.date("%d/%m") then
27                 minetest.chat_send_all(minetest.colorize("#FF20FF", name .. " has joined the game. Today is their birthday!"))
28                 elidragon.flower_rain(name)
29                 player:hud_add({
30                         hud_elem_type = "text",
31                         position      = {x = 1, y = 0},
32                         offset        = {x = -5, y = 5},
33                         text          = "Happy Birthday!",
34                         alignment     = {x = -1, y = 1},
35                         scale         = {x = 100, y = 100},
36                         number    = 0xFFF40A,
37                 })
38         end
39 end)
40 minetest.register_chatcommand("birthday", {
41         description = "Set your birthday (e.g. 07/09 if your birthday is the seventh of september)",
42         param = "DD/MM",
43         func = function(name, param)
44                 elidragon.savedata.birthday[name] = param
45                 minetest.chat_send_player(name, "Birthday set to " .. param)
46         end
47 })