Module:Size: Difference between revisions
From Teriock
More actions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 4: | Line 4: | ||
local args = frame.args | local args = frame.args | ||
local size = tonumber(args.size) or 1 | local size = tonumber(args.size) or 1 | ||
local weight = tostring((3 + size)^3) .. ' lb.' | local weight = tostring(math.floor((3 + size)^3 + 0.5)) .. ' lb.' | ||
return weight | return weight | ||
end | end | ||
Revision as of 00:20, 11 February 2025
Documentation for this module may be created at Module:Size/doc
local p = {}
function p.weight ( frame )
local args = frame.args
local size = tonumber(args.size) or 1
local weight = tostring(math.floor((3 + size)^3 + 0.5)) .. ' lb.'
return weight
end
function p.carryingCapacity ( frame )
local args = frame.args
local size = tonumber(args.size) or 1
local str = tonumber(args.str) or 0
local mult = tonumber(args.mult) or 1
if size < 5 then
local carryingCapacity = tostring(mult * (60 + (20 * str))) .. ' lb.'
else
local carryingCapacity = tostring((mult * (60 + (20 * (str + (size - 5))))) ^ 2) .. ' lb.'
end
return carryingCapacity
end
return p