Module:SSBC-Calc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
-- Calculate weights | -- Calculate weights | ||
function p.weight(frame) | function p.weight(frame) | ||
local value = frame.args[1] | local value = tonumber(frame.args[1]) | ||
local text = "" | local text = "" | ||
Line 26: | Line 26: | ||
function p.gravity(frame) | function p.gravity(frame) | ||
local value = frame.args[1] | local value = tonumber(frame.args[1]) | ||
local text = "" | local text = "" | ||
Line 49: | Line 49: | ||
function p.maxJumps(frame) | function p.maxJumps(frame) | ||
local value = frame.args[1] | local value = tonumber(frame.args[1]) | ||
local text = "" | local text = "" | ||
Revision as of 17:20, 16 August 2021
Documentation for this module may be created at Module:SSBC-Calc/doc
local p = {}
-- Calculate weights
function p.weight(frame)
local value = tonumber(frame.args[1])
local text = ""
if value < 0.20 then
text = "Balloonweight"
elseif value >= 0.20 and value < 0.21 then
text = "Featherweight"
elseif value >= 0.21 and value < 0.24 then
text = "Lightweight"
elseif value >= 0.24 and value < 0.26 then
text = "Middleweight"
elseif value >= 0.26 and value < 0.30 then
text = "Heavyweight"
elseif value > 0.30 then
text = "Super Heavyweight"
else
text = "Invalid Weight"
end
return text
end
function p.gravity(frame)
local value = tonumber(frame.args[1])
local text = ""
if value < 0.20 then
text = "Very Low"
elseif value >= 0.20 and value < 0.24 then
text = "Low"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "High"
elseif value >= 0.30 and value < 0.50 then
text = "Very High"
elseif value > 0.50 then
text = "Super High"
else
text = "Invalid Gravity"
end
return text
end
function p.maxJumps(frame)
local value = tonumber(frame.args[1])
local text = ""
if value < 3 then
local additionalJumps = value - 3
text = additionalJumps .. " Additional Jumps"
elseif value == 3 then
text = "Average"
else
text = "Invalid Max Jumps"
end
return text
end
return p