Extended storage tank to show fill level in 10% steps (0% to 100%).
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 22 Aug 2012 12:24:42 +0000 (08:24 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 22 Aug 2012 12:24:42 +0000 (08:24 -0400)
16 files changed:
autoplace.lua
changelog.txt
devices.lua
textures/pipeworks_storage_tank_back.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_0.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_1.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_10.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_2.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_3.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_4.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_5.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_6.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_7.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_8.png [new file with mode: 0644]
textures/pipeworks_storage_tank_front_9.png [new file with mode: 0644]
textures/pipeworks_storage_tank_sides.png [deleted file]

index 94a8620e48535eff29c9fd816b93cc37caaf1814..b615b64a3e41ab7576a338bfaeb2097e5647ffbf 100644 (file)
@@ -105,15 +105,15 @@ pipes_scansurroundings = function(pos)
        -- storage tanks and intake grates have vertical connections
        -- also, so they require a special case
 
-       if (string.find(nym.name, "pipeworks:storage_tank_x") ~= nil) or
-          (string.find(nym.name, "pipeworks:storage_tank_z") ~= nil) or
+       if (string.find(nym.name, "pipeworks:storage_tank_") ~= nil) or
+          (string.find(nym.name, "pipeworks:storage_tank_") ~= nil) or
           (string.find(nym.name, "pipeworks:intake") ~= nil) or
           (string.find(nym.name, "pipeworks:outlet") ~= nil) then
                pym=1
        end
 
-       if (string.find(nyp.name, "pipeworks:storage_tank_x") ~= nil) or
-          (string.find(nyp.name, "pipeworks:storage_tank_z") ~= nil) then
+       if (string.find(nyp.name, "pipeworks:storage_tank_") ~= nil) or
+          (string.find(nyp.name, "pipeworks:storage_tank_") ~= nil) then
                pyp=1
        end
 
index 2d882c28a8a341aa396a0f56ec5338552ceb36e2..a1ef58a03bd9a3b738fbb6dbc6663f7bf026fa2f 100644 (file)
@@ -1,7 +1,8 @@
 Changelog
 ---------
 
-2012-08-22:  Added outlet grate, made it participate in autoplace algorithm.
+2012-08-22: Added outlet grate, made it participate in autoplace algorithm.  
+Extended storage tank to show fill level in 10% steps (0% to 100%).
 
 2012-08-21: Made storage tank participate in autoplace algorithm.  Tuned API a 
 little to allow for more flexible placement.  Re-organized code a bit to allow 
index 9eddcf57e1559862ccab873f0bae3b03a57f4976..5964bf89dc26833e0865c2ef43e97decb5ae9e32 100644 (file)
@@ -3,15 +3,24 @@
 pipes_devicelist = {
        "pump",
        "valve",
-       "storage_tank"
+       "storage_tank_0",
+       "storage_tank_1",
+       "storage_tank_2",
+       "storage_tank_3",
+       "storage_tank_4",
+       "storage_tank_5",
+       "storage_tank_6",
+       "storage_tank_7",
+       "storage_tank_8",
+       "storage_tank_9",
+       "storage_tank_10"
 }
 
 -- tables
 
 minetest.register_alias("pipeworks:pump", "pipeworks:pump_off_x")
-minetest.register_alias("pipeworks:pump_off", "pipeworks:pump_off_x")
 minetest.register_alias("pipeworks:valve", "pipeworks:valve_off_x")
-minetest.register_alias("pipeworks:valve_off", "pipeworks:valve_off_x")
+minetest.register_alias("pipeworks:storage_tank", "pipeworks:storage_tank_0_x")
 
 pipe_pumpbody_x = {
        { -6/16, -8/16, -6/16, 6/16, 8/16, 6/16 }
@@ -319,65 +328,74 @@ minetest.register_node("pipeworks:outlet", {
 })
 
 -- tank
+for fill = 0, 10 do
+       if fill == 0 then 
+               filldesc=""
+               sgroups = {snappy=3, pipe=1, tankfill=fill+1}
+       else
+               filldesc=fill
+               sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}
+       end
 
-minetest.register_node("pipeworks:storage_tank_x", {
-       description = "Fluid Storage Tank",
-       tiles = {
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_sides.png",
-               "pipeworks_storage_tank_sides.png"
-       },
-       paramtype = "light",
-       groups = {snappy=3, pipe=1},
-       sounds = default.node_sound_wood_defaults(),
-       walkable = true,
-       stack_max = 99,
-       after_place_node = function(pos)
-               pipe_device_autorotate(pos, nil, "pipeworks:storage_tank")
-               pipe_scanforobjects(pos)
-       end,
-       after_dig_node = function(pos)
-               pipe_scanforobjects(pos)
-       end,
-       pipelike=1,
-       on_construct = function(pos)
-       local meta = minetest.env:get_meta(pos)
-       meta:set_int("pipelike",1)
-       end,
-})
-
-minetest.register_node("pipeworks:storage_tank_z", {
-       description = "Fluid Storage Tank (Z axis)... You hacker, you.",
-       tiles = {
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_sides.png",
-               "pipeworks_storage_tank_sides.png",
-               "pipeworks_storage_tank_fittings.png",
-               "pipeworks_storage_tank_fittings.png"
-       },
-       paramtype = "light",
-       groups = {snappy=3, pipe=1, not_in_creative_inventory=1},
-       sounds = default.node_sound_wood_defaults(),
-       walkable = true,
-       stack_max = 99,
-       drop = "pipeworks:storage_tank_x",
-       after_place_node = function(pos)
-               pipe_device_autorotate(pos, nil, "pipeworks:storage_tank")
-               pipe_scanforobjects(pos)
-       end,
-       after_dig_node = function(pos)
-               pipe_scanforobjects(pos)
-       end,
-       pipelike=1,
-       on_construct = function(pos)
-       local meta = minetest.env:get_meta(pos)
-       meta:set_int("pipelike",1)
-       end,
-})
+       minetest.register_node("pipeworks:storage_tank_"..fill.."_x", {
+               description = "Fluid Storage Tank ("..filldesc.."0% full)",
+               tiles = {
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_back.png",
+                       "pipeworks_storage_tank_front_"..fill..".png"
+               },
+               paramtype = "light",
+               groups = sgroups,
+               sounds = default.node_sound_wood_defaults(),
+               walkable = true,
+               stack_max = 99,
+               after_place_node = function(pos)
+                       pipe_device_autorotate(pos, nil, "pipeworks:storage_tank_"..fill)
+                       pipe_scanforobjects(pos)
+               end,
+               after_dig_node = function(pos)
+                       pipe_scanforobjects(pos)
+               end,
+               pipelike=1,
+               on_construct = function(pos)
+               local meta = minetest.env:get_meta(pos)
+               meta:set_int("pipelike",1)
+               end,
+       })
+       
+       minetest.register_node("pipeworks:storage_tank_"..fill.."_z", {
+               description = "Fluid Storage Tank (Z axis, "..filldesc.."0% full)... You hacker, you.",
+               tiles = {
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_front_"..fill..".png",
+                       "pipeworks_storage_tank_back.png",
+                       "pipeworks_storage_tank_fittings.png",
+                       "pipeworks_storage_tank_fittings.png"
+               },
+               paramtype = "light",
+               groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1},
+               sounds = default.node_sound_wood_defaults(),
+               walkable = true,
+               stack_max = 99,
+               drop = "pipeworks:storage_tank_"..fill.."_x",
+               after_place_node = function(pos)
+                       pipe_device_autorotate(pos, nil, "pipeworks:storage_tank_"..fill)
+                       pipe_scanforobjects(pos)
+               end,
+               after_dig_node = function(pos)
+                       pipe_scanforobjects(pos)
+               end,
+               pipelike=1,
+               on_construct = function(pos)
+               local meta = minetest.env:get_meta(pos)
+               meta:set_int("pipelike",1)
+               end,
+       })
+end
 
 -- various actions
 
