WARFRAME Wiki

Read about the future of the Fandom platform and the WARFRAME wiki! Any feedback would be appreciated! User blog:Cephalon Scientia/2022 Fandom Community Connect. - 06:11, 6 June 2022 (UTC)

READ MORE

WARFRAME Wiki
Advertisement
WARFRAME Wiki

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

--	<nowiki>
local WarframeData = mw.loadData([[Module:Warframes/data]])
local ConclaveData = mw.loadData([[Module:Warframes/Conclave/data]])

local Math = require([[Module:Math]])
local Polarity = require([[Module:Polarity]])
local Tooltip = require([[Module:Tooltips]])
local InfoboxBuilder = require([[Module:InfoboxBuilder]])

local function override(arg)
	return arg and arg..'[[Category:InfoboxOverride]]'
end

return {
buildInfobox = function(frame)
	local args = frame.args
	local name = args['Name']
	local warframe = {}

	if args['Conclave'] == 'false' then
		warframe = WarframeData.Warframes[name]
	else
		warframe = ConclaveData.Warframes[name]
	end
	
	local Infobox = InfoboxBuilder('MediaWiki:Custom-General/i18n.json', 'MediaWiki:Custom-Warframes/i18n.json')
		:tag('title')
			:tag('default')
				:tag('b'):wikitext(name..'[[Category:'..name..']][[Category:Warframes]]'):done()
			:done()
		:done()
		:tag('image'):attr('source', 'Image')
			:tag('default'):wikitext(warframe.Image or 'Panel.png'):done()
		:done()
		:group()
			:caption('CodexSecret', warframe.CodexSecret and '[[Codex|%s]][[Category:Codex Secret]]' or nil, 'codex-secret')
		:done()
		
		:group():header('%s', 'passive')
			:caption('Passive', warframe.Passive and warframe.Passive)
		:done()
		
		:group():header('%s', 'abilities')
			:row('Ability1', '%s', Tooltip.getFullTooltip(warframe.Abilities[1], 'Ability'), 'first-ability')
			:row('Ability2', '%s', Tooltip.getFullTooltip(warframe.Abilities[2], 'Ability'), 'second-ability')
			:row('Ability3', '%s', Tooltip.getFullTooltip(warframe.Abilities[3], 'Ability'), 'third-ability')
			:row('Ability4', '%s', Tooltip.getFullTooltip(warframe.Abilities[4], 'Ability'), 'fourth-ability')
		:done()
		
		:group():header('%s', 'general-information')
			:row('Sex', '%s', warframe.Sex and (name ~= 'Xaku' and warframe.Sex..'[[Category:'..warframe.Sex..'s]]' or warframe.Sex..'[[Category:'..warframe.Sex..']]'), 'sex')
			:row('Mastery', '[[Mastery Rank|%s]]', warframe.Mastery or '0', 'mastery-rank')
			:row('Health', '[[Health|%s]]', warframe.Health and warframe.Health..' ('..(warframe.HealthRank30 or warframe.Health*3)..' at Rank 30)', 'health')
			:row('Shield', '[[Shield|%s]]', warframe.Shield and warframe.Shield..' ('..(warframe.ShieldRank30 or warframe.Shield*3)..' at Rank 30)', 'shields')
			:row('Armor', '[[Armor|%s]]', warframe.ArmorRank30 and warframe.Armor..' ('..warframe.ArmorRank30..' at Rank 30)' or warframe.Armor, 'armor')
			:row('Energy', '[[Energy Capacity|%s]]', warframe.Energy and warframe.Energy..' ('..(warframe.EnergyRank30 or Math.round(warframe.Energy*1.5, 0.1))..' at Rank 30)', 'energy')
			:row('InitialEnergy', '[[Energy Capacity#Warframe Starting Energy|%s]]', warframe.InitialEnergy and warframe.InitialEnergy, 'initial-energy')
			:row('Sprint', '[[Sprint Speed|%s]]', warframe.Sprint, 'sprint-speed')
			:row('Mobility', '[[Mobility|%s]]', warframe.Mobility, 'mobility')
			:row('AuraPolarity', '[[Aura|%s]]', warframe.AuraPolarity and Polarity._polarity(warframe.AuraPolarity)  or 'None', 'aura-polarity')
			:row('ExilusPolarity', '[[Exilus Adapter|%s]]', warframe.ExilusPolarity and Polarity._polarity(warframe.ExilusPolarity)  or 'None', 'exilus-polarity')
			:row('Polarities', '[[Mods#Polarity|%s]]', Polarity._pols(warframe.Polarities), 'polarities')
			:row('Introduced', '%s', warframe.Introduced and '{{ver|'..warframe.Introduced..'}}', 'introduced')
			:row('Themes', '%s', warframe.Themes, 'themes')
			:row('Progenitor', '[[Lich System#Progenitor Warframe|%s]]', warframe.Progenitor and Tooltip.getFullTooltip(warframe.Progenitor, 'DamageTypes'), 'progenitor-element')
			:row('Subsumed', '[[Helminth#Ability Replacement|%s]]', warframe.Subsumed and Tooltip.getFullTooltip(warframe.Subsumed, 'Ability'), 'subsumed-ability')
		:done()
		:group():header('%s', 'official-drop-tables')
			:caption('official-drop-tables', 'https://www.warframe.com/droptables', 'official-drop-tables')
		:done()
	:done()

	return frame:preprocess(tostring(Infobox))
end
}
Advertisement