diff --git a/init.lua b/init.lua index 81bfe8f..7f10e5b 100644 --- a/init.lua +++ b/init.lua @@ -43,7 +43,11 @@ local on_digiline_receive_std = function(pos, node, channel, msg) if setchan ~= channel then return end local num = tonumber(msg) if msg == "colon" or msg == "period" or msg == "off" or (num and (num >= 0 and num <= 9)) then - minetest.swap_node(pos, { name = "nixie_tubes:tube_"..msg, param2 = node.param2}) + if string.sub(node.name,1,21) == "nixie_tubes:numitron_" then + minetest.swap_node(pos, { name = "nixie_tubes:numitron_"..msg, param2 = node.param2}) + else + minetest.swap_node(pos, { name = "nixie_tubes:tube_"..msg, param2 = node.param2}) + end end end @@ -90,6 +94,7 @@ for _,tube in ipairs(nixie_types) do local description2 = S("Decatron ("..tube..")") local cathode = "nixie_tube_cathode_off.png^nixie_tube_cathode_"..tube..".png" local cathode2 = "decatron_cathode_"..tube..".png" + local cathode3 = "numitron_filaments.png^numitron_"..tube..".png" if tube == "off" then groups = {cracky = 2} @@ -97,8 +102,10 @@ for _,tube in ipairs(nixie_types) do light2 = nil description = S("Nixie Tube") description2 = S("Decatron") + description3 = S("Numitron Tube") cathode = "nixie_tube_cathode_off.png" cathode2 = "nixie_tube_blank.png" + cathode3 = "numitron_filaments.png" end minetest.register_node("nixie_tubes:tube_"..tube, { @@ -136,6 +143,41 @@ for _,tube in ipairs(nixie_types) do drop = "nixie_tubes:tube_off" }) + minetest.register_node("nixie_tubes:numitron_"..tube, { + description = description3, + drawtype = "mesh", + mesh = "nixie_tube.obj", + tiles = { + "nixie_tube_base.png", + "nixie_tube_backing.png", + cathode3, + "nixie_tube_anode.png", + "nixie_tube_glass.png", + }, + use_texture_alpha = true, + groups = groups, + paramtype = "light", + paramtype2 = "facedir", + light_source = light, + selection_box = tube_cbox, + collision_box = tube_cbox, + on_construct = function(pos) + reset_meta(pos) + end, + on_receive_fields = function(pos, formname, fields, sender) + if (fields.channel) then + minetest.get_meta(pos):set_string("channel", fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = on_digiline_receive_std + }, + }, + drop = "nixie_tubes:numitron_off" + }) + if tube ~= "colon" and tube ~= "period" then minetest.register_node("nixie_tubes:decatron_"..tube, { description = description2, @@ -411,6 +453,15 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "nixie_tubes:numitron_off 4", + recipe = { + { "", "default:glass", "" }, + { "default:glass", "default:copper_ingot", "default:glass" }, + { "default:glass", "default:mese_crystal_fragment", "default:glass" } + }, +}) + minetest.register_craft({ output = "nixie_tubes:alnum_32 4", diff --git a/textures/numitron_0.png b/textures/numitron_0.png new file mode 100644 index 0000000..2ff78c9 Binary files /dev/null and b/textures/numitron_0.png differ diff --git a/textures/numitron_1.png b/textures/numitron_1.png new file mode 100644 index 0000000..3da4764 Binary files /dev/null and b/textures/numitron_1.png differ diff --git a/textures/numitron_2.png b/textures/numitron_2.png new file mode 100644 index 0000000..6748af6 Binary files /dev/null and b/textures/numitron_2.png differ diff --git a/textures/numitron_3.png b/textures/numitron_3.png new file mode 100644 index 0000000..67744bc Binary files /dev/null and b/textures/numitron_3.png differ diff --git a/textures/numitron_4.png b/textures/numitron_4.png new file mode 100644 index 0000000..9cc27f7 Binary files /dev/null and b/textures/numitron_4.png differ diff --git a/textures/numitron_5.png b/textures/numitron_5.png new file mode 100644 index 0000000..56dfe82 Binary files /dev/null and b/textures/numitron_5.png differ diff --git a/textures/numitron_6.png b/textures/numitron_6.png new file mode 100644 index 0000000..4e147c8 Binary files /dev/null and b/textures/numitron_6.png differ diff --git a/textures/numitron_7.png b/textures/numitron_7.png new file mode 100644 index 0000000..b701433 Binary files /dev/null and b/textures/numitron_7.png differ diff --git a/textures/numitron_8.png b/textures/numitron_8.png new file mode 100644 index 0000000..bf9da7a Binary files /dev/null and b/textures/numitron_8.png differ diff --git a/textures/numitron_9.png b/textures/numitron_9.png new file mode 100644 index 0000000..65b138b Binary files /dev/null and b/textures/numitron_9.png differ diff --git a/textures/numitron_colon.png b/textures/numitron_colon.png new file mode 100644 index 0000000..ca097d8 Binary files /dev/null and b/textures/numitron_colon.png differ diff --git a/textures/numitron_filaments.png b/textures/numitron_filaments.png new file mode 100644 index 0000000..8f4d9b3 Binary files /dev/null and b/textures/numitron_filaments.png differ diff --git a/textures/numitron_period.png b/textures/numitron_period.png new file mode 100644 index 0000000..335d2a5 Binary files /dev/null and b/textures/numitron_period.png differ