From 0690310cb53d5fed0bb54f1de450725c052b52c4 Mon Sep 17 00:00:00 2001 From: Vitalie Ciubotaru Date: Sun, 6 Mar 2016 23:00:00 +0900 Subject: [PATCH] ATM is 2 blocks tall now; new textures --- atm.lua | 91 ++++++++++++++++++++-- textures/global_exchange_atm_back.png | Bin 0 -> 170 bytes textures/global_exchange_atm_hi_front.png | Bin 0 -> 247 bytes textures/global_exchange_atm_hi_top.png | Bin 0 -> 246 bytes textures/global_exchange_atm_lo_front.png | Bin 0 -> 217 bytes textures/global_exchange_atm_lo_top.png | Bin 0 -> 228 bytes textures/global_exchange_atm_side.png | Bin 255 -> 163 bytes 7 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 textures/global_exchange_atm_back.png create mode 100644 textures/global_exchange_atm_hi_front.png create mode 100644 textures/global_exchange_atm_hi_top.png create mode 100644 textures/global_exchange_atm_lo_front.png create mode 100644 textures/global_exchange_atm_lo_top.png diff --git a/atm.lua b/atm.lua index a391345..48037df 100644 --- a/atm.lua +++ b/atm.lua @@ -193,18 +193,97 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end) -minetest.register_node("global_exchange:atm", { +minetest.register_node("global_exchange:atm_bottom", { description = "ATM", - tiles = {"global_exchange_atm_top.png", - "global_exchange_atm_top.png", - "global_exchange_atm_side.png", + --inventory_image = "", + --wield_image = def.wield_image, + drawtype = "nodebox", + tiles = { + "global_exchange_atm_lo_top.png", + "global_exchange_atm_side.png", + "global_exchange_atm_side.png", + "global_exchange_atm_side.png", + "global_exchange_atm_back.png^[transform2", + "global_exchange_atm_lo_front.png", }, - groups = {cracky=2}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + stack_max = 1, + light_source = 3, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + } + }, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}, + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node_or_nil(pos) + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(pos2).name ~= "air" then + minetest.remove_node(pos) + return true + end + minetest.set_node(pos2, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2}) + return false + end, + on_destruct = function(pos) + local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z} + local n2 = minetest.get_node(pos2) + if minetest.get_item_group(n2.name, "atm") == 2 then + minetest.remove_node(pos2) + end + end, + groups = {cracky=2, atm = 1}, on_rightclick = function(pos, _, clicker) minetest.show_formspec(clicker:get_player_name(), atm_form, main_menu(clicker:get_player_name())) end, }) +minetest.register_node("global_exchange:atm_top", { + drawtype = "nodebox", + tiles = { + "global_exchange_atm_hi_top.png", + "global_exchange_atm_side.png",--not visible anyway + "global_exchange_atm_side.png", + "global_exchange_atm_side.png", + "global_exchange_atm_back.png", + "global_exchange_atm_hi_front.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + light_source = 3, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, -0.375, 0.125, -0.25}, + {0.375, -0.5, -0.5, 0.5, 0.125, -0.25}, + {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5}, + {-0.5, 0.125, -0.4375, -0.375, 0.25, -0.25}, + {0.375, 0.125, -0.4375, 0.5, 0.25, -0.25}, + {-0.5, 0.25, -0.375, -0.375, 0.375, -0.25}, + {0.375, 0.25, -0.375, 0.5, 0.375, -0.25}, + {-0.5, 0.375, -0.3125, -0.375, 0.5, -0.25}, + {0.375, 0.375, -0.3125, 0.5, 0.5, -0.25}, + } + }, + selection_box = { + type = "fixed", + fixed = {0, 0, 0, 0, 0, 0}, + }, + groups = { + atm = 2 + }, +}) minetest.register_craft( { output = "global_exchange:atm", @@ -214,3 +293,5 @@ minetest.register_craft( { { "default:stone", "default:stone", "default:stone" }, } }) + +minetest.register_alias("global_exchange:atm", "global_exchange:atm_bottom") diff --git a/textures/global_exchange_atm_back.png b/textures/global_exchange_atm_back.png new file mode 100644 index 0000000000000000000000000000000000000000..f7825d5c1bfd993b5135c319290673b0f368e5b5 GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#0W&ARmAvy&fs;TX$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3{XE z)7O>#0W+t7knHm})=WSl$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3zto_FB7u`ySf83crxTN57eCMdcE8b_;g?f({Toyn$< zec*MI>}@lnii)4cCfBDXnXgzWy^bwgLO^)xi>w(Nj_MkIw6BOc;E@^R*4g@Om(e1V k>t>~i{cb6p3nz;+@O@MNSJ8Ge7ic+yr>mdKI;Vst0L#x&4FCWD literal 0 HcmV?d00001 diff --git a/textures/global_exchange_atm_hi_top.png b/textures/global_exchange_atm_hi_top.png new file mode 100644 index 0000000000000000000000000000000000000000..bb716e5fb4133daab7321ff57d7059903ec95dda GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNGZ&k@jD9rhSD=t&iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8afXr;B5V#pz^|tsDNGcVJ9tG_=|C$Me#TO1PDt?NJu=Kl`!+<;nVXc9@+Cj{xJ6jo~G`+wACpYX{%if cJCcCrXHHOKx3spb1KPyk>FVdQ&MBb@0P%B7RsaA1 literal 0 HcmV?d00001 diff --git a/textures/global_exchange_atm_lo_front.png b/textures/global_exchange_atm_lo_front.png new file mode 100644 index 0000000000000000000000000000000000000000..070c351f6a9c1c35f70a5bc303e0607b8edd3831 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#0W+rnqn6#i`}2W9k|nMYCC>S|xv6<249-QVi6yBi3gww484B*6z5(HleBwYw z!JaOTAsXkCO}1`GQ(!ePoWQ}hkWI|ub;$uvHa51)ykY`uEHm;pG@N$2;d7#{XE z)7O>#0W%kyg4r6oXYxQH$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3~O2Po5zzVYr9kw8D-TY1_QofLNqiql}TklS%K>xuC~Q QK${pmUHx3vIVCg!03B*dOaK4? literal 0 HcmV?d00001 diff --git a/textures/global_exchange_atm_side.png b/textures/global_exchange_atm_side.png index 180dec221e27a65a683c0f0d0b1ff5c9b96b01a5..563b47c01ed6bd1ade3c4ee113d2db0639093cb3 100644 GIT binary patch delta 82 zcmey*xR`N*BnKM<1B3kM|A`Y7NVvjdTJQSdb&7QE delta 175 zcmV;g08sy<0sjGz83+OZ005AYXf}}{9|-~#2n#G2sG)z6Nhp7LNklXwwXkL& z1+XwMFi1#95vlsci)Snl*5(bX399xD2xVYkU_uCVFf(*8BN%WtoMd1?($K-oQ1O?c z;xClJz<^-GNfZqvc^Y8}5dg^sh?9ub09Ok409F$2BuJ1E>jwiPQzBLG*tU`6P#T09 d7)edu0RG1&mj4e(-}?Xn002ovPDHLkV1i(*L6-mk