FANDOM


-- <nowiki>
 
local p = {}
 
local lut = {
	["strength"] = "[[File:Icon legends strength.svg|x16px|link=Strength (Legends)]] [[Strength (Legends)|Strength]] ",
	["str"] = "[[File:Icon legends strength.svg|x16px|link=Strength (Legends)]] [[Strength (Legends)|Strength]] ",
	["intelligence"] = "[[File:Icon legends intelligence.svg|x16px|link=Intelligence (Legends)]] [[Intelligence (Legends)|Intelligence]] ",
	["int"] = "[[File:Icon legends intelligence.svg|x16px|link=Intelligence (Legends)]] [[Intelligence (Legends)|Intelligence]] ",
	["willpower"] = "[[File:Icon legends willpower.svg|x16px|link=Willpower (Legends)]] [[Willpower (Legends)|Willpower]] ",
	["wil"] = "[[File:Icon legends willpower.svg|x16px|link=Willpower (Legends)]] [[Willpower (Legends)|Willpower]] ",
	["agility"] = "[[File:Icon legends agility.svg|x16px|link=Agility (Legends)]] [[Agility (Legends)|Agility]] ",
	["agi"] = "[[File:Icon legends agility.svg|x16px|link=Agility (Legends)]] [[Agility (Legends)|Agility]] ",
	["endurance"] = "[[File:Icon legends endurance.svg|x16px|link=Endurance (Legends)]] [[Endurance (Legends)|Endurance]] ",
	["end"] = "[[File:Icon legends endurance.svg|x16px|link=Endurance (Legends)]] [[Endurance (Legends)|Endurance]] ",
	["neutral"] = "[[File:Icon legends neutral.png|x16px|link=:Category:Legends: Neutral]] [[:Category:Legends: Neutral|Neutral]] ",
	["neu"] = "[[File:Icon legends neutral.png|x16px|link=:Category:Legends: Neutral]] [[:Category:Legends: Neutral|Neutral]] ",
}
 
function p.attributes(frame)
	local result = ''
	for attr in mw.text.gsplit(string.lower(frame.args[1]), ',') do
		if lut[attr] then -- skip invalid values
			result = result .. lut[attr]
		end
	end
	return string.sub(result, 1, -2) -- remove last whitespace
end
 
return p
 
--</nowiki>