Module:SSBC-Calc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
text = "Super Heavyweight" | text = "Super Heavyweight" | ||
else | else | ||
text = "Invalid | text = "Invalid Value" | ||
end | end | ||
Line 42: | Line 42: | ||
text = "Super High" | text = "Super High" | ||
else | else | ||
text = "Invalid | text = "Invalid Value" | ||
end | end | ||
Line 58: | Line 58: | ||
text = "Average" | text = "Average" | ||
else | else | ||
text = "Invalid | text = "Invalid Value" | ||
end | end | ||
Line 64: | Line 64: | ||
end | end | ||
function p.walkSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
if value < 1.70 then | |||
text = "Very Slow" | |||
elseif value >= 1.70 and value < 1.95 then | |||
text = "Slow" | |||
elseif value >= 1.95 and value < 2.20 then | |||
text = "Average" | |||
elseif value >= 2.20 and value < 2.40 then | |||
text = "Fast" | |||
elseif value >= 2.40 and value < 2.70 then | |||
text = "Very Fast" | |||
elseif value > 2.70 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end | |||
return text | |||
end | |||
function p.runStart(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
if value < 2.10 then | |||
text = "Very Slow" | |||
elseif value >= 2.10 and value < 2.90 then | |||
text = "Slow" | |||
elseif value >= 2.90 and value < 3.40 then | |||
text = "Average" | |||
elseif value >= 3.40 and value < 4.00 then | |||
text = "Fast" | |||
elseif value >= 4.00 and value < 5.00 then | |||
text = "Very Fast" | |||
elseif value > 5.00 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end | |||
return text | |||
end | |||
function p.runAccel(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- I don't know the relationship between acceleration and speed here to make a determination on this | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.runSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.friction(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.jumpMomentum(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.jumpSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.midJumpSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.shortHopSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.airSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.fallSpeed(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.fastFall(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.airAccel(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.airFriction(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
-- Set values here | |||
--[[if value < 0.20 then | |||
text = "Very Slow" | |||
elseif value >= 0.20 and value < 0.24 then | |||
text = "Slow" | |||
elseif value >= 0.24 and value < 0.25 then | |||
text = "Average" | |||
elseif value >= 0.25 and value < 0.30 then | |||
text = "Fast" | |||
elseif value >= 0.30 and value < 0.50 then | |||
text = "Very Fast" | |||
elseif value > 0.50 then | |||
text = "Super Fast" | |||
else | |||
text = "Invalid Value" | |||
end]]-- | |||
return text | |||
end | |||
function p.airDash(frame) | |||
local value = tonumber(frame.args[1]) | |||
local text = "" | |||
if value <= 0.00 then | |||
text = "No Airdash" | |||
elseif value > 0 and value <= 5 then | |||
text = "Very Slow" | |||
elseif value >= 5 and value < 8 then | |||
text = "Slow" | |||
elseif value >= 8 and value < 9 then | |||
text = "Average" | |||
elseif value <= 9 then | |||
text = "Fast" | |||
else | |||
text = "Invalid Value" | |||
end | |||
return text | |||
end | |||
function p.specialActions(frame) | |||
local crawl = frame.args[1] | |||
local wallJump = frame.args[2] | |||
local wallCling = frame.args[3] | |||
local wallClimb = frame.args[4] | |||
local float = frame.args[5] | |||
local floatInfo = frame.args[6] | |||
local glide = frame.args[7] | |||
local djc = frame.args[8] | |||
local zAir = frame.args[9] | |||
local zAirInfo = frame.args[10] | |||
local text = "" | |||
if crawl then text = "Crawl" end | |||
if wallJump then text = addComma(text) .. "Wall Jump" end | |||
if wallCling then text = addComma(text) .. "Wall Cling" end | |||
if wallClimb then text = addComma(text) .. "Wall Climb" end | |||
if float then | |||
text = addComma(text) .. "Float" | |||
if floatInfo then | |||
text = text .. "(" .. floatInfo .. ")" | |||
end | |||
end | |||
if glide then text = addComma(text) .. "" end | |||
if djc then text = addComma(text) .. "" end | |||
if zAir then | |||
text = addComma(text) .. "ZAir" | |||
if zAirInfo then | |||
text = text .. "(" .. zAirInfo .. ")" | |||
end | |||
end | |||
end | |||
function addComma(text) | |||
if string.len(text) > 0 then | |||
return text .. ", " | |||
else | |||
return text | |||
end | |||
end | |||
return p | return p |
Revision as of 21:49, 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 Value"
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 Value"
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 Value"
end
return text
end
function p.walkSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
if value < 1.70 then
text = "Very Slow"
elseif value >= 1.70 and value < 1.95 then
text = "Slow"
elseif value >= 1.95 and value < 2.20 then
text = "Average"
elseif value >= 2.20 and value < 2.40 then
text = "Fast"
elseif value >= 2.40 and value < 2.70 then
text = "Very Fast"
elseif value > 2.70 then
text = "Super Fast"
else
text = "Invalid Value"
end
return text
end
function p.runStart(frame)
local value = tonumber(frame.args[1])
local text = ""
if value < 2.10 then
text = "Very Slow"
elseif value >= 2.10 and value < 2.90 then
text = "Slow"
elseif value >= 2.90 and value < 3.40 then
text = "Average"
elseif value >= 3.40 and value < 4.00 then
text = "Fast"
elseif value >= 4.00 and value < 5.00 then
text = "Very Fast"
elseif value > 5.00 then
text = "Super Fast"
else
text = "Invalid Value"
end
return text
end
function p.runAccel(frame)
local value = tonumber(frame.args[1])
local text = ""
-- I don't know the relationship between acceleration and speed here to make a determination on this
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.runSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.friction(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.jumpMomentum(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.jumpSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.midJumpSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.shortHopSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.airSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.fallSpeed(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.fastFall(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.airAccel(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.airFriction(frame)
local value = tonumber(frame.args[1])
local text = ""
-- Set values here
--[[if value < 0.20 then
text = "Very Slow"
elseif value >= 0.20 and value < 0.24 then
text = "Slow"
elseif value >= 0.24 and value < 0.25 then
text = "Average"
elseif value >= 0.25 and value < 0.30 then
text = "Fast"
elseif value >= 0.30 and value < 0.50 then
text = "Very Fast"
elseif value > 0.50 then
text = "Super Fast"
else
text = "Invalid Value"
end]]--
return text
end
function p.airDash(frame)
local value = tonumber(frame.args[1])
local text = ""
if value <= 0.00 then
text = "No Airdash"
elseif value > 0 and value <= 5 then
text = "Very Slow"
elseif value >= 5 and value < 8 then
text = "Slow"
elseif value >= 8 and value < 9 then
text = "Average"
elseif value <= 9 then
text = "Fast"
else
text = "Invalid Value"
end
return text
end
function p.specialActions(frame)
local crawl = frame.args[1]
local wallJump = frame.args[2]
local wallCling = frame.args[3]
local wallClimb = frame.args[4]
local float = frame.args[5]
local floatInfo = frame.args[6]
local glide = frame.args[7]
local djc = frame.args[8]
local zAir = frame.args[9]
local zAirInfo = frame.args[10]
local text = ""
if crawl then text = "Crawl" end
if wallJump then text = addComma(text) .. "Wall Jump" end
if wallCling then text = addComma(text) .. "Wall Cling" end
if wallClimb then text = addComma(text) .. "Wall Climb" end
if float then
text = addComma(text) .. "Float"
if floatInfo then
text = text .. "(" .. floatInfo .. ")"
end
end
if glide then text = addComma(text) .. "" end
if djc then text = addComma(text) .. "" end
if zAir then
text = addComma(text) .. "ZAir"
if zAirInfo then
text = text .. "(" .. zAirInfo .. ")"
end
end
end
function addComma(text)
if string.len(text) > 0 then
return text .. ", "
else
return text
end
end
return p