2019-01-24 22:08:05 -05:00
|
|
|
-- 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 = {}
|
2019-01-25 00:17:47 -05:00
|
|
|
for n = 1, lv do
|
|
|
|
times[n] = math_pow(0.75, lv - n) * bt
|
2019-01-24 22:08:05 -05:00
|
|
|
end
|
|
|
|
gcaps[gn] = {
|
|
|
|
times = times,
|
|
|
|
uses = 5 * math_pow(3, lv) * opts.uses,
|
|
|
|
maxlevel = lv
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return { groupcaps = gcaps }
|
|
|
|
end
|