Module:ModuleGenerator

From The First Descendant Wiki
Revision as of 07:27, 6 June 2024 by Communos (talk | contribs)

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

local p = {}

function p.socketFileName(socket)
	local sockets = {
		almandine = "",
		cerulean = "",
		malachite = "",
		rutile = "",
		xantic = "",
	}
	if contains(sockets, socket) == true then
		return sockets[socket]
	end
	return "filler" --add unknown file?
end

function p.rarityColor(rarity)
	local rarities = {
		standard = "#319dff",
		rare = "#955bff",
		ultimate = "#ffbb4d",
		transcendent = "#ff7c70",
	}
	if contains(rarities, rarity) == true then
		return rarities[rarity]
	end
	return "fff" --add unknown file?
end

function p.weaponClassFileName(weaponClass)
	local weaponClasses = {
		general = "",
		impact = "",
		highpower = "",
	}
	if contains(weaponClasses, weaponClass) == true then
		return weaponClasses[weaponClass]
	end
	return weaponClasses[general] --add unknown file?
end
function contains(table, key)
	for _, value in pairs(table) do
		if value == key then
			return true
		end
	end
	return false
end

return p