From b8d7238cdd558e27ef0db863f8eb78b33df982c7 Mon Sep 17 00:00:00 2001 From: Carter Kolwey Date: Sun, 5 Feb 2017 02:24:05 -0600 Subject: [PATCH] Add numitron tubes --- init.lua | 53 +++++++++++++++++++++++++++++++- textures/numitron_0.png | Bin 0 -> 435 bytes textures/numitron_1.png | Bin 0 -> 311 bytes textures/numitron_2.png | Bin 0 -> 417 bytes textures/numitron_3.png | Bin 0 -> 390 bytes textures/numitron_4.png | Bin 0 -> 373 bytes textures/numitron_5.png | Bin 0 -> 408 bytes textures/numitron_6.png | Bin 0 -> 441 bytes textures/numitron_7.png | Bin 0 -> 366 bytes textures/numitron_8.png | Bin 0 -> 452 bytes textures/numitron_9.png | Bin 0 -> 437 bytes textures/numitron_colon.png | Bin 0 -> 368 bytes textures/numitron_filaments.png | Bin 0 -> 242 bytes textures/numitron_period.png | Bin 0 -> 369 bytes 14 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 textures/numitron_0.png create mode 100644 textures/numitron_1.png create mode 100644 textures/numitron_2.png create mode 100644 textures/numitron_3.png create mode 100644 textures/numitron_4.png create mode 100644 textures/numitron_5.png create mode 100644 textures/numitron_6.png create mode 100644 textures/numitron_7.png create mode 100644 textures/numitron_8.png create mode 100644 textures/numitron_9.png create mode 100644 textures/numitron_colon.png create mode 100644 textures/numitron_filaments.png create mode 100644 textures/numitron_period.png 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 0000000000000000000000000000000000000000..2ff78c93d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ron_3.png new file mode 100644 index 0000000000000000000000000000000000000000..67744bc6632eb12da78553d6570a3f3d4af58c73 GIT binary patch literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI+iIsz!S;Iy`hJk@m*we)^B;s&#g2c;)i4&T73tzo` zBK2#0iH?w<_y~h0B(;ZCtwa zX}zy6ud-_385hr64VFm?G7R4>r!1?NQZTii9Lr~5VDRU@#PWYVjg5(dnokeRI-S4N zsif8ahyJci&y~y)NxZKA^tr-S?|qxPT~cg*{b7%@0u~1k94KgL5zvS#{;4Z%sAv!+ z)HkhVvFgJKnw*}x>_yjN>P{QycsaEJeR$lHhmo!8c2fvTi1ro@y>pspH<>&pI+iIsy}%=O`)?+gr#Or9=|ArXg@6C_xfc_cbRzVBbU zv^B#yJ1fh>P}=;4#PT|uYXMLGAG7%SIOSEg`jTm#4SyP4AFkp70(OrQYae;$rF;h@ zRat(xFc--lxN+&yr}>SIjf`H#mu@rin3|gQ=<4eJ2O6j0m6Kx4kY=f)^5QMSj`Ism z{$6I7`IM6_K~dqo!1hmO&K>ItE*`Te4LZ}?{Hl0?m#0Lw#;5r=YR(=wZ~!EK_|fNl ziIbdOYd-EZ^!v-w*&29p*6IA4P9?4WKlFEHdIlEy_-WmjSbp!{{=<{BTt8-bT0{x) z{hu^pj)?!&X;&WP3G<0NY<22>^k~i{9q;c}sW(~<99Z7y$jk7UuR+4?cExO905N#F L`njxgN@xNA?9P)) literal 0 HcmV?d00001 diff --git a/textures/numitron_5.png b/textures/numitron_5.png new file mode 100644 index 0000000000000000000000000000000000000000..56dfe82a99ef12bc8ad8c56cb51c2c56b996676e GIT binary patch literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI+iIsy}^_St?hYSpis-7;6ArXg@6C_?XOq|fvTlnhj z6RCImU!ElmXR`@Ia_c4R*s9J|BfCwaKXK4 zC*QyByeNUk28&|kvNb-{2ky|ixb67bJ!c(q6kU22{g-}x#oxfdKt@54rR!Qu-D$B! z+BJvjFZz0W328E0uADPPsAP+Zj4r3Uw^P(qW=o*qPZgKRNC>Ga9zJIA^|4ADL!fR_ x72_(=C=v1JQ_>=LUDrIU#=>UD%ag^xpr}1FA>Vk>TwoY7c)I$ztaD0e0s!f{nuq`Z literal 0 HcmV?d00001 diff --git a/textures/numitron_6.png b/textures/numitron_6.png new file mode 100644 index 0000000000000000000000000000000000000000..4e147c839a052b0dc59bfb564a80b55979334947 GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI+iIs!f^m$uvD+2?go2QFoNW|gf1c{do6DKtF7QTA> zMC#rC7ip@BraCTCAs_c2o>UPZDwBRgV);GCLXMoCVEekqSIfD14bP?X@bGkdeEd7> zbiTIO{QAQlfq#I~`Ty@H{+vH2BO^2Or+<%?n$g{F^BLx6IILrqNVIFY)bpi`!P(cB zH`&|!^#572q`Dr>%wa#Eqi(itiL#fjhJ=Zacnq&sm2YMVB0on#6>J8BR_dB5Qa4nWpO!{-fpp zqS@1?Tw!GwYh4|cv+G+Pm!T;4q{EUxZWxgJ?m&j8MU+tAv=$Nble_rsQUk=Fp1CQp z+^=h=WubPyamx!XYo5201a`WlBqUfkcnM4hD!3>Wu=YaI0+rK~E(I)IsmyleQ)AJQ e1Irs7c^Ul0=Q#<>&pI+iIszgOKzcAJy7Vkr;B4q#Np%wiI)u%Cp7gIzIyva z>fQbqX{w5*IxbQnANL=gR1qI4lYT>D`8~&}0v)CzKjjx`-*H^@{Bho%UwTUwkKJ_i z(RjeBtE>Cp^Xg_pzrBC!+n?4aE$Z*|DgUc}KwWCWYX-N76AqbfRn`p)mo01CxOC~$ zdS72&W!1nlE}pj!c!9x5-bd&g!-nnELMH!FqQdu zr!IS&i>JjC#;aVqUDDg8q($!9zOLPugQrGH;tB)9{AX1YUOtk$1q=oTPgg&ebxsLQ E05(dD@&Et; literal 0 HcmV?d00001 diff --git a/textures/numitron_8.png b/textures/numitron_8.png new file mode 100644 index 0000000000000000000000000000000000000000..bf9da7a7d234c05450175d96bafb4956728ce505 GIT binary patch literal 452 zcmV;#0XzPQP)4(93mgCd0Z~ar zK~z}7V_+ERfRT`bjdAMjA$H7rCLRPn#Vl6YTL9B0@Vr`|zv2yBc~KYruY zcMA7&z%Ye`5GY!6`7K+BuJ8%}MK>)eDhU^bt6FTj_HGKP zCE=oQ)rw8m-W?b%2}eu9(UOqjCRz8vrwr<%oH-6kN0h uR4cR?D9N(O^nidtVfjEgV&K!jpauZyR-q6xipMGd0000<>&pI+iIsy#=2dC49s>iTlc$SgNW|gf1c{do6DKtF7QTA> zMC#rC7ip@BraCTCAs_c2o>UPZDwBRgV);GCLXMoCVEekqSIfD14bP?X@bGkde5kq8 z8-9PO$q@@{j#j3H0u}+!6mmDdytUi)2#flp!;+_DmS~&BR=Wr23eUXwdp^Vb42N~h z646mn|BMX`3>-4us;nCpE?d^Nap}^h^}fEm%BnXfVoOE6ecRa>}xLDTS>L z%I4BmN7n8+E3imAW{aWUT#@3(3x3IH=ygd-NJu2{y8hGW3Rk`NZR&POvHA6fJ^TWa zdfx+mqYjkin;^jCnyt4#mHVQo-NXGamZ_?CPHCJIvd_?O@8A0Nr}ar%n=Vc&*rFn% z%b6L<_hik^KhxT06eV~}Y2lH6e5HS~1QX8^lZP3+E5b4YW99_UN_`o(oM*Ox#19jL b6^smfvgYVrs$Vn@7{Cmku6{1-oD!M<>&pI+iIsy#bI&n%UZBulPZ!6Kh{MSV60FQT5}hI6_b*-A zn&F(CmE~bLd&AQ$SB|@QFzU_E?+MOtPYn7p@eM=Hg44n8?3tOFn+?Rh4S*DLk3XNn zO-AX*S8iW*wY2`TrA12u2!OQC6(GN$mBrV|VMe#=j~C7U+t-Tz2q5cyX5DcEKelF{r5}E*( CcZ#zB literal 0 HcmV?d00001 diff --git a/textures/numitron_filaments.png b/textures/numitron_filaments.png new file mode 100644 index 0000000000000000000000000000000000000000..8f4d9b342288c12ac683b3f9eac3ca06b6a9e67d GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI+iIv?-X=RAVS)fq8r;B4q#NoG7tc4CJaJU>S4t}@S zGkK=ugaa!iw@vL|^P?kb_R(_|tPk|Gl(e_LeKxi7FjvG(n@Q%AmUZtE*~h?q!E$BV zzVEZA&Z?dEkbyBkFfo5|4*MC|6=e<0HkSR&zK7HjCvWh)p|Yo`<+?U+)cpFOpVNDp i-hStMbH8!%SB3{Z$%~UGzA*<>&pI+iIs!L*m23ea-h&ZPZ!6Kh{MSV60FQT5}hI6_b*-A zn&F(CmE~bLd&AQ$SB|@QFlySVyUPntt#QxOnE00A*tBWW{s+wew>+&TnfuiLE7KOc zaTsjbvgObEl`9ift|?`;GaNK=crB2ive`zm=IMb9Pm3s_zG*FsRUZPG4^$O>oB7zx zj;-8&_{P8Pys#iuaRKfmUe|xd1_l-!#T!|Gv_VPbslUskIS$mkTdo>X_~YO4_1n7s z+?l;@?`sD>&ROjZ2IAfZXFeVNZeQ2h%5rzngSXr5vlFM?*7{Vu|L?bS-B{to>C5lb zmj<5WOVpe8VEg@lYxe&9RqcB7n|n_QH{*;{gZawQb{Y%}^_TkID7eO207HVo)78&q Iol`;+05H&#KL7v# literal 0 HcmV?d00001