added realtest

master
Brett O'Donnell 2012-09-27 17:55:53 +09:30
parent b1564871c0
commit 7a5f07d1f2
435 changed files with 2357 additions and 6 deletions

View File

@ -159,6 +159,7 @@ gloopores - http://minetest.net/forum/viewtopic.php?id=2734
infinitytools - http://minetest.net/forum/viewtopic.php?id=2535
moreores - http://minetest.net/forum/viewtopic.php?id=549
poison - http://minetest.net/forum/viewtopic.php?id=1591
realtest - http://minetest.net/forum/viewtopic.php?id=2671
ropes - http://mirkolinux.wordpress.com/2011/12/03/rope-mod-for-minetest/
titanium - http://minetest.net/forum/viewtopic.php?id=3113
throwing - http://minetest.net/forum/viewtopic.php?id=2805
@ -170,6 +171,13 @@ workbench - http://minetest.net/forum/viewtopic.php?id=2000
Future considerations:
----------
hunger - http://minetest.net/forum/viewtopic.php?id=3114
- still in development
mobs - http://minetest.net/forum/viewtopic.php?id=3063
- too many mobs, need to get other mods working nicely
slimes - http://minetest.net/forum/viewtopic.php?id=2979
- need to get other mods working before mobs/animals
Disabled mods:
@ -178,12 +186,6 @@ Disabled mods:
metals - http://minetest.net/forum/viewtopic.php?id=2526
- crafts conflict and most items are in streets or pipeworks
mobs - http://minetest.net/forum/viewtopic.php?id=3063
- too many mobs, need to get other mods working nicely
slimes - http://minetest.net/forum/viewtopic.php?id=2979
- need to get other mods working before mobs/animals
brick - http://minetest.net/forum/viewtopic.php?id=1631
- recipies conflicted, mods with better textures are used

View File

@ -0,0 +1,2 @@
default
metals

View File

