Module:Fiche de créature/Fallout: New Vegas
Ce module contient la structure du modèle {{Fiche de créature de Fallout: New Vegas}}.
local localdata = require( 'Module:Infobox/Localdata' )
local tooltip = require( 'Module:Infobulle' )
COMPORTEMENT_LOOKUP = {
["agressivité"] = {
['0'] = { tag = "Non agressif", label = "N'engage pas les affrontements." },
['1'] = { tag = "Agressif", label = "Attaque les ennemis à vue." },
['2'] = { tag = "Très agressif", label = "Attaque les ennemis et les créatures neutres à vue." },
['3'] = { tag = "Frénétique", label = "Attaque n'importe qui à vue." }
},
["assurance"] = {
['0'] = { tag = "Lâche", label = "Fuit ou évite les affrontements." },
['1'] = { tag = "Prudent", label = "Fuit ou évite les menaces plus faibles que lui." },
['2'] = { tag = "Normal", label = "Fuit ou évite les menaces plus fortes que lui." },
['3'] = { tag = "Courageux", label = "Fuit ou évite les affrontements s'il est sévèrement dépassé." },
['4'] = { tag = "Téméraire", label = "Ne fuit ou n'évite jamais les affrontements." }
},
["assistance"] = {
['0'] = { tag = "N'aide personne", label = "N'aide personne lors des affrontements." },
['1'] = { tag = "Aide les alliés", label = "Aide les alliés lors des affrontements." },
['2'] = { tag = "Aide les amis", label = "Aide les amis et les alliés lors des affrontements." }
}
}
function rd(localdata)
local rd = localdata['rd']
if rd ~= nil then
rd = rd .. ' %'
end
return rd
end
function formatcomportement(localdata, setting)
local comportement = localdata[setting] or "0"
comportement = COMPORTEMENT_LOOKUP[setting][comportement]
if not comportement then
return nil
else
return tooltip._build({ comportement.tag, comportement.label })
end
end
return {
parts = {
{ type = "table", rows = {
{ type = "row", label = "Nom", icon = "sic", value = "nom" },
{ type = "row", label = "[[Form ID]]", icon = "réparation", value = "formid" },
{ type = "row", label = "[[Niveau]]", icon = "niveau", value = "niveau" },
{ type = "row", label = "[[Points d'expérience]]", icon = "xp", value = "xp" },
{ type = "row", label = "[[Perception]]", icon = "oeil", value = "perception" },
{ type = "row", label = "[[Points de vie]]", icon = "pv", value = "pv" },
{ type = "row", label = "[[Seuil de dégâts]]", icon = "sd", value = "sd" },
{ type = "row", label = "[[Résistance aux dégâts]]", icon = "rd", value = function(localdata) return rd(localdata) end }
}},
{ type = "table", title = "[[Attributs de l'IA Gamebryo|Comportement]]", rows = {
{ type = "row", label = "Agressivité", icon = "poing", value = function(localdata) return formatcomportement(localdata, "agressivité") end },
{ type = "row", label = "Assurance", icon = "confiance", value = function(localdata) return formatcomportement(localdata, "assurance") end },
{ type = "row", label = "Assistance", icon = "groupe", value = function(localdata) return formatcomportement(localdata, "assistance") end }
}},
{ type = "list", title = "Attaques", prefix = "attaque", max = 5 },
{ type = "list", title = "Capacités", prefix = "capacité", max = 5 },
{ type = "list", title = "Objets", prefix = "objet", max = 8 }
}
}