diff --git a/textures/pipeworks_storage_tank_back.png b/textures/pipeworks_storage_tank_back.png
new file mode 100644 (file)
index 0000000..91fe3c0
Binary files /dev/null and b/textures/pipeworks_storage_tank_back.png differ
diff --git a/textures/pipeworks_storage_tank_front_0.png b/textures/pipeworks_storage_tank_front_0.png
new file mode 100644 (file)
index 0000000..b74b6f1
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_0.png differ
diff --git a/textures/pipeworks_storage_tank_front_1.png b/textures/pipeworks_storage_tank_front_1.png
new file mode 100644 (file)
index 0000000..6d47a21
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_1.png differ
diff --git a/textures/pipeworks_storage_tank_front_10.png b/textures/pipeworks_storage_tank_front_10.png
new file mode 100644 (file)
index 0000000..cb3960d
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_10.png differ
diff --git a/textures/pipeworks_storage_tank_front_2.png b/textures/pipeworks_storage_tank_front_2.png
new file mode 100644 (file)
index 0000000..d3312f4
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_2.png differ
diff --git a/textures/pipeworks_storage_tank_front_3.png b/textures/pipeworks_storage_tank_front_3.png
new file mode 100644 (file)
index 0000000..db1716e
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_3.png differ
diff --git a/textures/pipeworks_storage_tank_front_4.png b/textures/pipeworks_storage_tank_front_4.png
new file mode 100644 (file)
index 0000000..f523e2d
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_4.png differ
diff --git a/textures/pipeworks_storage_tank_front_5.png b/textures/pipeworks_storage_tank_front_5.png
new file mode 100644 (file)
index 0000000..e667160
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_5.png differ
diff --git a/textures/pipeworks_storage_tank_front_6.png b/textures/pipeworks_storage_tank_front_6.png
new file mode 100644 (file)
index 0000000..b426bc3
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_6.png differ
diff --git a/textures/pipeworks_storage_tank_front_7.png b/textures/pipeworks_storage_tank_front_7.png
new file mode 100644 (file)
index 0000000..e317b1c
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_7.png differ
diff --git a/textures/pipeworks_storage_tank_front_8.png b/textures/pipeworks_storage_tank_front_8.png
new file mode 100644 (file)
index 0000000..17824fd
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_8.png differ
diff --git a/textures/pipeworks_storage_tank_front_9.png b/textures/pipeworks_storage_tank_front_9.png
new file mode 100644 (file)
index 0000000..f6600b9
Binary files /dev/null and b/textures/pipeworks_storage_tank_front_9.png differ
diff --git a/textures/pipeworks_storage_tank_sides.png b/textures/pipeworks_storage_tank_sides.png
deleted file mode 100644 (file)
index badaa2b..0000000
Binary files a/textures/pipeworks_storage_tank_sides.png and /dev/null differ