@ -0,0 +1,192 @@
anvil = {}
HAMMERS_LIST={
'anvil:hammer',
'metals:tool_hammer_bismuth',
'metals:tool_hammer_pig_iron',
'metals:tool_hammer_wrought_iron',
'metals:tool_hammer_steel',
'metals:tool_hammer_gold',
'metals:tool_hammer_nickel',
'metals:tool_hammer_platinum',
'metals:tool_hammer_tin',
'metals:tool_hammer_silver',
'metals:tool_hammer_lead',
'metals:tool_hammer_copper',
'metals:tool_hammer_zinc',
'metals:tool_hammer_brass',
'metals:tool_hammer_sterling_silver',
'metals:tool_hammer_rose_gold',
'metals:tool_hammer_black_bronze',
'metals:tool_hammer_bismuth_bronze',
'metals:tool_hammer_bronze',
'metals:tool_hammer_black_steel',
}
local table_containts = function(t, v)
for _, i in ipairs(t) do
if i==v then
return true
end
end
return false
end
minetest.register_craft({
output = 'anvil:self',
recipe = {
{'default:cobble','default:cobble','default:cobble'},
{'','default:cobble',''},
{'default:cobble','default:cobble','default:cobble'},
}
})
minetest.register_craft({
output = 'anvil:hammer',
recipe = {
{'default:cobble','default:cobble','default:cobble'},
{'default:cobble','default:stick','default:cobble'},
{'','default:stick',''},
}
})
minetest.register_tool("anvil:hammer", {
description = "Hammer",
inventory_image = "anvil_hammer.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
cracky={times={[1]=6.00, [2]=4.30, [3]=3.00}, uses=20, maxlevel=1},
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
}
},
})
minetest.register_node("anvil:self", {
description = "Anvil",
tiles = {"anvil_top.png","anvil_top.png","anvil_side.png"},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.3,0.5,-0.4,0.3},
{-0.35,-0.4,-0.25,0.35,-0.3,0.25},
{-0.3,-0.3,-0.15,0.3,-0.1,0.15},
{-0.35,-0.1,-0.2,0.35,0.1,0.2},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.3,0.5,-0.4,0.3},
{-0.35,-0.4,-0.25,0.35,-0.3,0.25},
{-0.3,-0.3,-0.15,0.3,-0.1,0.15},
{-0.35,-0.1,-0.2,0.35,0.1,0.2},
},
},
groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", "invsize[8,10;]"..
"list[current_name;hammer;1,3.5;1,1;]"..
"list[current_name;ingot;1,1.5;1,1;]"..
"list[current_name;recipe;6,1.5;1,1;]"..
"list[current_name;res;3,1.5;1,1;]"..
"label[1,1;Ingot:]"..
"label[6,1;Recipe:]"..
"label[3,1;Output:]"..
"label[1,3;Hammer:]"..
"button[4,2.5;2,3;forge;Forge]"..
"list[current_player;main;0,6;8,4;]")
meta:set_string("infotext", "Anvil")
local inv = meta:get_inventory()
inv:set_size("hammer", 1)
inv:set_size("ingot", 1)
inv:set_size("recipe", 1)
inv:set_size("res", 1)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if fields["forge"] then
local ingotstack = inv:get_stack("ingot", 1)
local recipestack = inv:get_stack("recipe", 1)
local hammerstack = inv:get_stack("hammer", 1)
local resstack = inv:get_stack("res", 1)
if table_containts(HAMMERS_LIST, hammerstack:get_name()) then
local s = ingotstack:get_name()
if recipestack:get_name()=="metals:recipe_axe" then
inv:add_item("res","metals:tool_axe_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif recipestack:get_name()=="metals:recipe_hammer" then
inv:add_item("res","metals:tool_hammer_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif recipestack:get_name()=="metals:recipe_pick" then
inv:add_item("res","metals:tool_pick_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif recipestack:get_name()=="metals:recipe_shovel" then
inv:add_item("res","metals:tool_shovel_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif recipestack:get_name()=="metals:recipe_spear" then
inv:add_item("res","metals:tool_spear_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif recipestack:get_name()=="metals:recipe_sword" then
inv:add_item("res","metals:tool_sword_"..string.sub(s,8,string.len(s)-6).."_head")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif ingotstack:get_name()=="metals:pig_iron_ingot" then
inv:add_item("res","metals:wrought_iron_ingot")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif ingotstack:get_name()=="metals:wrought_iron_ingot" then
inv:add_item("res","default:steel_ingot")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
elseif string.sub(ingotstack:get_name(), 1, 6)=="metals" and string.sub(ingotstack:get_name(),string.len(ingotstack:get_name())-9,9)=="_unshaped" then
inv:add_item("res", "metals:"..string.sub(ingotstack:get_name(),7,string.len(ingotstack:get_name())-13).."_ingot")
ingotstack:take_item()
inv:set_stack("ingot",1,ingotstack)
hammerstack:add_wear(65535/30)
inv:set_stack("hammer",1,hammerstack)
return
end
end
end
minetest.chatsendall(string.sub(ingotstack:get_name(), 1, 6))
minetest.chatsendall(string.sub(ingotstack:get_name(),string.len(ingotstack:get_name())-9,9))
end,
})

View File

@ -0,0 +1,3 @@
[Dolphin]
PreviewsShown=true
Timestamp=2012,8,16,19,24,54

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1,205 @@
bonfire = {}
minetest.register_craft({
output = 'bonfire:self',
recipe = {
{'default:stick','default:stick','default:stick'},
}
})
bonfire.formspec =
"invsize[8,9;]"..
"image[0,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;0,1;1,1;]"..
"list[current_name;src;3,1;1,1;]"..
"list[current_name;dst;2,3;2,1;]"..
"list[current_name;add;5,1;2,2;]"..
"label[3,0;Source:]"..
"label[0,0;Fuel:]"..
"label[2,2;Output:]"..
"label[5,0;Additional:]"..
"list[current_player;main;0,5;8,4;]"
minetest.register_node("bonfire:self", {
description = "Bonfire",
tiles = {"bonfire_top.png", "bonfire_bottom.png", "bonfire_side.png"},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.45,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.45,0.5},
},
},
groups = {crumbly=3, oddly_breakable_by_hand=1},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", bonfire.formspec)
meta:set_string("infotext", "Bonfire")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 2)
inv:set_size("add", 4)
end,
})
minetest.register_node("bonfire:self_active", {
description = "Bonfire",
tiles = {"bonfire_top_active.png", "bonfire_bottom.png", "bonfire_side_active.png"},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.45,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.45,0.5},
},
},
light_source = 12,
drop = "bonfire:self",
groups = {crumbly=3},-- not_in_creative_inventory=1}, --recoment
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", bonfire.formspec)
meta:set_string("infotext", "Bonfire")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 2)
inv:set_size("add", 4)
end,
})
function hacky_swap_node(pos,name)
local node = minetest.env:get_node(pos)
local meta = minetest.env:get_meta(pos)
local meta0 = meta:to_table()
if node.name == name then
return
end
node.name = name
local meta0 = meta:to_table()
minetest.env:set_node(pos,node)
meta = minetest.env:get_meta(pos)
meta:from_table(meta0)
end
minetest.register_abm({
nodenames = {"bonfire:self","bonfire:self_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.env:get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"src_totaltime",
"src_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local cooked = nil
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("src_time", meta:get_float("src_time") + 1)
if cooked and cooked.item and meta:get_float("src_time") >= cooked.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",cooked.item) then
-- Put result in "dst" list
inv:add_item("dst", cooked.item)
-- take stuff from "src" list
srcstack = inv:get_stack("src", 1)
srcstack:take_item()
inv:set_stack("src", 1, srcstack)
--else
--print("Could not insert '"..cooked.item.."'")
end
meta:set_string("src_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Bonfire active: "..percent.."%")
hacky_swap_node(pos,"bonfire:self_active")
meta:set_string("formspec",
"invsize[8,9;]"..
"image[0,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;0,1;1,1;]"..
"list[current_name;src;3,1;1,1;]"..
"list[current_name;dst;2,3;2,1;]"..
"list[current_name;add;5,1;2,2;]"..
"label[3,0;Source:]"..
"label[0,0;Fuel:]"..
"label[2,2;Output:]"..
"label[5,0;Additional:]"..
"list[current_player;main;0,5;8,4;]")
return
end
local fuel = nil
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
meta:set_string("infotext","Bonfire out of fuel")
hacky_swap_node(pos,"bonfire:self")
meta:set_string("formspec", bonfire.formspec)
return
end
if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Bonfire is empty")
hacky_swap_node(pos,"bonfire:self")
meta:set_string("formspec", bonfire.formspec)
end
return
end
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)
end,
})

