]> git.lizzy.rs Git - coronaserver.git/commitdiff
Addded Spirit
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 31 May 2020 13:36:39 +0000 (15:36 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 31 May 2020 13:36:39 +0000 (15:36 +0200)
init.lua
spirit.lua

index ecb10023eaba54b0a5bd0b677db7de100d426609..3530627489ada99f11c3fc79e2fd4037e97b958b 100755 (executable)
--- a/init.lua
+++ b/init.lua
@@ -1,6 +1,6 @@
 coronaserver = {}
 
-local modules = {"functions", "privs", "ranks", "playerlist", "commands", "teamchat", "chest_control"}
+local modules = {"functions", "privs", "ranks", "playerlist", "commands", "teamchat", "chest_control", "spirit"}
 
 for _, m in pairs(modules) do
     dofile(minetest.get_modpath("coronaserver") .. "/" .. m .. ".lua")
index 15b66f39798518d90b2fcfe7b2ff980b992a9b1a..946c595590e7582bf608805744ff788639de774a 100755 (executable)
@@ -1,47 +1,37 @@
-function coronaserver.flame(name)
+local spirit = false
+function coronaserver.spirit(name)
        local player = minetest.get_player_by_name(name)
        if not player then return end
        local pos = player:get_pos()
        minetest.add_particlespawner({
                amount = 50,
                time = 2,
-               minpos = vector.add(pos, {x = -1, y = 2, z = -1}),
-               maxpos = vector.add(pos, {x = 1, y = 3, z = 1}),
-               minvel = {x=0, y=0, z=0},
-               maxvel = {x=0, y=0, z=0},
-               minacc = {x=0, y=-8, z=0},
-               maxacc = {x=0, y=-8, z=0},
+               minpos = vector.add(pos, {x = -0.1, y = 2, z = -0.1}),
+               maxpos = vector.add(pos, {x =  0.1, y = 3, z =  0.1}),
+               minvel = {x = -0.1, y = 0, z = -0.1},
+               maxvel = {x =  0.1, y = 0, z = -0.1},
+               minacc = {x = -0.1, y = 5, z = -0.1},
+               maxacc = {x =  0.1, y = 7, z =  0.1},
                minexptime = 0.7,
                maxexptime = 1,
                minsize = 5,
-               maxsize = 10,
-               collisiondetection = true,
-               vertical = true,
-               texture = "flowers_rose.png",
+               maxsize = 7,
+               collisiondetection = false,
+               vertical = false,
+               texture = "fire_basic_flame.png",
        })
-       minetest.after(0.5, function() elidragon.flower_rain(name) end)
+       minetest.after(0.5, function() coronaserver.spirit(name) end)
 end
 minetest.register_on_joinplayer(function(player)
-       local name = player:get_player_name()
-       if elidragon.savedata.birthday[name] == os.date("%d/%m") then
-               minetest.chat_send_all(minetest.colorize("#FF20FF", name .. " has joined the game. Today is their birthday!"))
-               elidragon.flower_rain(name)
-               player:hud_add({
-                       hud_elem_type = "text",
-                       position      = {x = 1, y = 0},
-                       offset        = {x = -5, y = 5},
-                       text          = "Happy Birthday!",
-                       alignment     = {x = -1, y = 1},
-                       scale         = {x = 100, y = 100},
-                       number    = 0xFFF40A,
-               })
-       end
+       if spirit then coronaserver.spirit(player:get_player_name()) end
 end)
-minetest.register_chatcommand("birthday", {
-       description = "Set your birthday (e.g. 07/09 if your birthday is the seventh of september)",
-       param = "DD/MM",
-       func = function(name, param)
-               elidragon.savedata.birthday[name] = param
-               minetest.chat_send_player(name, "Birthday set to " .. param)
+minetest.register_chatcommand("spirit", {
+       privs = {server = true},
+       func = function()
+               spirit = true
+               local players = minetest.get_connected_players()
+               for _, player in pairs(players) do
+                       coronaserver.spirit(player:get_player_name())
+               end
        end
 })