Module:Fiche de créature/Fallout

De Les Archives de Vault-Tec
Documentation du module

Ce module contient la structure du modèle {{Fiche de créature de Fallout}}.

Documentation transclues de Module:Fiche de créature/Fallout/doc.
local localdata = require( 'Module:Infobox/Localdata' )

function resistance(localdata, type)
	local sd = localdata[type .. ' sd']
	local rd = localdata[type .. ' rd']
	if not sd or not rd then
		return nil
	end
	return '<span class="avt-infobox-armor-rdsd">' ..  sd .. 
		'</span> · <span class="avt-infobox-armor-rdsd">' ..
		rd .. ' %</span>'
end

return {
	parts = {
		{ type = "table", rows = {
			{ type = "row", label = "Nom", icon = "sic", value = "nom" },
			{ type = "row", label = "Proto ID", icon = "réparation", value = "protoid" },
			{ type = "row", label = "Points d'expérience", icon = "xp", value = "xp" },
			{ type = "row", label = "Points de vie", icon = "pv", value = "pv" },
			{ type = "row", label = "Vitesse de guérison", icon = "vitesse de guérison", value = "guérison" },
			{ type = "row", label = "Classe d'armure", icon = "ca", value = "ca" },
			{ type = "row", label = "Séquence", icon = "séquence", value = "séquence" },
			{ type = "row", label = "Points d'action", icon = "pa", value = "pa" },
			{ type = "row", label = "Dégâts de mêlée", icon = "mêlée", value = "dégâts de mêlée" },
			{ type = "row", label = "Chances de critique", icon = "chance", value = "critiques" }
		}},
		{ type = "table", title = "Résistances ([[Seuil de dégâts|SD]] · [[Résistance aux dégâts|RD]])", rows = {
			{ type = "row", label = "Normal", icon = "dégâts", value = function(localdata) return resistance(localdata, "normal") end },
			{ type = "row", label = "Laser", icon = "laser", value = function(localdata) return resistance(localdata, "laser") end },
			{ type = "row", label = "Feu", icon = "feu", value = function(localdata) return resistance(localdata, "feu") end },
			{ type = "row", label = "Plasma", icon = "plasma", value = function(localdata) return resistance(localdata, "plasma") end },
			{ type = "row", label = "Électricité", icon = "électricité", value = function(localdata) return resistance(localdata, "électricité") end },
			{ type = "row", label = "Explosif", icon = "explosion", value = function(localdata) return resistance(localdata, "explosion") end },
			{ type = "row", label = "IEM", icon = "iem", value = function(localdata) return resistance(localdata, "iem") end }
		}},
		{ type = "list", title = "Attaques", prefix = "attaque", max = 5 },
		{ type = "list", title = "Capacités", prefix = "capacité", max = 5 },
	}
}