Module:ModuleGenerator: Difference between revisions

From The First Descendant Wiki
No edit summary
No edit summary
Line 3: Line 3:
function p.socketFileName(socket)
function p.socketFileName(socket)
local sockets = {
local sockets = {
almandine = "",
almandine = "https://tfd.wiki/File:Icon_RunesCapacity_Mini_004.png",
cerulean = "",
cerulean = "",
malachite = "",
malachite = "",
Line 30: Line 30:
function p.weaponClassFileName(weaponClass)
function p.weaponClassFileName(weaponClass)
local weaponClasses = {
local weaponClasses = {
general = "",
general = "https://tfd.wiki/File:Icon_RunesClass_Mini_A_Color.png",
special = "",
special = "https://tfd.wiki/File:Icon_RunesClass_Mini_B_Color.png",
impact = "",
impact = "https://tfd.wiki/File:Icon_RunesClass_Mini_C_Color.png",
highpower = ""
highpower = "https://tfd.wiki/File:Icon_RunesClass_Mini_D_Color.png",
melee = "https://tfd.wiki/File:Icon_RunesClass_Mini_Melee_Color.png"
}
}
if contains(weaponClasses, weaponClass) == true then
if contains(weaponClasses, weaponClass) == true then

Revision as of 09:31, 6 June 2024

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

local p = {}

function p.socketFileName(socket)
	local sockets = {
		almandine = "https://tfd.wiki/File:Icon_RunesCapacity_Mini_004.png",
		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 = "https://tfd.wiki/File:Icon_RunesClass_Mini_A_Color.png",
		special = "https://tfd.wiki/File:Icon_RunesClass_Mini_B_Color.png",
		impact = "https://tfd.wiki/File:Icon_RunesClass_Mini_C_Color.png",
		highpower = "https://tfd.wiki/File:Icon_RunesClass_Mini_D_Color.png",
		melee = "https://tfd.wiki/File:Icon_RunesClass_Mini_Melee_Color.png"
	}
	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