Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Size: Difference between revisions

From Teriock
Content deleted Content added
// via Wikitext Extension for VSCode
 
// via Wikitext Extension for VSCode
Line 12: Line 12:
local size = tonumber(args.size) or 1
local size = tonumber(args.size) or 1
local str = tonumber(args.str) or 0
local str = tonumber(args.str) or 0
local mult = tonumber(args.mult) or 1
if size < 5 then
if size < 5 then
local carryingCapacity = tostring((60 + (20 * str))) .. ' lb.'
local carryingCapacity = tostring(mult * (60 + (20 * str))) .. ' lb.'
else
else
local carryingCapacity = tostring((60 + (20 * (str + (size - 5)))) ^ 2) .. ' lb.'
local carryingCapacity = tostring((mult * (60 + (20 * (str + (size - 5))))) ^ 2) .. ' lb.'
end
end
return carryingCapacity
return carryingCapacity

Revision as of 00:07, 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((3 + size)^3) .. ' 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