View File

@ -0,0 +1,3 @@
[Dolphin]
PreviewsShown=true
Timestamp=2012,8,16,19,24,54

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1,207 @@
furnace = {}
minetest.register_craft({
output = 'furnace:self',
recipe = {
{'default:cobble','default:cobble','default:cobble'},
{'default:cobble','default:coal_lump','default:cobble'},
{'default:cobble','default:cobble','default:cobble'},
}
})
furnace.formspec =
"invsize[8,9;]"..
"image[0,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;0,1;1,1;]"..
"list[current_name;src;3,1;1,1;]"..
"list[current_name;dst;2,3;2,1;]"..
"list[current_name;add;5,1;2,2;]"..
"label[3,0;Source:]"..
"label[0,0;Fuel:]"..
"label[2,2;Output:]"..
"label[5,0;Additional:]"..
"list[current_player;main;0,5;8,4;]"
minetest.register_node("furnace:self", {
description = "Furnace",
tiles = {"furnace_top.png", "furnace_bottom.png", "furnace_side.png"},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5},
},
},
groups = {crumbly=3, oddly_breakable_by_hand=1},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", furnace.formspec)
meta:set_string("infotext", "Furnace")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 2)
inv:set_size("add", 4)
end,
})
minetest.register_node("furnace:self_active", {
description = "Furnace",
tiles = {"furnace_top_active.png", "furnace_bottom.png", "furnace_side_active.png"},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5},
},
},
light_source = 12,
drop = "furnace:self",
groups = {crumbly=3},-- not_in_creative_inventory=1}, --recoment
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", furnace.formspec)
meta:set_string("infotext", "Furnace")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
inv:set_size("dst", 2)
inv:set_size("add", 4)
end,
})
function hacky_swap_node(pos,name)
local node = minetest.env:get_node(pos)
local meta = minetest.env:get_meta(pos)
local meta0 = meta:to_table()
if node.name == name then
return
end
node.name = name
local meta0 = meta:to_table()
minetest.env:set_node(pos,node)
meta = minetest.env:get_meta(pos)
meta:from_table(meta0)
end
minetest.register_abm({
nodenames = {"furnace:self","furnace:self_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.env:get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"src_totaltime",
"src_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local cooked = nil
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("src_time", meta:get_float("src_time") + 1)
if cooked and cooked.item and meta:get_float("src_time") >= cooked.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",cooked.item) then
-- Put result in "dst" list
inv:add_item("dst", cooked.item)
-- take stuff from "src" list
srcstack = inv:get_stack("src", 1)
srcstack:take_item()
inv:set_stack("src", 1, srcstack)
--else
--print("Could not insert '"..cooked.item.."'")
end
meta:set_string("src_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Furnace active: "..percent.."%")
hacky_swap_node(pos,"furnace:self_active")
meta:set_string("formspec",
"invsize[8,9;]"..
"image[0,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;0,1;1,1;]"..
"list[current_name;src;3,1;1,1;]"..
"list[current_name;dst;2,3;2,1;]"..
"list[current_name;add;5,1;2,2;]"..
"label[3,0;Source:]"..
"label[0,0;Fuel:]"..
"label[2,2;Output:]"..
"label[5,0;Additional:]"..
"list[current_player;main;0,5;8,4;]")
return
end
local fuel = nil
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
meta:set_string("infotext","Furnace out of fuel")
hacky_swap_node(pos,"furnace:self")
meta:set_string("formspec", furnace.formspec)
return
end
if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Furnace is empty")
hacky_swap_node(pos,"furnace:self")
meta:set_string("formspec", furnace.formspec)
end
return
end
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

View File

@ -0,0 +1,2 @@
[Dolphin]
Timestamp=2012,7,5,0,9,4

View File

@ -0,0 +1,2 @@
minerals
default

View File

@ -0,0 +1,179 @@
USES_LIST={
bismuth=20,
pig_iron=30,
wrought_iron=30,
steel=35,
gold=10,
nickel=25,
platinum=25,
tin=15,
silver=25,
lead=20,
copper=25,
zinc=25,
brass=25,
sterling_silver=25,
rose_gold=20,
black_bronze=35,
bismuth_bronze=25,
bronze=30,
black_steel=40,
}
PICKS_CRACKY_LIST={
--stone {times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1}
--steel {times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2}
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bismuth, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.pig_iron, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.wrought_iron, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.steel, maxlevel=3},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.gold, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.nickel, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.platinum, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.tin, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.silver, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.lead, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.copper, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.zinc, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.brass, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.sterling_silver, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.rose_gold, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.black_bronze, maxlevel=3},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bismuth_bronze, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bronze, maxlevel=2},
{times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.black_steel, maxlevel=3},
}
SHOVELS_CRUMBLY_LIST={
--stone {times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1}
--steel {times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2}
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.bismuth, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.pig_iron, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.wrought_iron, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.steel, maxlevel=3},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.gold, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.nickel, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.platinum, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.tin, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.silver, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.lead, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.copper, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.zinc, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.brass, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.sterling_silver, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.rose_gold, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.black_bronze, maxlevel=3},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.bismuth_bronze, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.bronze, maxlevel=2},
{times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=USES_LIST.black_steel, maxlevel=3},
}
AXE_GROUPCAPS={
--[[ stone
{choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1},
fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1},},]]
--{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
-- fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bismuth, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.bismuth+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.pig_iron, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.pig_iron+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.wrought_iron, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.wrought_iron+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.steel, maxlevel=3},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.steel+10, maxlevel=2},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.gold, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.gold+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.nickel, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.nickel+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.platinum, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.platinum+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.tin, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.tin+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.silver, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.silver+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.lead, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.lead+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.copper, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.copper+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.zinc, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.zinc+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.brass, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.brass+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.sterling_silver, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.sterling_silver+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.rose_gold, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.rose_gold+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.black_bronze, maxlevel=3},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.black_bronze+10, maxlevel=2},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bismuth_bronze, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.bismuth_bronze+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.bronze, maxlevel=2},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.bronze+10, maxlevel=1},},
{choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=USES_LIST.black_steel, maxlevel=3},
fleshy={times={[2]=1.10, [3]=0.60}, uses=USES_LIST.black_steel+10, maxlevel=2},},
}
SWORD_GROUPCAPS={
--[[{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.70}, uses=40, maxlevel=0},},]]
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.bismuth, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.bismuth, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.pig_iron, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.pig_iron, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.wrought_iron, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.wrought_iron, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=3},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.steel, maxlevel=2},
choppy={times={[3]=0.70}, uses=USES_LIST.steel, maxlevel=1},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.gold, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.gold, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.nickel, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.nickel, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.platinum, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.platinum, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.tin, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.tin, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.silver, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.silver, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.lead, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.lead, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.copper, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.copper, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.zinc, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.zinc, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.brass, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.brass, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.sterling_silver, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.sterling_silver, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.rose_gold, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.rose_gold, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=3},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.black_bronze, maxlevel=2},
choppy={times={[3]=0.70}, uses=USES_LIST.black_bronze, maxlevel=1},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.bismuth_bronze, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.bismuth_bronze, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.bronze, maxlevel=1},
choppy={times={[3]=0.70}, uses=USES_LIST.bronze, maxlevel=0},},
{fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=3},
snappy={times={[2]=0.70, [3]=0.30}, uses=USES_LIST.black_steel, maxlevel=2},
choppy={times={[3]=0.70}, uses=USES_LIST.black_steel, maxlevel=1},},
}

