46e60a2348
Get rid of the intuitive leap necessary to climb a tree to make planks. Instead, a wooden adze can be gravel-tipped (adzes are now represented in all tiers) and can chop tree trunks. The graveled adze is as powerful as a wooden hatchet and spade combined, in terms of diggability, but it breaks after a SINGLE use. It doesn't consume the gravel it's made from, but reapplying the tip each use is a lot of extra process.
27 lines
778 B
Lua
27 lines
778 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local ItemStack, nodecore
|
|
= ItemStack, nodecore
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
local function breakfx(who, def)
|
|
if def.sound and def.sound.breaks then
|
|
nodecore.sound_play(def.sound.breaks,
|
|
{object = who, gain = 0.5})
|
|
end
|
|
return nodecore.toolbreakparticles(who, def, 40)
|
|
end
|
|
nodecore.toolbreakeffects = breakfx
|
|
|
|
nodecore.register_on_register_item(function(_, def)
|
|
if def.tool_wears_to or def.type == "tool" then
|
|
def.after_use = def.after_use or function(what, who, _, dp)
|
|
what:add_wear(dp.wear)
|
|
if what:get_count() == 0 then
|
|
breakfx(who, def)
|
|
return ItemStack(def.tool_wears_to or "")
|
|
end
|
|
return what
|
|
end
|
|
end
|
|
end)
|