nodecore-cd2025/mods/nc_api/util_toolcaps.lua
Aaron Suen fcb8463953 Stone-tipped tools.
- Add a bit of stone to the tip of a wooden tool to harden it.
- Stone tools wear back down to their wooden originals.
- Stone tools dig faster, but wear quickly, so you need to pay
  attention to wear levels and carry spare stone tips.

Also:
- Nerfed mining speeds again, but made higher-tier tools much
  faster relative to lower.
- Nerfed tool durability as well.

Also:
- Standardized item ejection logic.
2019-01-25 09:26:15 -05:00

34 lines
711 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local math, nodecore, pairs
= math, nodecore, pairs
local math_pow
= math.pow
-- LUALOCALS > ---------------------------------------------------------
local basetimes = {
cracky = 3,
thumpy = 2,
choppy = 0.7,
crumbly = 0.5,
snappy = 0.4,
}
function nodecore.toolcaps(opts)
if opts.uses == nil then opts.uses = 1 end
local gcaps = {}
for gn, bt in pairs(basetimes) do
local lv = opts[gn]
if lv then
local times = {}
for n = 1, lv do
times[n] = math_pow(0.5, lv - n) * bt
end
gcaps[gn] = {
times = times,
uses = 5 * math_pow(3, lv) * opts.uses
}
end
end
return { groupcaps = gcaps }
end