Merge aad3339706
into 73e99e7d66
This commit is contained in:
commit
abd6c79de9
|
@ -0,0 +1,41 @@
|
|||
-- Tin ore is very common and has very little use. Here's a tin dagger.
|
||||
-- Useful in that it's efficient
|
||||
-- Pathetic in that it breaks fairly quickly
|
||||
|
||||
local maxuses = 20
|
||||
|
||||
local tindaggercaps = {
|
||||
full_punch_interval = 2.0,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
snappy = {times = {[2] = 1.2, [3] = 0.3}, uses = 2, maxlevel = 1},
|
||||
},
|
||||
damage_groups = {fleshy = 4},
|
||||
}
|
||||
|
||||
minetest.register_tool("moreores:tin_dagger", {
|
||||
description = "Tin Dagger",
|
||||
inventory_image = "moreores_tin_dagger.png",
|
||||
tool_capabilities = tindaggercaps, -- overridden by use of on_use ....
|
||||
on_use = function(itemstack,user,pointedthing)
|
||||
if pointedthing.type == "object" then
|
||||
pointedthing.ref:punch(user,1,tindaggercaps)
|
||||
|
||||
-- explicitly non-physical entities should not incur wear, cater for nil
|
||||
if pointedthing.ref:get_luaentity().physical_state ~= false then
|
||||
itemstack:add_wear(math.ceil(65536/maxuses))
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
output = "moreores:tin_dagger",
|
||||
recipe = {
|
||||
{"moreores:tin_ingot"},
|
||||
{"moreores:tin_ingot"},
|
||||
{"default:stick"}
|
||||
}
|
||||
})
|
||||
|
3
init.lua
3
init.lua
|
@ -380,6 +380,9 @@ minetest.register_node("moreores:copper_rail", {
|
|||
},
|
||||
})
|
||||
|
||||
-- something usefule with tin
|
||||
dofile(minetest.get_modpath("moreores").."/dagger.lua" )
|
||||
|
||||
|
||||
if minetest.setting_getbool("log_mods") then
|
||||
minetest.log("action", S("[moreores] loaded."))
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 954 B |
Loading…
Reference in New Issue