Module:SurvivorTooltip

---	SurvivorTooltip create survivor tooltip. --	--	@module		survivortooltip --	@alias		p --	@author		User:Thundermaker300 --	@attribution	All who helped to update survivor infoboxes --	@require	Module:Survivors/Data --	@release	stable --	 local p = {}

local SurvivorData = mw.loadData('Module:Survivors/Data').Survivors

local tooltip_template = ' ' .. ' ' ..                             ' %s ' .. '' ..                           ' ' ..                            ' ' ..                              '%s%s %s' .. ' ' ..                         ' '

local survivor_display = "%s  Class: %s HP: %s (+%s per level) Damage: %s (+%s per level) Umbra: %s"

---	Creates a survivor tooltip. --	@function		p.Tooltip --	@param			{table} frame Frame object --	@return			{string} Preprocessed wikitext of resultant link function p.Tooltip(frame) local data = SurvivorData[frame.args[1]] if data == nil then return error("SurvivorTooltip.Tooltip(frame): Invalid survivor!") end local str = string.format(		tooltip_template,		data.Image and "" or "",		data.Expansion and "" or "",		data.Name or "Unknown",		string.format(survivor_display, data.Description, data.Class or "Unknown", data.BaseHealth and tostring(data.BaseHealth) or "Unknown", data.ScalingHealth and tostring(data.ScalingHealth) or "Unknown", data.BaseDamage and tostring(data.BaseDamage) or "Unknown", data.ScalingDamage and tostring(data.ScalingDamage) or "Unknown", data.Umbra or "N/A" )	)	return frame:preprocess(str) end

return p