Elder Scrolls
Advertisement
Elder Scrolls

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

-- <nowiki>

local p = {}

-- Gender

local genderParameters = {
	["female"] = "Female [[Category:Game: Females]]",
	["male"] = "Male [[Category:Game: Males]]",
	["unknown"] = "Unknown",
	["missing"] = "MissingGame",
	["?"] = "MissingGame",
}

function p.gender(frame)
	local result = ''
	for gend in mw.text.gsplit(string.lower(frame.args[1]), ',') do
		if genderParameters[gend] then -- skip invalid values
			result = result .. genderParameters[gend] .. '<br />'
			else
			    result = frame.args[1]..'        '
		end
	end
	return result
end

-- Race

local raceParameters = {
	["altmer"] = "[[Altmer (Game)|Altmer]] [[Category:Game: Altmer]]",
	["high elf"] = "[[Altmer (Game)|Altmer]] [[Category:Game: Altmer]]",
	["argonian"] = "[[Argonians (Game)|Argonian]] [[Category:Game: Argonians]]",
	["bosmer"] = "[[Bosmer (Game)|Bosmer]] [[Category:Game: Bosmer]]",
	["wood elf"] = "[[Bosmer (Game)|Bosmer]] [[Category:Game: Bosmer]]",
	["breton"] = "[[Bretons (Game)|Breton]] [[Category:Game: Bretons]]",
	["dunmer"] = "[[Dunmer (Game)|Dunmer]] [[Category:Game: Dunmer]]",
	["dark elf"] = "[[Dunmer (Game)|Dunmer]] [[Category:Game: Dunmer]]",
	["imperial"] = "[[Imperials (Game)|Imperial]] [[Category:Game: Imperials]]",
	["khajiit"] = "[[Khajiit (Game)|Khajiit]] [[Category:Game: Khajiit]]",
	["nord"] = "[[Nords (Game)|Nord]] [[Category:Game: Nords]]",
	["orsimer"] = "[[Orsimer (Game)|Orsimer]] [[Category:Game: Orsimer]]",
	["orc"] = "[[Orsimer (Game)|Orsimer]] [[Category:Game: Orsimer]]",
	["redguard"] = "[[Redguards (Game)|Redguard]] [[Category:Game: Redguards]]",
	["elder"] = "[[Elder]] [[Category:Game: Elders]]",
	["werewolf"] = "[[Werewolves (Game)|Werewolf]] [[Category:Game: Werewolves]]",
	["dremora"] = "[[Dremora (Game)|Dremora]] [[Category:Game: Dremora]]",
	["akaviri"] = "[[Akaviri]] [[Category:Akaviri]]",
	["vampire"] = "[[Vampires (Game)|Vampire]] [[Category:Game: Vampires]]",
	["vampire race"] = "[[Vampires (Game)|Vampire]] [[Category:Game: Vampires]]",
	["vampire lord"] = "[[Vampire Lord]] [[Category:Game: Vampires]]",
	["dark seducer"] = "[[Dark Seducers (Game)|Dark Seducer]] [[Category:Game: Dark Seducers]]",
	["golden saint"] = "[[Golden Saints (Game)|Golden Saint]] [[Category:Game: Golden Saints]]",
	["snow elf"] = "[[Snow Elf]] [[Category:Lore: Snow Elves]]",
	["dwemer"] = "[[Dwemer]] [[Category:Lore: Dwemer]]",
	["hagraven"] = "[[Hagraven (Game)|Hagraven]] [[Category:Game: Hagravens]]",
	["ehlnofey"] = "[[Ehlnofey]] [[Category:Game: Ehlnofey]]",
	["xivkyn"] = "[[Xivkyn]] [[Category:Game: Xivkyn]]",
	["maormer"] = "[[Maormer]] [[Category:Game: Maormer]]",
	["sea elf"] = "[[Maormer]] [[Category:Game: Maormer]]",
	["herne"] = "[[Herne (Game)|Herne]] [[Category:Game: Herne]]",
	["skaafin"] = "[[Skaafin]] [[Category:Game: Skaafin]]",
	["auroran"] = "[[Aurorans]] [[Category:Game: Aurorans]]",
	["spiderkith"] = "[[Spiderkith]] [[Category:Game: Spiderkith]]",
	["chimer"] = "[[Chimer]] [[Category:Game: Chimer]]",
	["ayleid"] = "[[Ayleids]] [[Category:Game: Ayleids]]",
	["atmoran"] = "[[Atmorans]] [[Category:Atmorans]]",
	["daedric prince"] = "[[Daedric Princes]] [[Category:Daedric Princes]]",
	["dragon"] = "[[Dragons (Game)|Dragon]] [[Category:Game: Dragons]]",
	["daedra"] = "[[Daedra]] [[Category:Game: Daedra]]",
	["draugr"] = "[[Draugr (Game)|Draugr]] [[Category:Game: Draugr]]",
	["sload"] = "[[Sload]] [[Category:Sloads]]",
	["god"] = "[[God (Game)|God]] [[Category:Game: Gods]]",
	["ghost"] = "[[Ghost (Game)|Ghost]] [[Category:Game: Ghosts]]",
	["unknown"] = "Unknown [[Category:Characters of Unknown Race]]",
	["?"] = "MissingGame",
}

function p.race(frame)
	local result = ''
	for rac in mw.text.gsplit(string.lower(frame.args[1]), ',') do
		if raceParameters[rac] then -- skip invalid values
			result = result .. raceParameters[rac] .. '<br />'
			else
			    result = frame.args[1]..'        '
		end
	end
	return result
end

return p

--</nowiki>