View File

@ -0,0 +1,588 @@
--replacements = {{"metals:"..METALS_LIST[i].."_unshaped", "metals:ceramic_mold"}}
SPEAR_DAMAGE=10
SPEAR_GRAVITY=9
SPEAR_VELOCITY=19
METALS_LIST={
'bismuth',
'pig_iron',
'wrought_iron',
'steel',
'gold',
'nickel',
'platinum',
'tin',
'silver',
'lead',
'copper',
'zinc',
'brass',
'sterling_silver',
'rose_gold',
'black_bronze',
'bismuth_bronze',
'bronze',
'black_steel',
}
DESC_LIST={
'Bismuth',
'Pig iron',
'Wrought iron',
'Steel',
'Gold',
'Nickel',
'Platinum',
'Tin',
'Silver',
'Lead',
'Copper',
'Zinc',
'Brass',
'Sterling silver',
'Rose gold',
'Black bronze',
'Bismuth bronze',
'Bronze',
'Black steel',
}
DESC_SMALL_LIST={
'bismuth',
'pig iron',
'wrought iron',
'steel',
'gold',
'nickel',
'platinum',
'tin',
'silver',
'lead',
'copper',
'zinc',
'brass',
'sterling silver',
'rose gold',
'black bronze',
'bismuth bronze',
'bronze',
'black steel',
}
dofile(minetest.get_modpath("metals").."/groupcaps.lua")
for i=1, #METALS_LIST do
--
-- Craftitems
--
minetest.register_craftitem("metals:"..METALS_LIST[i].."_unshaped", {
description = "Unshaped "..DESC_SMALL_LIST[i],
inventory_image = "metals_"..METALS_LIST[i].."_unshaped.png",
})
minetest.register_craftitem("metals:"..METALS_LIST[i].."_ingot", {
description = DESC_LIST[i].." ingot",
inventory_image = "metals_"..METALS_LIST[i].."_ingot.png",
})
minetest.register_craftitem("metals:tool_pick_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." pickaxe head",
inventory_image = "metals_tool_pick_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_axe_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." axe head",
inventory_image = "metals_tool_axe_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_shovel_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." shovel head",
inventory_image = "metals_tool_shovel_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_sword_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." sword head",
inventory_image = "metals_tool_sword_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_hammer_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." hammer head",
inventory_image = "metals_tool_hammer_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_spear_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." spear head",
inventory_image = "metals_tool_spear_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:tool_chisel_"..METALS_LIST[i].."_head", {
description =DESC_LIST[i].." chisel head",
inventory_image = "metals_tool_chisel_"..METALS_LIST[i].."_head.png",
})
minetest.register_craftitem("metals:ceramic_mold_"..METALS_LIST[i], {
description = "Ceramic mold with "..DESC_SMALL_LIST[i],
inventory_image = "metals_ceramic_mold.png^metals_"..METALS_LIST[i].."_ingot.png",
})
minetest.register_craftitem("metals:tool_spear_"..METALS_LIST[i], {
description = DESC_LIST[i].." spear",
inventory_image = "metals_tool_spear_"..METALS_LIST[i]..".png",
on_use = function (item, player, pointed_thing)
local playerpos=player:getpos()
local obj=minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "metals:spear_entity")
local dir=player:get_look_dir()
obj:setvelocity({x=dir.x*SPEAR_VELOCITY, y=dir.y*SPEAR_VELOCITY, z=dir.z*SPEAR_VELOCITY})
obj:setacceleration({x=dir.x*-3, y=-SPEAR_GRAVITY, z=dir.z*-3})
return ""
end,
stack_max = 1,
})
minetest.register_craftitem("metals:tool_chisel_"..METALS_LIST[i], {
description = DESC_LIST[i].." chisel",
inventory_image = "metals_tool_chisel_"..METALS_LIST[i]..".png",
on_use = function (item, player, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
if minetest.env:get_node(pointed_thing.under).name == "default:stone" then
minetest.env:add_node(pointed_thing.under, {name="realistic_add_blocks:stone_flat"})
end
if minetest.env:get_node(pointed_thing.under).name == "default:desert_stone" then
minetest.env:add_node(pointed_thing.under, {name="realistic_add_blocks:desert_stone_flat"})
end
end,
stack_max = 1,
})
--
-- Nodes
--
minetest.register_node("metals:"..METALS_LIST[i].."_block", {
description = "Block of "..DESC_SMALL_LIST[i],
tiles = {"metals_"..METALS_LIST[i].."_block.png"},
is_ground_content = true,
groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2},
sounds = default.node_sound_stone_defaults(),
})
--
-- Tools
--
minetest.register_tool("metals:tool_pick_"..METALS_LIST[i], {
description = DESC_LIST[i].." pickaxe",
inventory_image = "metals_tool_pick_"..METALS_LIST[i]..".png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
cracky=PICKS_CRACKY_LIST[i],
}
},
})
minetest.register_tool("metals:tool_shovel_"..METALS_LIST[i], {
description = DESC_LIST[i].." shovel",
inventory_image = "metals_tool_shovel_"..METALS_LIST[i]..".png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
crumbly=SHOVELS_CRUMBLY_LIST[i],
}
},
})
minetest.register_tool("metals:tool_axe_"..METALS_LIST[i], {
description = DESC_LIST[i].." axe",
inventory_image = "metals_tool_axe_"..METALS_LIST[i]..".png",
tool_capabilities = {
max_drop_level=1,
groupcaps=AXE_GROUPCAPS[i],
},
})
minetest.register_tool("metals:tool_sword_"..METALS_LIST[i], {
description = DESC_LIST[i].." sword",
inventory_image = "metals_tool_sword_"..METALS_LIST[i]..".png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps=SWORD_GROUPCAPS[i],
}
})
minetest.register_tool("metals:tool_hammer_"..METALS_LIST[i], {
description = DESC_LIST[i].." hammer",
inventory_image = "metals_tool_hammer_"..METALS_LIST[i]..".png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
cracky=PICKS_CRACKY_LIST[i],
}
},
})
--
-- Crafts
--
minetest.register_craft({
output = "metals:"..METALS_LIST[i].."_block",
recipe = {
{"metals:"..METALS_LIST[i].."_ingot", "metals:"..METALS_LIST[i].."_ingot"},
{"metals:"..METALS_LIST[i].."_ingot", "metals:"..METALS_LIST[i].."_ingot"},
}
})
minetest.register_craft({
output = "metals:"..METALS_LIST[i].."_ingot 4",
recipe = {
{"metals:"..METALS_LIST[i].."_block"},
}
})
minetest.register_craft({
output = "metals:ceramic_mold_"..METALS_LIST[i],
recipe = {
{"metals:"..METALS_LIST[i].."_ingot"},
{"metals:ceramic_mold"},
}
})
minetest.register_craft({
output = "metals:"..METALS_LIST[i].."_ingot",
recipe = {
{"metals:"..METALS_LIST[i].."_unshaped"},
},
})
minetest.register_craft({
output = 'bucket:bucket_empty',
recipe = {
{"metals:"..METALS_LIST[i].."_ingot", '', "metals:"..METALS_LIST[i].."_ingot"},
{'', "metals:"..METALS_LIST[i].."_ingot", ''},
}
})
minetest.register_craft({
output = "metals:tool_pick_"..METALS_LIST[i],
recipe = {
{"metals:tool_pick_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_axe_"..METALS_LIST[i],
recipe = {
{"metals:tool_axe_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_shovel_"..METALS_LIST[i],
recipe = {
{"metals:tool_shovel_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_sword_"..METALS_LIST[i],
recipe = {
{"metals:tool_sword_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_hammer_"..METALS_LIST[i],
recipe = {
{"metals:tool_hammer_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_spear_"..METALS_LIST[i],
recipe = {
{"metals:tool_spear_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
minetest.register_craft({
output = "metals:tool_chisel_"..METALS_LIST[i],
recipe = {
{"metals:tool_chisel_"..METALS_LIST[i].."_head"},
{'default:stick'},
}
})
--
-- Coocking
--
minetest.register_craft({
type = "cooking",
output = "metals:"..METALS_LIST[i].."_unshaped",
recipe = "metals:ceramic_mold_"..METALS_LIST[i],
})
end
--
-- Smelting
--
minetest.register_craftitem("metals:clay_mold", {
description = "Clay mold",
inventory_image = "metals_clay_mold.png",
})
minetest.register_craftitem("metals:ceramic_mold", {
description = "Ceramic mold",
inventory_image = "metals_ceramic_mold.png",
})
minetest.register_craft({
output = "metals:clay_mold 5",
recipe = {
{"default:clay_lump", "", "default:clay_lump"},
{"default:clay_lump", "default:clay_lump", "default:clay_lump"},
}
})
minetest.register_craft({
type = "cooking",
output = "metals:ceramic_mold",
recipe = "metals:clay_mold",
})
MINERALS_LIST={
'magnetite',
'hematite',
'limonite',
'bismuthinite',
'cassiterite',
'galena',
'malachite',
'native_copper',
'native_gold',
'native_platinum',
'native_silver',
'sphalerite',
'tetrahedrite',
'garnierite',
}
MINERALS_DESC_LIST={
'magnetite',
'hematite',
'limonite',
'bismuthinite',
'cassiterite',
'galena',
'malachite',
'native copper',
'native gold',
'native platinum',
'native silver',
'sphalerite',
'tetrahedrite',
'garnierite',
}
MINERALS_METALS_LIST={
'pig_iron',
'pig_iron',
'pig_iron',
'bismuth',
'tin',
'lead',
'copper',
'copper',
'gold',
'platinum',
'silver',
'zinc',
'copper',
'nickel',
}
for i=1, #MINERALS_LIST do
minetest.register_craftitem("metals:ceramic_mold_"..MINERALS_LIST[i], {
description = "Ceramic mold with "..MINERALS_DESC_LIST[i],
inventory_image = "metals_ceramic_mold_"..MINERALS_LIST[i]..".png",
})
minetest.register_craft({
output = "metals:ceramic_mold_"..MINERALS_LIST[i],
recipe = {
{"minerals:"..MINERALS_LIST[i]},
{"metals:ceramic_mold"},
}
})
minetest.register_craft({
type = "cooking",
output = "metals:"..MINERALS_METALS_LIST[i].."_unshaped",
recipe = "metals:ceramic_mold_"..MINERALS_LIST[i],
})
end
--
-- Recipes
--
minetest.register_craftitem("metals:recipe_pick", {
description = "Pick recipe",
inventory_image = "metals_recipe.png",
})
minetest.register_craftitem("metals:recipe_axe", {
description = "Axe recipe",
inventory_image = "metals_recipe.png",
})
minetest.register_craftitem("metals:recipe_shovel", {
description = "Shovel recipe",
inventory_image = "metals_recipe.png",
})
minetest.register_craftitem("metals:recipe_sword", {
description = "Sword recipe",
inventory_image = "metals_recipe.png",
})
minetest.register_craftitem("metals:recipe_hammer", {
description = "Hammer recipe",
inventory_image = "metals_recipe.png",
})
minetest.register_craftitem("metals:recipe_spear", {
description = "Spear recipe",
inventory_image = "metals_recipe.png",
})
--
-- Alloys
--
minetest.register_craft({
output = "metals:steel_unshaped 4",
recipe = {
{"metals:wrought_iron_unshaped", "metals:wrought_iron_unshaped", "metals:wrought_iron_unshaped"},
{"", "metals:pig_iron_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:brass_unshaped 4",
recipe = {
{"metals:copper_unshaped", "metals:copper_unshaped", "metals:copper_unshaped"},
{"","metals:zinc_unshaped",""},
}
})
minetest.register_craft({
output = "metals:sterling_silver_unshaped 4",
recipe = {
{"metals:silver_unshaped", "metals:silver_unshaped", "metals:silver_unshaped"},
{"", "metals:copper_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:rose_gold_unshaped 4",
recipe = {
{"metals:gold_unshaped", "metals:gold_unshaped", "metals:gold_unshaped"},
{"", "metals:brass_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:black_bronze_unshaped 4",
recipe = {
{"metals:copper_unshaped", "metals:copper_unshaped"},
{"metals:gold_unshaped", ""},
{"metals:silver_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:bismuth_bronze_unshaped 4",
recipe = {
{"metals:copper_unshaped", "metals:copper_unshaped"},
{"metals:bismuth_unshaped", ""},
{"metals:tin_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:bronze_unshaped 4",
recipe = {
{"metals:copper_unshaped", "metals:copper_unshaped", "metals:copper_unshaped"},
{"", "metals:tin_unshaped", ""},
}
})
minetest.register_craft({
output = "metals:black_steel_unshaped 4",
recipe = {
{"metals:steel_unshaped", "metals:steel_unshaped"},
{"metals:nickel_unshaped", ""},
{"metals:black_bronze_unshaped", ""},
}
})
--
-- Other
--
minetest.register_craftitem(":default:steel_ingot", {
description = "Double wrought ingot",
inventory_image = "metals_wrought_iron_ingot.png",
})
--
-- Entitis
SPEAR_ENTITY={
physical = false,
timer=0,
textures = {"spear_back.png"},
lastpos={},
collisionbox = {0,0,0,0,0,0},
}
SPEAR_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.env:get_node(pos)
if self.timer>0.2 then
local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()-SPEAR_DAMAGE)
if obj:get_entity_name() ~= "metals:spear_entity" then
if obj:get_hp()<=0 then
obj:remove()
end
self.object:remove()
end
end
end
if self.lastpos.x~=nil then
if node.name ~= "air" then
minetest.env:add_item(self.lastpos, 'metals:tool_spear_bismuth')
self.object:remove()
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
end
minetest.register_entity("metals:spear_entity", SPEAR_ENTITY)

View File

@ -0,0 +1,3 @@
[Dolphin]
PreviewsShown=true
Timestamp=2012,7,30,16,22,5

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Some files were not shown because too many files have changed in this diff Show More