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 0000000..c06c1fc Binary files /dev/null and b/elepower_dynamics/textures/elepower_acidic_compound.png differ diff --git a/elepower_dynamics/textures/elepower_blank_pcb.png b/elepower_dynamics/textures/elepower_blank_pcb.png new file mode 100644 index 0000000..619c652 Binary files /dev/null and b/elepower_dynamics/textures/elepower_blank_pcb.png differ diff --git a/elepower_dynamics/textures/elepower_etching_acid.png b/elepower_dynamics/textures/elepower_etching_acid.png new file mode 100644 index 0000000..d0c550d Binary files /dev/null and b/elepower_dynamics/textures/elepower_etching_acid.png differ diff --git a/elepower_dynamics/textures/elepower_pcb.png b/elepower_dynamics/textures/elepower_pcb.png index 4067d70..7899614 100644 Binary files a/elepower_dynamics/textures/elepower_pcb.png and b/elepower_dynamics/textures/elepower_pcb.png differ diff --git a/elepower_fapi/transfer_node.lua b/elepower_fapi/transfer_node.lua index fa0641e..8707960 100644 --- a/elepower_fapi/transfer_node.lua +++ b/elepower_fapi/transfer_node.lua @@ -83,8 +83,7 @@ function elefluid.register_transfer_duct(nodename, nodedef) connects_to = { "group:elefluid_transport", "group:elefluid_transport_source", - "group:fluid_container", - "group:fluidity_tank" + "group:fluid_container" }, } @@ -94,8 +93,8 @@ function elefluid.register_transfer_duct(nodename, nodedef) end end - nodedef.on_construct = elefluid.clear_networks - nodedef.after_destruct = elefluid.clear_networks +-- nodedef.on_construct = elefluid.refresh_node +-- nodedef.after_destruct = elefluid.refresh_node minetest.register_node(nodename, nodedef) end