forked from minetest-mods/technic
Compare commits
9 Commits
master
...
recipes_re
Author | SHA1 | Date | |
---|---|---|---|
|
9004ab3322 | ||
|
01b475c7cc | ||
|
63ab5ef5d4 | ||
|
74d54eb0b4 | ||
|
d9fc156960 | ||
|
c26f45c962 | ||
|
775cb9d132 | ||
|
fb15df52e2 | ||
|
43295b5b7f |
@ -61,6 +61,24 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:fine_gold_wire 2',
|
||||
recipe = {
|
||||
{'', 'default:gold_ingot', ''},
|
||||
{'', 'default:gold_ingot', ''},
|
||||
{'', 'default:gold_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:fine_silver_wire 2',
|
||||
recipe = {
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
{'', 'moreores:silver_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:copper_coil 1',
|
||||
recipe = {
|
||||
@ -131,6 +149,15 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:machine_casing",
|
||||
recipe = {
|
||||
{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
|
||||
{ "technic:cast_iron_ingot", "technic:brass_ingot", "technic:cast_iron_ingot" },
|
||||
{ "technic:cast_iron_ingot", "technic:cast_iron_ingot", "technic:cast_iron_ingot" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Remove some recipes
|
||||
minetest.register_craftitem("technic:nothing", {
|
||||
description = "",
|
||||
|
@ -80,6 +80,16 @@ minetest.register_craftitem("technic:fine_copper_wire", {
|
||||
inventory_image = "technic_fine_copper_wire.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:fine_gold_wire", {
|
||||
description = S("Fine Gold Wire"),
|
||||
inventory_image = "technic_fine_gold_wire.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:fine_silver_wire", {
|
||||
description = S("Fine Silver Wire"),
|
||||
inventory_image = "technic_fine_silver_wire.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("technic:copper_coil", {
|
||||
description = S("Copper Coil"),
|
||||
inventory_image = "technic_copper_coil.png",
|
||||
@ -144,3 +154,12 @@ minetest.register_craftitem("technic:carbon_cloth", {
|
||||
inventory_image = "technic_carbon_cloth.png",
|
||||
})
|
||||
|
||||
minetest.register_node("technic:machine_casing", {
|
||||
description = S("Machine Casing"),
|
||||
groups = {cracky=2},
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
drawtype = "allfaces",
|
||||
tiles = {"technic_machine_casing.png"},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
@ -14,9 +14,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = 'technic:forcefield_emitter_off',
|
||||
recipe = {
|
||||
{'default:mese', 'technic:deployer_off', 'default:mese' },
|
||||
{'technic:deployer_off', 'technic:motor', 'technic:deployer_off'},
|
||||
{'default:mese', 'technic:deployer_off', 'default:mese' },
|
||||
{'default:mese', 'technic:motor', 'default:mese' },
|
||||
{'technic:deployer_off', 'technic:machine_casing', 'technic:deployer_off'},
|
||||
{'default:mese', 'technic:hv_cable0', 'default:mese' },
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,8 +4,8 @@ minetest.register_craft({
|
||||
output = 'technic:hv_generator',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_generator', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable0', 'technic:stainless_steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -17,8 +17,8 @@ minetest.register_craft({
|
||||
output = 'technic:hv_nuclear_reactor_core',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
|
||||
{'technic:stainless_steel_ingot', '', 'technic:stainless_steel_ingot'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
|
||||
{'technic:stainless_steel_ingot', 'technic:machine_casing', 'technic:stainless_steel_ingot'},
|
||||
{'technic:stainless_steel_ingot', 'technic:hv_cable0', 'technic:stainless_steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -3,9 +3,9 @@ local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"technic:carbon_steel_block", "pipeworks:filter", "technic:carbon_steel_block"},
|
||||
{"technic:carbon_steel_block", "technic:motor", "technic:carbon_steel_block"},
|
||||
{"technic:carbon_steel_block", "technic:diamond_drill_head", "technic:carbon_steel_block"}},
|
||||
{"technic:carbon_steel_block", "pipeworks:filter", "technic:carbon_steel_block"},
|
||||
{"technic:motor", "technic:machine_casing", "technic:diamond_drill_head"},
|
||||
{"technic:carbon_steel_block", "technic:hv_cable0", "technic:carbon_steel_block"}},
|
||||
output = "technic:quarry",
|
||||
})
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_alloy_furnace',
|
||||
recipe = {
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', '', 'default:brick'},
|
||||
{'technic:cast_iron_ingot', 'default:copper_ingot', 'technic:cast_iron_ingot'},
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', 'technic:machine_casing', 'default:brick'},
|
||||
{'default:brick', 'technic:lv_cable0', 'default:brick'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_battery_box0',
|
||||
recipe = {
|
||||
{'technic:battery', 'group:wood', 'technic:battery'},
|
||||
{'technic:battery', 'default:copper_ingot', 'technic:battery'},
|
||||
{'technic:cast_iron_ingot', 'technic:cast_iron_ingot', 'technic:cast_iron_ingot'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'technic:battery', 'technic:machine_casing', 'technic:battery'},
|
||||
{'technic:battery', 'technic:lv_cable0', 'technic:battery'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -229,8 +229,8 @@ minetest.register_craft({
|
||||
output = 'technic:cnc',
|
||||
recipe = {
|
||||
{'default:glass', 'technic:diamond_drill_head', 'default:glass'},
|
||||
{'technic:control_logic_unit', 'technic:motor', 'technic:carbon_steel_ingot'},
|
||||
{'technic:carbon_steel_ingot', 'default:copper_ingot', 'technic:carbon_steel_ingot'},
|
||||
{'technic:control_logic_unit', 'technic:machine_casing', 'technic:motor'},
|
||||
{'technic:carbon_steel_ingot', 'technic:lv_cable0', 'technic:carbon_steel_ingot'},
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -12,8 +12,18 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
local machine_name = S("Fuel-Fired Alloy Furnace")
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"label[0,0;"..machine_name.."]"..
|
||||
"image[2,2;1,1;default_furnace_fire_bg.png]"..
|
||||
"list[current_name;fuel;2,3;1,1;]"..
|
||||
"list[current_name;src;2,1;2,1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
minetest.register_node("technic:coal_alloy_furnace", {
|
||||
description = S("Fuel-Fired Alloy Furnace"),
|
||||
description = machine_name,
|
||||
tiles = {"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front.png"},
|
||||
@ -23,8 +33,8 @@ minetest.register_node("technic:coal_alloy_furnace", {
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("formspec", coal_alloy_furnace_formspec)
|
||||
meta:set_string("infotext", S("Fuel-Fired Alloy Furnace"))
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("infotext", machine_name)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("fuel", 1)
|
||||
inv:set_size("src", 2)
|
||||
@ -37,7 +47,7 @@ minetest.register_node("technic:coal_alloy_furnace", {
|
||||
})
|
||||
|
||||
minetest.register_node("technic:coal_alloy_furnace_active", {
|
||||
description = S("Fuel-Fired Alloy Furnace"),
|
||||
description = machine_name,
|
||||
tiles = {"technic_coal_alloy_furnace_top.png", "technic_coal_alloy_furnace_bottom.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
|
||||
"technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front_active.png"},
|
||||
@ -68,15 +78,6 @@ minetest.register_abm({
|
||||
end
|
||||
|
||||
local recipe = nil
|
||||
local machine_name = S("Fuel-Fired Alloy Furnace")
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"label[0,0;"..machine_name.."]"..
|
||||
"image[2,2;1,1;default_furnace_fire_bg.png]"..
|
||||
"list[current_name;fuel;2,3;1,1;]"..
|
||||
"list[current_name;src;2,1;2,1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
for i, name in pairs({
|
||||
"fuel_totaltime",
|
||||
|
@ -4,9 +4,9 @@ minetest.register_alias("compressor", "technic:lv_compressor")
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_compressor',
|
||||
recipe = {
|
||||
{'default:stone', 'default:stone', 'default:stone'},
|
||||
{'mesecons:piston', 'technic:motor', 'mesecons:piston'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
{'default:stone', 'technic:motor', 'default:stone'},
|
||||
{'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:electric_furnace',
|
||||
recipe = {
|
||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
||||
{'default:cobble', '', 'default:cobble'},
|
||||
{'technic:cast_iron_ingot', 'moreores:copper_ingot', 'technic:cast_iron_ingot'},
|
||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
||||
{'default:cobble', 'technic:machine_casing', 'default:cobble'},
|
||||
{'default:cobble', 'technic:lv_cable0', 'default:cobble'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,9 +4,9 @@ minetest.register_alias("extractor", "technic:lv_extractor")
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_extractor',
|
||||
recipe = {
|
||||
{'technic:treetap', 'technic:motor', 'technic:treetap'},
|
||||
{'technic:treetap', 'technic:lv_cable0', 'technic:treetap'},
|
||||
{'', '', ''},
|
||||
{'technic:treetap', 'technic:motor', 'technic:treetap'},
|
||||
{'technic:treetap', 'technic:machine_casing', 'technic:treetap'},
|
||||
{'', 'technic:lv_cable0', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator")
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_generator',
|
||||
recipe = {
|
||||
{'default:stone', 'default:stone', 'default:stone'},
|
||||
{'default:stone', '', 'default:stone'},
|
||||
{'default:stone', 'default:copper_ingot', 'default:stone'},
|
||||
{'default:stone', 'default:stone', 'default:stone'},
|
||||
{'default:stone', 'technic:machine_casing', 'default:stone'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -10,9 +10,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = 'technic:geothermal',
|
||||
recipe = {
|
||||
{'default:stone', 'default:stone', 'default:stone'},
|
||||
{'default:copper_ingot', 'default:diamond', 'default:copper_ingot'},
|
||||
{'default:stone', 'default:copper_ingot', 'default:stone'},
|
||||
{'default:stone', 'default:diamond', 'default:stone'},
|
||||
{'default:copper_ingot', 'technic:machine_casing', 'default:copper_ingot'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:grinder")
|
||||
minetest.register_craft({
|
||||
output = 'technic:grinder',
|
||||
recipe = {
|
||||
{'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
|
||||
{'default:desert_stone', 'default:diamond', 'default:desert_stone'},
|
||||
{'default:stone', 'moreores:copper_ingot', 'default:stone'},
|
||||
{'default:desert_stone', 'default:diamond', 'default:desert_stone'},
|
||||
{'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player")
|
||||
minetest.register_craft({
|
||||
output = 'technic:music_player',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'default:diamond', 'default:diamond', 'default:diamond'},
|
||||
{'default:stone', 'default:copper_ingot', 'default:stone'},
|
||||
{'group:wood', 'default:diamond', 'group:wood'},
|
||||
{'default:diamond', 'technic:machine_casing', 'default:diamond'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -9,9 +9,9 @@ minetest.register_alias("water_mill", "technic:water_mill")
|
||||
minetest.register_craft({
|
||||
output = 'technic:water_mill',
|
||||
recipe = {
|
||||
{'default:stone', 'default:stone', 'default:stone'},
|
||||
{'group:wood', 'default:diamond', 'group:wood'},
|
||||
{'default:stone', 'default:copper_ingot', 'default:stone'},
|
||||
{'default:stone', 'default:diamond', 'default:stone'},
|
||||
{'group:wood', 'technic:machine_casing', 'group:wood'},
|
||||
{'default:stone', 'technic:lv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,8 +4,8 @@ minetest.register_craft({
|
||||
output = 'technic:mv_generator',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:lv_generator', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
|
||||
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_cable0', 'technic:stainless_steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -138,9 +138,9 @@ minetest.register_node("technic:power_radiator", {
|
||||
minetest.register_craft({
|
||||
output = 'technic:power_radiator 1',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
|
||||
{'technic:copper_coil', 'technic:mv_transformer', 'technic:copper_coil'},
|
||||
{'technic:rubber', 'technic:mv_cable0', 'technic:rubber'},
|
||||
{'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'},
|
||||
{'technic:copper_coil', 'technic:machine_casing', 'technic:copper_coil'},
|
||||
{'technic:rubber', 'technic:mv_cable0', 'technic:rubber'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -8,9 +8,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = 'technic:tool_workshop',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'default:diamond', 'group:wood'},
|
||||
{'default:stone', 'default:copper_ingot', 'default:stone'},
|
||||
{'group:wood', 'default:diamond', 'group:wood'},
|
||||
{'group:wood', 'technic:machine_casing', 'group:wood'},
|
||||
{'default:stone', 'technic:mv_cable0', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -13,9 +13,9 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'technic:wind_mill',
|
||||
recipe = {
|
||||
{'', 'technic:carbon_steel_ingot', ''},
|
||||
{'technic:carbon_steel_ingot', 'technic:motor', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:carbon_steel_block', ''},
|
||||
{'', 'technic:motor', ''},
|
||||
{'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:mv_cable0', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -18,7 +18,7 @@ local recipes = {
|
||||
{"technic:carbon_steel_dust 3", "technic:chromium_dust", "technic:stainless_steel_dust 4"},
|
||||
{"technic:carbon_steel_ingot 3", "technic:chromium_ingot", "technic:stainless_steel_ingot 4"},
|
||||
{"technic:copper_dust 2", "technic:zinc_dust", "technic:brass_dust 3"},
|
||||
{"technic:copper_ingot 2", "technic:zinc_ingot", "technic:brass_ingot 3"},
|
||||
{"default:copper_ingot 2", "technic:zinc_ingot", "technic:brass_ingot 3"},
|
||||
{"default:sand 2", "technic:coal_dust 2", "technic:silicon_wafer"},
|
||||
{"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"},
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ function technic.register_recipe_type(typename, desc, numitems)
|
||||
if unified_inventory and unified_inventory.register_craft_type then
|
||||
unified_inventory.register_craft_type(typename, {
|
||||
description = desc,
|
||||
height = numtiems,
|
||||
height = numitems,
|
||||
width = 1,
|
||||
})
|
||||
end
|
||||
|
@ -32,9 +32,9 @@ minetest.register_node("technic:supply_converter", {
|
||||
minetest.register_craft({
|
||||
output = 'technic:supply_converter 1',
|
||||
recipe = {
|
||||
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
|
||||
{'technic:mv_transformer', 'technic:mv_cable0', 'technic:lv_transformer'},
|
||||
{'technic:mv_cable0', 'technic:rubber', 'technic:lv_cable0'},
|
||||
{'technic:stainless_steel_ingot', 'technic:rubber', 'technic:stainless_steel_ingot'},
|
||||
{'technic:mv_transformer', 'technic:machine_casing', 'technic:lv_transformer'},
|
||||
{'technic:mv_cable0', 'technic:rubber', 'technic:lv_cable0'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -35,9 +35,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = "technic:switching_station",
|
||||
recipe = {
|
||||
{"technic:cast_iron_ingot", "technic:lv_transformer", "technic:cast_iron_ingot"},
|
||||
{"default:copper_ingot", "technic:lv_cable0", "default:copper_ingot"},
|
||||
{"technic:cast_iron_ingot", "technic:lv_cable0", "technic:cast_iron_ingot"}
|
||||
{"", "technic:lv_transformer", ""},
|
||||
{"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"},
|
||||
{"technic:lv_cable0", "technic:lv_cable0", "technic:lv_cable0"}
|
||||
}
|
||||
})
|
||||
|
||||
|
BIN
technic/sounds/technic_prospector_hit.ogg
Normal file
BIN
technic/sounds/technic_prospector_hit.ogg
Normal file
Binary file not shown.
BIN
technic/sounds/technic_prospector_miss.ogg
Normal file
BIN
technic/sounds/technic_prospector_miss.ogg
Normal file
Binary file not shown.
BIN
technic/textures/technic_fine_gold_wire.png
Normal file
BIN
technic/textures/technic_fine_gold_wire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 474 B |
BIN
technic/textures/technic_fine_silver_wire.png
Normal file
BIN
technic/textures/technic_fine_silver_wire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 546 B |
BIN
technic/textures/technic_machine_casing.png
Normal file
BIN
technic/textures/technic_machine_casing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 673 B |
BIN
technic/textures/technic_prospector.png
Normal file
BIN
technic/textures/technic_prospector.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 367 B |
BIN
technic/textures/technicx32/technic_fine_gold_wire.png
Normal file
BIN
technic/textures/technicx32/technic_fine_gold_wire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
technic/textures/technicx32/technic_fine_silver_wire.png
Normal file
BIN
technic/textures/technicx32/technic_fine_silver_wire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@ -13,6 +13,7 @@ dofile(path.."/cans.lua")
|
||||
dofile(path.."/chainsaw.lua")
|
||||
dofile(path.."/tree_tap.lua")
|
||||
dofile(path.."/sonic_screwdriver.lua")
|
||||
dofile(path.."/prospector.lua")
|
||||
|
||||
if minetest.get_modpath("screwdriver") then
|
||||
-- compatibility alias
|
||||
|
126
technic/tools/prospector.lua
Normal file
126
technic/tools/prospector.lua
Normal file
@ -0,0 +1,126 @@
|
||||
local S = technic.getter
|
||||
|
||||
technic.register_power_tool("technic:prospector", 15000)
|
||||
|
||||
local function get_metadata(toolstack)
|
||||
local m = minetest.deserialize(toolstack:get_metadata())
|
||||
if not m then m = {} end
|
||||
if not m.charge then m.charge = 0 end
|
||||
if not m.target then m.target = "" end
|
||||
if not m.look_depth then m.look_depth = 7 end
|
||||
if not m.look_radius then m.look_radius = 1 end
|
||||
return m
|
||||
end
|
||||
|
||||
minetest.register_tool("technic:prospector", {
|
||||
description = S("Prospector"),
|
||||
inventory_image = "technic_prospector.png",
|
||||
wear_represents = "technic_RE_charge",
|
||||
on_refill = technic.refill_RE_charge,
|
||||
on_use = function(toolstack, user, pointed_thing)
|
||||
if not user or not user:is_player() or user.is_fake_player then return end
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
local toolmeta = get_metadata(toolstack)
|
||||
local look_diameter = toolmeta.look_radius * 2 + 1
|
||||
local charge_to_take = toolmeta.look_depth * (toolmeta.look_depth + 1) * look_diameter * look_diameter
|
||||
if toolmeta.charge < charge_to_take then return end
|
||||
if toolmeta.target == "" then
|
||||
minetest.chat_send_player(user:get_player_name(), "Right-click to set target block type")
|
||||
return
|
||||
end
|
||||
toolmeta.charge = toolmeta.charge - charge_to_take
|
||||
toolstack:set_metadata(minetest.serialize(toolmeta))
|
||||
technic.set_RE_wear(toolstack, toolmeta.charge, technic.power_tools[toolstack:get_name()])
|
||||
local start_pos = pointed_thing.under
|
||||
local forward = minetest.facedir_to_dir(minetest.dir_to_facedir(user:get_look_dir(), true))
|
||||
local right = forward.x ~= 0 and { x=0, y=1, z=0 } or (forward.y ~= 0 and { x=0, y=0, z=1 } or { x=1, y=0, z=0 })
|
||||
local up = forward.x ~= 0 and { x=0, y=0, z=1 } or (forward.y ~= 0 and { x=1, y=0, z=0 } or { x=0, y=1, z=0 })
|
||||
local base_pos = vector.add(start_pos, vector.multiply(vector.add(right, up), - toolmeta.look_radius))
|
||||
local found = false
|
||||
for f = 0, toolmeta.look_depth-1 do
|
||||
for r = 0, look_diameter-1 do
|
||||
for u = 0, look_diameter-1 do
|
||||
if minetest.get_node(vector.add(vector.add(vector.add(base_pos, vector.multiply(forward, f)), vector.multiply(right, r)), vector.multiply(up, u))).name == toolmeta.target then found = true end
|
||||
end
|
||||
end
|
||||
end
|
||||
if math.random() < 0.02 then found = not found end
|
||||
minetest.chat_send_player(user:get_player_name(), minetest.registered_nodes[toolmeta.target].description.." is "..(found and "present" or "absent").." in "..look_diameter.."x"..look_diameter.."x"..toolmeta.look_depth.." region")
|
||||
minetest.sound_play("technic_prospector_"..(found and "hit" or "miss"), { pos = vector.add(user:getpos(), { x = 0, y = 1, z = 0 }), gain = 1.0, max_hear_distance = 10 })
|
||||
return toolstack
|
||||
end,
|
||||
on_place = function(toolstack, user, pointed_thing)
|
||||
if not user or not user:is_player() or user.is_fake_player then return end
|
||||
local toolmeta = get_metadata(toolstack)
|
||||
local pointed
|
||||
if pointed_thing.type == "node" then
|
||||
local pname = minetest.get_node(pointed_thing.under).name
|
||||
local pdef = minetest.registered_nodes[pname]
|
||||
if pdef and (pdef.groups.not_in_creative_inventory or 0) == 0 and pname ~= toolmeta.target then
|
||||
pointed = pname
|
||||
end
|
||||
end
|
||||
local look_diameter = toolmeta.look_radius * 2 + 1
|
||||
minetest.show_formspec(user:get_player_name(), "technic:prospector_control",
|
||||
"size[7,8.5]"..
|
||||
"item_image[0,0;1,1;"..toolstack:get_name().."]"..
|
||||
"label[1,0;"..minetest.formspec_escape(toolstack:get_definition().description).."]"..
|
||||
(toolmeta.target ~= "" and
|
||||
"label[0,1.5;Current target:]"..
|
||||
"label[0,2;"..minetest.formspec_escape(minetest.registered_nodes[toolmeta.target].description).."]"..
|
||||
"item_image[0,2.5;1,1;"..toolmeta.target.."]" or
|
||||
"label[0,1.5;No target set]")..
|
||||
(pointed and
|
||||
"label[3.5,1.5;May set new target:]"..
|
||||
"label[3.5,2;"..minetest.formspec_escape(minetest.registered_nodes[pointed].description).."]"..
|
||||
"item_image[3.5,2.5;1,1;"..pointed.."]"..
|
||||
"button_exit[3.5,3.65;2,0.5;target_"..pointed..";Set target]" or
|
||||
"label[3.5,1.5;No new target available]")..
|
||||
"label[0,4.5;Region cross section:]"..
|
||||
"label[0,5;"..look_diameter.."x"..look_diameter.."]"..
|
||||
"label[3.5,4.5;Set region cross section:]"..
|
||||
"button_exit[3.5,5.15;1,0.5;look_radius_0;1x1]"..
|
||||
"button_exit[4.5,5.15;1,0.5;look_radius_1;3x3]"..
|
||||
"button_exit[5.5,5.15;1,0.5;look_radius_3;7x7]"..
|
||||
"label[0,6;Region depth:]"..
|
||||
"label[0,6.5;"..toolmeta.look_depth.."]"..
|
||||
"label[3.5,6;Set region depth:]"..
|
||||
"button_exit[3.5,6.65;1,0.5;look_depth_7;7]"..
|
||||
"button_exit[4.5,6.65;1,0.5;look_depth_14;14]"..
|
||||
"button_exit[5.5,6.65;1,0.5;look_depth_21;21]"..
|
||||
"label[0,7.5;Accuracy:]"..
|
||||
"label[0,8;98%]")
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_player_receive_fields(function(user, formname, fields)
|
||||
if formname ~= "technic:prospector_control" then return false end
|
||||
if not user or not user:is_player() or user.is_fake_player then return end
|
||||
local toolstack = user:get_wielded_item()
|
||||
if toolstack:get_name() ~= "technic:prospector" then return true end
|
||||
local toolmeta = get_metadata(toolstack)
|
||||
for field, value in pairs(fields) do
|
||||
if field:sub(1, 7) == "target_" then
|
||||
toolmeta.target = field:sub(8)
|
||||
end
|
||||
if field:sub(1, 12) == "look_radius_" then
|
||||
toolmeta.look_radius = field:sub(13)
|
||||
end
|
||||
if field:sub(1, 11) == "look_depth_" then
|
||||
toolmeta.look_depth = field:sub(12)
|
||||
end
|
||||
end
|
||||
toolstack:set_metadata(minetest.serialize(toolmeta))
|
||||
user:set_wielded_item(toolstack)
|
||||
return true
|
||||
end)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:prospector",
|
||||
recipe = {
|
||||
{"moreores:pick_silver", "moreores:mithril_block", "pipeworks:teleport_tube_1"},
|
||||
{"technic:brass_ingot", "technic:control_logic_unit", "technic:brass_ingot"},
|
||||
{"", "technic:brass_ingot", ""},
|
||||
}
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user