Module:CropCalcs: Difference between revisions

From IdleOn MMO Wiki
(Created page with "local crops = {} function crops.growtime(frame) local croptype = frame.args.Type local basechance = { basic = 0, earthy = 1, bulbo = 2, sushi = 3, mushie = 4, glassy = 5} end function crops.evochance(frame) local croptype = frame.args.Type local cropindex = frame.args.CropIndex local basechance = { basic = 0.3, earthy = 0.12, bulbo = 0.04, sushi = 0.01, mushie = 0.003, glassy = 0.0005 } local decay = { basic = 0.75, earthy = 0.63, bulbo = 0.3, sushi = 0.4, mus...")
 
mNo edit summary
Line 12: Line 12:
local basechance = { basic = 0.3, earthy = 0.12, bulbo = 0.04, sushi = 0.01, mushie = 0.003, glassy = 0.0005 }
local basechance = { basic = 0.3, earthy = 0.12, bulbo = 0.04, sushi = 0.01, mushie = 0.003, glassy = 0.0005 }
local decay = { basic = 0.75, earthy = 0.63, bulbo = 0.3, sushi = 0.4, mushie = 0.2, glassy = 0.05 }
local decay = { basic = 0.75, earthy = 0.63, bulbo = 0.3, sushi = 0.4, mushie = 0.2, glassy = 0.05 }
local one = basechance[croptype]
local two = decay[croptype]
local three = cropindex
local four = one * two ^ three
return basechance[croptype] * (decay[croptype] ^ cropindex)
return four
end
end


return crops
return crops

Revision as of 16:20, 26 February 2024

Documentation for this module may be created at Module:CropCalcs/doc

local crops = {}

function crops.growtime(frame)
	local croptype  = frame.args.Type
	local basechance = { basic = 0, earthy = 1, bulbo = 2, sushi = 3, mushie = 4, glassy = 5}

end

function crops.evochance(frame)
	local croptype  = frame.args.Type
	local cropindex = frame.args.CropIndex
	local basechance = { basic = 0.3, earthy = 0.12, bulbo = 0.04, sushi = 0.01, mushie = 0.003, glassy = 0.0005 }
	local decay = { basic = 0.75, earthy = 0.63, bulbo = 0.3, sushi = 0.4, mushie = 0.2, glassy = 0.05 }
	local one = basechance[croptype]
	local two = decay[croptype] 
	local three = cropindex
	local four = one * two ^ three
	
	
	return four
end

return crops