From e14838deeb21f517f986fb26d505de376a3eb514 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sun, 24 Jun 2018 12:10:47 +0300 Subject: [PATCH] PCB etching --- elepower_dynamics/crafting.lua | 21 ++++ elepower_dynamics/craftitems.lua | 27 ++++++ elepower_dynamics/dusts.lua | 2 +- elepower_dynamics/init.lua | 1 + elepower_dynamics/liquids.lua | 91 ++++++++++++++++++ .../textures/elepower_acidic_compound.png | Bin 0 -> 475 bytes .../textures/elepower_blank_pcb.png | Bin 0 -> 1765 bytes .../textures/elepower_etching_acid.png | Bin 0 -> 986 bytes elepower_dynamics/textures/elepower_pcb.png | Bin 341 -> 1889 bytes elepower_fapi/transfer_node.lua | 7 +- 10 files changed, 144 insertions(+), 5 deletions(-) create mode 100644 elepower_dynamics/liquids.lua create mode 100644 elepower_dynamics/textures/elepower_acidic_compound.png create mode 100644 elepower_dynamics/textures/elepower_blank_pcb.png create mode 100644 elepower_dynamics/textures/elepower_etching_acid.png diff --git a/elepower_dynamics/crafting.lua b/elepower_dynamics/crafting.lua index 80d9ffe..d46834a 100644 --- a/elepower_dynamics/crafting.lua +++ b/elepower_dynamics/crafting.lua @@ -210,6 +210,27 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "elepower_dynamics:pcb_blank", + recipe = { + {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"}, + {"default:copper_ingot", "default:mese_crystal", "default:copper_ingot"}, + {"default:gold_ingot", "elepower_dynamics:viridisium_ingot", "default:gold_ingot"}, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "elepower_dynamics:acidic_compound", + recipe = { + "elepower_dynamics:viridisium_dust", + "elepower_dynamics:viridisium_dust", + "elepower_dynamics:viridisium_dust", + "elepower_dynamics:viridisium_dust", + "farming:seed_wheat", + } +}) + minetest.register_craft({ output = "elepower_dynamics:integrated_circuit", recipe = { diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 37a67ac..28fbdcd 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -81,12 +81,39 @@ minetest.register_craftitem("elepower_dynamics:tree_tap", { groups = {treetap = 1, static_component = 1} }) +minetest.register_craftitem("elepower_dynamics:pcb_blank", { + description = "Printed Circuit Board (PCB) Blank", + inventory_image = "elepower_blank_pcb.png", + liquids_pointable = true, + groups = {blank_board = 1, static_component = 1} +}) + minetest.register_craftitem("elepower_dynamics:pcb", { description = "Printed Circuit Board (PCB)", inventory_image = "elepower_pcb.png", groups = {pcb = 1, static_component = 1} }) +minetest.register_craftitem("elepower_dynamics:acidic_compound", { + description = "Acidic Compound\nUsed to make Etching Acid", + inventory_image = "elepower_acidic_compound.png", + liquids_pointable = true, + groups = {acid = 1, static_component = 1}, + on_place = function (itemstack, placer, pointed_thing) + local pos = pointed_thing.under + local node = minetest.get_node(pos) + + if not node.name == "water_source" then + return itemstack + end + + minetest.set_node(pos, {name = "elepower_dynamics:etching_acid_source"}) + itemstack:take_item(1) + + return itemstack + end, +}) + -- Electronics minetest.register_craftitem("elepower_dynamics:wound_copper_coil", { diff --git a/elepower_dynamics/dusts.lua b/elepower_dynamics/dusts.lua index d4c8b5b..5a735e8 100644 --- a/elepower_dynamics/dusts.lua +++ b/elepower_dynamics/dusts.lua @@ -106,7 +106,7 @@ elepd.register_dust("viridisium", { }) elepd.register_dust("wood", { - description = "Wood Shavings", + description = "Sawdust", force_description = true, color = "#847454" }) diff --git a/elepower_dynamics/init.lua b/elepower_dynamics/init.lua index 2f55d4c..d6b9b05 100644 --- a/elepower_dynamics/init.lua +++ b/elepower_dynamics/init.lua @@ -11,6 +11,7 @@ dofile(modpath.."/craftitems.lua") dofile(modpath.."/plastic.lua") dofile(modpath.."/tools.lua") dofile(modpath.."/nodes.lua") +dofile(modpath.."/liquids.lua") dofile(modpath.."/tanks.lua") dofile(modpath.."/dusts.lua") dofile(modpath.."/gears.lua") diff --git a/elepower_dynamics/liquids.lua b/elepower_dynamics/liquids.lua new file mode 100644 index 0000000..f91f2e2 --- /dev/null +++ b/elepower_dynamics/liquids.lua @@ -0,0 +1,91 @@ + +local etching = { + ["elepower_dynamics:pcb_blank"] = { + time = 5, + result = "elepower_dynamics:pcb" + } +} + +-- Etching Acid + +minetest.register_node("elepower_dynamics:etching_acid_source", { + description = "Etching Acid Source", + drawtype = "liquid", + tiles = {"elepower_etching_acid.png"}, + alpha = 200, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "source", + liquid_alternative_source = "elepower_dynamics:etching_acid_source", + liquid_alternative_flowing = "elepower_dynamics:etching_acid_flowing", + liquid_viscosity = 4, + damage_per_second = 4, + post_effect_color = {a = 103, r = 65, g = 8, b = 0}, + groups = {acid = 1, etching_acid = 1, liquid = 3, tree_fluid = 1}, + sounds = default.node_sound_water_defaults(), + on_rightclick = function (pos, node, clicker, itemstack, pointed_thing) + local istack = itemstack:get_name() + if not clicker or clicker:get_player_name() == "" then + return itemstack + end + + if not etching[istack] then + return itemstack + end + + local recipe = etching[istack] + local out = ItemStack(recipe.result) + local inv = clicker:get_inventory() + local meta = minetest.get_meta(pos) + local uses = meta:get_int("uses") + + if inv:room_for_item("main", out) then + inv:add_item("main", out) + itemstack:take_item(1) + uses = uses + 1 + end + + -- Limited etchings + if uses == 10 then + minetest.set_node(pos, {name = "default:water_source"}) + else + meta:set_int("uses", uses) + end + + return itemstack + end +}) + +minetest.register_node("elepower_dynamics:etching_acid_flowing", { + description = "Flowing Etching Acid", + drawtype = "flowingliquid", + tiles = {"elepower_etching_acid.png"}, + special_tiles = {"elepower_etching_acid.png", "elepower_etching_acid.png"}, + alpha = 200, + paramtype = "light", + paramtype2 = "flowingliquid", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "flowing", + liquid_alternative_flowing = "elepower_dynamics:etching_acid_flowing", + liquid_alternative_source = "elepower_dynamics:etching_acid_source", + liquid_viscosity = 4, + damage_per_second = 4, + post_effect_color = {a = 103, r = 65, g = 8, b = 0}, + groups = {acid = 1, etching_acid = 1, liquid = 3, not_in_creative_inventory = 1}, + sounds = default.node_sound_water_defaults(), +}) + +bucket.register_liquid("elepower_dynamics:etching_acid_source", "elepower_dynamics:etching_acid_flowing", + "elepower_dynamics:bucket_etching_acid", "#410800", "Etching Acid Bucket") diff --git a/elepower_dynamics/textures/elepower_acidic_compound.png b/elepower_dynamics/textures/elepower_acidic_compound.png new file mode 100644 index 0000000000000000000000000000000000000000..c06c1fc3620901774388379f546bef771413d684 GIT binary patch literal 475 zcmV<10VMv3P)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00BcuL_t(I%gvI_ZW>Vxg+I?Q z1c?qm>7r7j@KyoxAW@=Z->9uB-h<}Fvgo2x3k+QQWHBQFWs+@b>E5er``E|Uf%i6R zbAG!<)&xC3g1cpV?uqm33>Dp80~SVIV7sfh|9P5!>U{rplU%;0ubcpF3QtuQ!y4i;D_>%S70dN-lf9<#A2XCS(Kg`!V=swAqBiC7 R99sYY002ovPDHLkV1gB^#MS@+ literal 0 HcmV?d00001 diff --git a/elepower_dynamics/textures/elepower_blank_pcb.png b/elepower_dynamics/textures/elepower_blank_pcb.png new file mode 100644 index 0000000000000000000000000000000000000000..619c652e7d57a772a4db97551c05657a0602378d GIT binary patch literal 1765 zcmV zaB^>EX>4U6ba`-PAZ2)IW&i+q+T~YSuIn}o{nskG1d*Dk1gqSuk;m9(ALeWTChL9VU`43WWT z)~)z0Z;&(edCSYTlOT6@hGN?f^5cWF4Y6zo$K!TnXgSc^uu9vI;qBS3`@EK=eUxy& zgtGPfem=v1pBfiy0(<8vSX?dZ5PZa3SlfWO)d92@j^jO-x1pzdbyOLcxEV4UR~`rr z;2SXsqsNsETtGsYlZm(*v!f5TSm}UyJaPSed_t}c^iBB#rPqw!$nTg|Goa^zd1A<4 zvVBm{WtgFPMAf z?I+f1nj4*&42?1zLDdG;*JE#zSkl-jKaT2G3g3?ZD?^}SOgJ}JIx?n`b>u9XcS%#F zBcqDfQwiJ89@Vqpj3$+3Pjojg-t2r9rL?$2T@e5js_<%2LsGYfgdrd+-sNSGadlJ8 z7fa30$1YUNSsbZxi;olfI8sady^>?AI?fxU+FC5?+^admUU~T~2a9$Koi1lVSG-u( zEK`ilPn-(iOl;;ome}vH9C292i)8Y1rmW`mu)IX{Ai9j_$4DlzTsQipKE&@6w0lT( zE$v6DHcBmrXWdS~R-i0A?}#r{3b4*n(jvnr8=I>KU2LqsK&Kue2A$*P1kUaRJ*lR* zsvezmNU-mkwhTp*$8h44_JQATVy6x~-%jv&u?3%IIme%cwP@@es}Au+cOct6QJ=tX zL!LPQCINDsCoVg`B-^W!sbn1M7=Y#1g z;uDcmT?@fz2Tws%pQ4yI$AwynVHIex^)=-uqWc2dF}<47E3z|QIed~&C7^NrBfk$V zgnW9ejm?gl^gN~EU1dDg>y6P%b-Pi)Qj{w@@aihH*!T)RUxs~CC=rXogtC92?W^MPg#&7_#pT^&UvT2_95YWWb1{7|5EWKN^i$oiO30K3HdH!C+lf9`FA~D{bD2fdi>7} z;V)2)>TiRG@$&Wvm!`ikn4XHCbj;Pz|u^08GLJ zL#WD7pm)VR9+`~+Ya0``ZS)Gvp_Y!oVXJgr+TcNww`1rP)B@{G=WH4GUvx0DC>-p> zNPB|Y1@iP7E#xsD%*@<8idoZAZ$~ZhAS>qs8h`S;eEVe&+(TmaneMB`*u2}1jlumR z^6MfM4T&!w@c9MX-R<&F_2+u`Ojjp(ZrWW_;m_k6F_?HK$M=Hb00000NkvXX Hu0mjft!6mH literal 0 HcmV?d00001 diff --git a/elepower_dynamics/textures/elepower_etching_acid.png b/elepower_dynamics/textures/elepower_etching_acid.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c550d0ff3a179e6189e48a8f91f3565bc2c482 GIT binary patch literal 986 zcmV<0110>4P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U=K7a^xrshTl2G9sx-RiQ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