2017-02-12 00:02:53 -05:00
|
|
|
-- START OF FUNCTIONS
|
|
|
|
-- (START OF INIT IS FURTHER DOWN)
|
|
|
|
|
2017-02-12 01:12:10 -05:00
|
|
|
local function create_tools_for_material(name, display_name, uses_vs_env, time1, time2, time3, maxlev)
|
2017-02-12 00:31:37 -05:00
|
|
|
minetest.register_tool("birthstones:pick_" .. string.lower(name), {
|
2017-02-12 01:12:10 -05:00
|
|
|
description = display_name .. " Pickaxe",
|
2017-02-12 00:31:37 -05:00
|
|
|
inventory_image = "birthstones_tool_" .. string.lower(name) .. "pick.png",
|
2017-02-12 00:02:53 -05:00
|
|
|
tool_capabilities = {
|
|
|
|
max_drop_level=0,
|
|
|
|
groupcaps={
|
2017-02-12 01:12:10 -05:00
|
|
|
cracky={times={[1]=time1, [2]=time2, [3]=time3}, uses=uses_vs_env, maxlevel=maxlev}
|
2017-02-12 00:02:53 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-02-12 00:31:37 -05:00
|
|
|
output = "birthstones:pick_" .. string.lower(name),
|
2017-02-12 00:02:53 -05:00
|
|
|
recipe = {
|
2017-02-12 00:31:37 -05:00
|
|
|
{'birthstones:' .. string.lower(name), 'birthstones:' .. string.lower(name), 'birthstones:' .. string.lower(name)},
|
2017-02-12 00:02:53 -05:00
|
|
|
{'', 'default:stick', ''},
|
|
|
|
{'', 'default:stick', ''}
|
|
|
|
}
|
|
|
|
})
|
2017-02-12 00:31:37 -05:00
|
|
|
minetest.register_tool("birthstones:axe_" .. string.lower(name), {
|
2017-02-12 01:12:10 -05:00
|
|
|
description = display_name .. " Axe",
|
2017-02-12 00:31:37 -05:00
|
|
|
inventory_image = "birthstones_tool_" .. string.lower(name) .. "axe.png",
|
2017-02-12 00:02:53 -05:00
|
|
|
tool_capabilities = {
|
|
|
|
max_drop_level=1,
|
|
|
|
groupcaps={
|
2017-02-12 01:12:10 -05:00
|
|
|
choppy={times={[1]=time1/2.0, [2]=time2/2.0, [3]=time3/2.0}, uses=uses_vs_env, maxlevel=maxlev},
|
|
|
|
fleshy={times={[2]=time2, [3]=time3}, uses=uses_vs_env/3*4, maxlevel=maxlev}
|
2017-02-12 00:02:53 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-02-12 00:31:37 -05:00
|
|
|
output = "birthstones:axe_" .. string.lower(name),
|
2017-02-12 00:02:53 -05:00
|
|
|
recipe = {
|
2017-02-12 00:31:37 -05:00
|
|
|
{'birthstones:' .. string.lower(name), 'birthstones:' .. string.lower(name)},
|
|
|
|
{'birthstones:' .. string.lower(name), 'default:stick'},
|
2017-02-12 00:02:53 -05:00
|
|
|
{'', 'default:stick'}
|
|
|
|
}
|
|
|
|
})
|
2017-02-12 00:31:37 -05:00
|
|
|
minetest.register_tool("birthstones:shovel_" .. string.lower(name), {
|
2017-02-12 01:12:10 -05:00
|
|
|
description = display_name .. " Shovel",
|
2017-02-12 00:31:37 -05:00
|
|
|
inventory_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png",
|
|
|
|
wield_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png^[transformR90",
|
2017-02-12 00:02:53 -05:00
|
|
|
tool_capabilities = {
|
|
|
|
full_punch_interval = 1.0,
|
|
|
|
max_drop_level=1,
|
|
|
|
groupcaps={
|
2017-02-12 01:12:10 -05:00
|
|
|
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=uses_vs_env, maxlevel=3},
|
2017-02-12 00:02:53 -05:00
|
|
|
},
|
|
|
|
damage_groups = {fleshy=4},
|
|
|
|
},
|
|
|
|
sound = {breaks = "default_tool_breaks"},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-02-12 00:31:37 -05:00
|
|
|
output = "birthstones:shovel_" .. string.lower(name),
|
2017-02-12 00:02:53 -05:00
|
|
|
recipe = {
|
2017-02-12 00:31:37 -05:00
|
|
|
{'', 'birthstones:' .. string.lower(name)},
|
2017-02-12 00:02:53 -05:00
|
|
|
{'', 'default:stick'},
|
|
|
|
{'', 'default:stick'}
|
|
|
|
}
|
|
|
|
})
|
2017-02-12 00:31:37 -05:00
|
|
|
minetest.register_tool("birthstones:sword_" .. string.lower(name), {
|
2017-02-12 01:12:10 -05:00
|
|
|
description = display_name .. " Sword",
|
2017-02-12 01:17:47 -05:00
|
|
|
inventory_image = "birthstones_tool_" .. string.lower(name) .. "sword.png",
|
2017-02-12 00:02:53 -05:00
|
|
|
tool_capabilities = {
|
2017-02-12 01:12:10 -05:00
|
|
|
full_punch_interval = 0.7,
|
|
|
|
max_drop_level=1,
|
2017-02-12 00:02:53 -05:00
|
|
|
groupcaps={
|
2017-02-12 01:12:10 -05:00
|
|
|
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=uses_vs_env/3*4, maxlevel=3},
|
2017-02-12 00:02:53 -05:00
|
|
|
},
|
2017-02-12 01:12:10 -05:00
|
|
|
damage_groups = {fleshy=8},
|
2017-02-12 00:02:53 -05:00
|
|
|
},
|
|
|
|
sound = {breaks = "default_tool_breaks"},
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
2017-02-12 00:31:37 -05:00
|
|
|
output = "birthstones:sword_" .. string.lower(name),
|
2017-02-12 00:02:53 -05:00
|
|
|
recipe = {
|
2017-02-12 00:31:37 -05:00
|
|
|
{'', 'birthstones:' .. string.lower(name)},
|
|
|
|
{'', 'birthstones:' .. string.lower(name)},
|
2017-02-12 00:02:53 -05:00
|
|
|
{'', 'default:stick'}
|
|
|
|
}
|
|
|
|
})
|
2017-02-12 01:12:10 -05:00
|
|
|
|
2017-02-12 00:02:53 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
-- END OF FUNCTIONS
|
|
|
|
|
|
|
|
-- START OF INIT
|
|
|
|
|
2017-02-12 01:12:10 -05:00
|
|
|
-- default:diamond:
|
|
|
|
-- sword uses=40
|
|
|
|
-- pick uses=30
|
|
|
|
-- default:stone:
|
|
|
|
-- sword uses=20
|
|
|
|
-- pick uses=20
|
|
|
|
-- name, display_name, uses_vs_env, time1, time2, time3, maxlev
|
|
|
|
--uses_vs_env: normal use (bonus is added for fleshy target)
|
|
|
|
create_tools_for_material("Alexandrite", "Alexandrite", 17, 3.2, 1.40, 0.90, 1)
|
|
|
|
create_tools_for_material("Amethyst", "Amethyst", 17, 3.2, 1.40, 0.90, 1)
|
|
|
|
create_tools_for_material("Aquamarine", "Aquamarine", 15, 3.2, 1.40, 0.90, 1)
|
|
|
|
create_tools_for_material("Diamond", "White Diamond", 30, 4.5, 1.8, 1.3, 3)
|
|
|
|
create_tools_for_material("Emerald", "Emerald", 27, 4.2, 1.6, 1.2, 2)
|
|
|
|
create_tools_for_material("Garnet", "Garnet", 22, 4.0, 1.5, 1.0, 1)
|
|
|
|
create_tools_for_material("Opal", "Opal", 19, 3.5, 1.6, 1.5, 2)
|
|
|
|
create_tools_for_material("Peridot", "Peridot", 24, 4.0, 1.5, 1.0, 1)
|
|
|
|
create_tools_for_material("Ruby", "Ruby", 27, 4.2, 1.6, 1.2, 2)
|
|
|
|
create_tools_for_material("Sapphire", "Sapphire", 27, 4.2, 1.6, 1.2, 1)
|
|
|
|
create_tools_for_material("Topaz", "Topaz", 25, 4.1, 1.6, 1.05, 1)
|
|
|
|
create_tools_for_material("Zircon", "Zircon", 30, 4.1, 1.6, 1.05, 1)
|