diff --git a/mods/fail/README.md b/mods/fail/README.md index 9dfb2b7e..e74f1380 100644 --- a/mods/fail/README.md +++ b/mods/fail/README.md @@ -4,6 +4,10 @@ Minetest Mod Fail Minetest's mod Fail. Based on an idea By Mg (@LeMagnesium). Future features : -- Cookies' support -- Create a use for the cookies and the FailPoints +- Create a use for cookies and FailPoints - Create a way to materialize cookies and FailPoints + +Version: +0.0 : Intial code, basic mod +0.1 : Added options about output stream for the messages and player's presence check +0.2 : Added sounds by Cyberpangolin, played when a FP/CK command is launched diff --git a/mods/fail/cookie.lua b/mods/fail/cookie.lua index 7d8274b0..3f57d7c1 100644 --- a/mods/fail/cookie.lua +++ b/mods/fail/cookie.lua @@ -55,11 +55,18 @@ minetest.register_chatcommand("cookie", { return end - minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===") + minetest.chat_send_player(name,"=== CK_DEBUG_LINES SENT ===") + print("=== CK_DEBUG_LINES ===") local send_admin = function(msg) minetest.chat_send_player(name,msg) end + send_admin("CK File") + if pntf ~= nil then + send_admin("Found") + else + send_admin("Missing!") + end table.foreach(data,print) return @@ -125,8 +132,13 @@ minetest.register_chatcommand("cookie", { minetest.log("action","[FailPoints] "..name.." has given a CooKie to "..param) minetest.log("action","[FailPoints] "..param.." now own "..data.cookies[param].."CKs") minetest.log("action","[FailPoints] "..name.." now own "..(data.cookies[name] or 0).."CKs") + minetest.sound_play({ + name = "cookie", + to_player = param, + gain = 0.1 + }) local message_reason = "." - if param2 ~= "" then + if param2 ~= nil then local m_table = paramlist table.remove(m_table,1) message_reason = " because " diff --git a/mods/fail/init.lua b/mods/fail/init.lua index 3ddf92d3..50fc001a 100644 --- a/mods/fail/init.lua +++ b/mods/fail/init.lua @@ -9,6 +9,8 @@ "Congratulation, you win a failpoint." +License GPLv2 + ]]-- -- The FailPoint mod by Mg. @@ -18,7 +20,7 @@ data = {} data.fp_file = minetest.get_worldpath().."/failpoints" data.failpoints = {} -data.fp_version = 0.1 +data.fp_version = 0.2 -- fp_create priv to create failpoints minetest.register_privilege("fp_create","Is able to create FailPoints and give them to anybody else") @@ -102,10 +104,17 @@ minetest.register_chatcommand("fail", { end minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===") + print("=== FP_DEBUG_LINES ===") local send_admin = function(msg) minetest.chat_send_player(name,msg) end + send_admin("FP File") + if pntf ~= nil then + send_admin("Found") + else + send_admin("Missing!") + end table.foreach(data,print) return @@ -172,7 +181,7 @@ minetest.register_chatcommand("fail", { minetest.log("action","[FailPoints] "..param.." now own "..data.failpoints[param].."FPs") minetest.log("action","[FailPoints] "..name.." now own "..(data.failpoints[name] or 0).."FPs") local message_reason = "." - if param2 ~= "" then + if param2 ~= nil then local m_table = paramlist table.remove(m_table,1) message_reason = " because " @@ -181,6 +190,11 @@ minetest.register_chatcommand("fail", { end end data.send_func(param,"Congratulations "..param..", you win a failpoint" .. message_reason) + minetest.sound_play({ + name = "failpoint", + to_player = param, + gain = 1.0 + }) minetest.chat_send_player(name,"FP sent.") end end diff --git a/mods/fail/sounds/cookie.ogg b/mods/fail/sounds/cookie.ogg new file mode 100644 index 00000000..286d7061 Binary files /dev/null and b/mods/fail/sounds/cookie.ogg differ diff --git a/mods/fail/sounds/failpoint.ogg b/mods/fail/sounds/failpoint.ogg new file mode 100644 index 00000000..12cda9c1 Binary files /dev/null and b/mods/fail/sounds/failpoint.ogg differ