Add gunpowder trails
authorWuzzy <almikes@aol.com>
Sat, 21 Feb 2015 00:05:19 +0000 (01:05 +0100)
committerNovatux <nathanael.courant@laposte.net>
Sun, 7 Jun 2015 12:27:18 +0000 (14:27 +0200)
Uses group “connect_to_raillike”

13 files changed:
game_api.txt
mods/tnt/init.lua
mods/tnt/textures/tnt_gunpowder.png [deleted file]
mods/tnt/textures/tnt_gunpowder_burning.png [deleted file]
mods/tnt/textures/tnt_gunpowder_burning_animated.png [deleted file]
mods/tnt/textures/tnt_gunpowder_burning_crossing_animated.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_burning_curved_animated.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_burning_straight_animated.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_burning_t_junction_animated.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_crossing.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_curved.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_straight.png [new file with mode: 0644]
mods/tnt/textures/tnt_gunpowder_t_junction.png [new file with mode: 0644]

index a3edcfe8a750429b58fa78585f3052ce8b13ac6c..791a7f924d27d96277bb216cb91e6c9bad921adb 100644 (file)
@@ -218,6 +218,8 @@ Use `minetest.raillike_group(<Name>)` to get the group value.
 | Node type            | Raillike group name
 +-----------------------+----------------------------------
 | default:rail         | "rail"
+| tnt:gunpowder                | "gunpowder"
+| tnt:gunpowder_burning        | "gunpowder"
 
 Example:
 If you want to add a new rail type and want it to connect with default:rail,
index 1554bf2381df845fe33f6c051330074f4023f43c..5eab9eb9de79944eac2a0ee682850410db050a17 100644 (file)
@@ -270,14 +270,14 @@ minetest.register_node("tnt:gunpowder", {
        paramtype = "light",
        sunlight_propagates = true,
        walkable = false,
-       tiles = {"tnt_gunpowder.png",},
+       tiles = {"tnt_gunpowder_straight.png", "tnt_gunpowder_curved.png", "tnt_gunpowder_t_junction.png", "tnt_gunpowder_crossing.png"},
        inventory_image = "tnt_gunpowder_inventory.png",
        wield_image = "tnt_gunpowder_inventory.png",
        selection_box = {
                type = "fixed",
                fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
        },
-       groups = {dig_immediate=2,attached_node=1},
+       groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
        sounds = default.node_sound_leaves_defaults(),
        
        on_punch = function(pos, node, puncher)
@@ -297,7 +297,34 @@ minetest.register_node("tnt:gunpowder_burning", {
        walkable = false,
        light_source = 5,
        tiles = {{
-               name = "tnt_gunpowder_burning_animated.png",
+               name = "tnt_gunpowder_burning_straight_animated.png",
+               animation = {
+                       type = "vertical_frames",
+                       aspect_w = 16,
+                       aspect_h = 16,
+                       length = 1,
+               }
+       },
+       {
+               name = "tnt_gunpowder_burning_curved_animated.png",
+               animation = {
+                       type = "vertical_frames",
+                       aspect_w = 16,
+                       aspect_h = 16,
+                       length = 1,
+               }
+       },
+       {
+               name = "tnt_gunpowder_burning_t_junction_animated.png",
+               animation = {
+                       type = "vertical_frames",
+                       aspect_w = 16,
+                       aspect_h = 16,
+                       length = 1,
+               }
+       },
+       {
+               name = "tnt_gunpowder_burning_crossing_animated.png",
                animation = {
                        type = "vertical_frames",
                        aspect_w = 16,
@@ -310,7 +337,7 @@ minetest.register_node("tnt:gunpowder_burning", {
                fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
        },
        drop = "",
-       groups = {dig_immediate=2,attached_node=1},
+       groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
        sounds = default.node_sound_leaves_defaults(),
        on_timer = function(pos, elapsed)
                for dx = -1, 1 do
diff --git a/mods/tnt/textures/tnt_gunpowder.png b/mods/tnt/textures/tnt_gunpowder.png
deleted file mode 100644 (file)
index 52153e9..0000000
Binary files a/mods/tnt/textures/tnt_gunpowder.png and /dev/null differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning.png b/mods/tnt/textures/tnt_gunpowder_burning.png
deleted file mode 100644 (file)
index fa7d107..0000000
Binary files a/mods/tnt/textures/tnt_gunpowder_burning.png and /dev/null differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning_animated.png b/mods/tnt/textures/tnt_gunpowder_burning_animated.png
deleted file mode 100644 (file)
index 5ee2484..0000000
Binary files a/mods/tnt/textures/tnt_gunpowder_burning_animated.png and /dev/null differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning_crossing_animated.png b/mods/tnt/textures/tnt_gunpowder_burning_crossing_animated.png
new file mode 100644 (file)
index 0000000..a901f7b
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_burning_crossing_animated.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning_curved_animated.png b/mods/tnt/textures/tnt_gunpowder_burning_curved_animated.png
new file mode 100644 (file)
index 0000000..bc01806
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_burning_curved_animated.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning_straight_animated.png b/mods/tnt/textures/tnt_gunpowder_burning_straight_animated.png
new file mode 100644 (file)
index 0000000..c860ace
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_burning_straight_animated.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_burning_t_junction_animated.png b/mods/tnt/textures/tnt_gunpowder_burning_t_junction_animated.png
new file mode 100644 (file)
index 0000000..a556072
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_burning_t_junction_animated.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_crossing.png b/mods/tnt/textures/tnt_gunpowder_crossing.png
new file mode 100644 (file)
index 0000000..916c84e
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_crossing.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_curved.png b/mods/tnt/textures/tnt_gunpowder_curved.png
new file mode 100644 (file)
index 0000000..cb8b4ea
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_curved.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_straight.png b/mods/tnt/textures/tnt_gunpowder_straight.png
new file mode 100644 (file)
index 0000000..8ab0e3c
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_straight.png differ
diff --git a/mods/tnt/textures/tnt_gunpowder_t_junction.png b/mods/tnt/textures/tnt_gunpowder_t_junction.png
new file mode 100644 (file)
index 0000000..ac997a7
Binary files /dev/null and b/mods/tnt/textures/tnt_gunpowder_t_junction.png differ