]> git.scottworley.com Git - more_tnt/commitdiff
TNT Rain master
authorClaire Worley <claireworley@claireworley.com>
Wed, 25 Nov 2020 03:41:08 +0000 (19:41 -0800)
committerClaire Worley <claireworley@claireworley.com>
Wed, 25 Nov 2020 03:41:08 +0000 (19:41 -0800)
depends.txt [new file with mode: 0644]
init.lua [new file with mode: 0644]
textures/tnt_rain_bottom.png [new file with mode: 0644]
textures/tnt_rain_side.png [new file with mode: 0644]
textures/tnt_rain_top.png [new file with mode: 0644]

diff --git a/depends.txt b/depends.txt
new file mode 100644 (file)
index 0000000..4ad96d5
--- /dev/null
@@ -0,0 +1 @@
+default
diff --git a/init.lua b/init.lua
new file mode 100644 (file)
index 0000000..5d12385
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,32 @@
+minetest.register_node("more_tnt:tnt_rain_starter",{
+       description="TNT Rain Starter",
+       groups = {dig_immediate = 2, mesecon = 2, tnt = 1, flammable = 5},
+       sounds = default.node_sound_wood_defaults(),
+        tiles = {"tnt_rain_top.png","tnt_rain_bottom.png","tnt_rain_side.png"},
+        on_punch=function(pos,node,puncher)
+               if puncher:get_wielded_item():get_name() == "default:torch" then
+                       minetest.get_meta(pos):set_int("rain",30)
+                       minetest.get_node_timer(pos):start(.5)
+               end
+        end,
+        on_timer=function (pos,elapsed)
+               rain=minetest.get_meta(pos):get_int("rain")-1   
+               if rain < 0 then
+                       minetest.set_node(pos,{name="air"})
+                       return false
+               end
+               minetest.get_meta(pos):set_int("rain",rain)
+               for i=0,10    do    
+                               minetest.set_node({x=pos.x+math.random(-25,25),y=pos.y+10,z=pos.z + math.random(-25,25)},{name="tnt:tnt_burning"})
+               end
+               return true
+        end
+})
+
+
+minetest.register_craft({
+       output="more_tnt:tnt_rain_starter",
+recipe={{"tnt:tnt","tnt:tnt","tnt:tnt"},
+       {"tnt:tnt","tnt:tnt","tnt:tnt"},
+       {"tnt:tnt","tnt:tnt","tnt:tnt"}},
+})     
diff --git a/textures/tnt_rain_bottom.png b/textures/tnt_rain_bottom.png
new file mode 100644 (file)
index 0000000..1186fb5
Binary files /dev/null and b/textures/tnt_rain_bottom.png differ
diff --git a/textures/tnt_rain_side.png b/textures/tnt_rain_side.png
new file mode 100644 (file)
index 0000000..48c4f0a
Binary files /dev/null and b/textures/tnt_rain_side.png differ
diff --git a/textures/tnt_rain_top.png b/textures/tnt_rain_top.png
new file mode 100644 (file)
index 0000000..23b2723
Binary files /dev/null and b/textures/tnt_rain_top.png differ