PCB etching

This commit is contained in:
Evert Prants 2018-06-24 12:10:47 +03:00
parent 708b9a3587
commit e14838deeb
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
10 changed files with 144 additions and 5 deletions

View File

@ -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 = {

View File

@ -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", {

View File

@ -106,7 +106,7 @@ elepd.register_dust("viridisium", {
})
elepd.register_dust("wood", {
description = "Wood Shavings",
description = "Sawdust",
force_description = true,
color = "#847454"
})

View File

@ -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")

View File

@ -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")

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -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