Module:SSBC-Calc: Difference between revisions

From Mizuumi Wiki
Jump to navigation Jump to search
(Created page with "local p = {} -- Calculate weights function p.weight(frame) local value = frame.args[0] local text = "" if value < 0.20 then text = "Balloonweight" elseif value >= 0.2...")
 
No edit summary
Line 3: Line 3:
-- Calculate weights
-- Calculate weights
function p.weight(frame)
function p.weight(frame)
local value = frame.args[0]
local value = frame.args[1]
local text = ""
local text = ""
Line 26: Line 26:


function p.gravity(frame)
function p.gravity(frame)
local value = frame.args[0]
local value = frame.args[1]
local text = ""
local text = ""
Line 49: Line 49:


function p.maxJumps(frame)
function p.maxJumps(frame)
local value = frame.args[0]
local value = frame.args[1]
local text = ""
local text = ""

Revision as of 17:16, 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 = 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 = 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 = 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