summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-10-22 13:14:14 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-10-22 13:14:14 +0200
commitead9f0fac5a177a88e0751d44181c6e906b81344 (patch)
tree95111947a02050709f89d0a55a196aaa88fc2ad4
parent50e5c520713a4031ae23d8693a443984be9ac263 (diff)
Added Readme and License file, minimum depth can now be configured, gunpowder cannot be lighted above that minimum depth so players are not annoyed.HEADorigin/masterorigin/HEADmaster
-rw-r--r--LICENSE3
-rw-r--r--README.txt37
-rw-r--r--init.lua13
3 files changed, 48 insertions, 5 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..aedb392
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,3 @@
+Sounds: alarm.ogg
+ Source: https://commons.wikimedia.org/wiki/File:BABS_-_Allgemeiner_Alarm.ogg
+ License: Public domain \ No newline at end of file
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..df98f7e
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,37 @@
+Minetest Game mod: tnt
+======================
+by PilzAdam and ShadowNinja
+
+Introduction:
+This mod adds TNT to Minetest. TNT is a tool to help the player
+in mining.
+
+How to use the mod:
+Craft gunpowder by placing coal and gravel in the crafting area. The
+gunpowder can be used to craft TNT or as fuze for TNT. To craft TNT
+surround gunpowder with 4 wood in a + shape.
+There are different ways to blow up TNT:
+ 1. Hit it with a torch.
+ 2. Hit a gunpowder fuze that leads to a TNT block with a torch.
+ 3. Activate it with mesecons (fastest way)
+Be aware of the damage radius of 7 blocks!
+
+License:
+WTFPL (see below)
+
+See also:
+http://minetest.net/
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/init.lua b/init.lua
index 66c22d7..fe5d749 100644
--- a/init.lua
+++ b/init.lua
@@ -3,6 +3,8 @@ tnt = {}
local singleplayer = minetest.is_singleplayer()
local setting = minetest.setting_getbool("enable_tnt")
setting = true -- this mod is multiplayer-safe, so enable it.
+local tntmindepth = tonumber(minetest.setting_get("tnt_mindepth")) or -100
+
if (not singleplayer and setting ~= true) or
(singleplayer and setting == false) then
return
@@ -364,8 +366,8 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
end
function tnt.boom(pos, def)
- if pos.y > -100 then
--- minetest.chat_send_all("TNT can only explode when deeper than -100")
+ if pos.y > tntmindepth then
+-- check if we're deep enough
minetest.set_node(pos, {name = "tnt:tnt"})
return
end
@@ -417,9 +419,10 @@ minetest.register_node("tnt:gunpowder", {
sounds = default.node_sound_leaves_defaults(),
on_punch = function(pos, node, puncher)
- if puncher:get_wielded_item():get_name() == "default:torch" then
- tnt.burn(pos)
- end
+ if puncher:get_wielded_item():get_name() == "default:torch" and pos.y < (tntmindepth + 16)then
+ -- check if we're deep enough, don't annoy people with the air-raid sound.
+ tnt.burn(pos)
+ end
end,
on_blast = function(pos, intensity)
tnt.burn(pos)