Modification de Module:Infobox/Armure gamebryo
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 2 : | Ligne 2 : | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
----- | ----- Calcul des champs à afficher ----- | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
local games = (localdata['jeux'] or ''):lower() | |||
local isFo3 = games:find('fo3') ~= nil | |||
local isFnv = games:find('fnv') ~= nil | |||
local objectName2 = localdata['nom objet2'] | |||
-- Résistance et seuil de dégâts | |||
local rd, sd, rd2, sd2 | |||
if isFo3 then | |||
rd = localdata['rd'] or '?' | |||
if objectName2 then | |||
rd2 = localdata['rd2'] or '?' | |||
sd2 = nil | |||
end | |||
end | |||
if isFnv then | |||
rd = localdata['rd'] or nil | |||
sd = localdata['sd'] or '?' | |||
if objectName2 then | |||
rd2 = localdata['rd2'] or nil | |||
sd2 = localdata['sd2'] or '?' | |||
end | end | ||
end | end | ||
-- Type d'armure ou vêtement | -- Type d'armure ou vêtement | ||
Ligne 53 : | Ligne 40 : | ||
if objectName2 then | if objectName2 then | ||
local cases = { | local cases = { | ||
['armure'] = ' | ['armure'] = 'd\'armure', | ||
['vêtement'] = 'de vêtement' | |||
['vêtement'] = ' | |||
} | } | ||
ibSubject = 'Ensemble ' .. (cases[armorType] or 'd\'armure') | ibSubject = 'Ensemble ' .. (cases[armorType] or 'd\'armure') | ||
Ligne 63 : | Ligne 49 : | ||
['casque'] = 'Casque', | ['casque'] = 'Casque', | ||
['couvre-chef'] = 'Couvre-chef', | ['couvre-chef'] = 'Couvre-chef', | ||
['vêtement'] = 'Vêtement' | ['vêtement'] = 'Vêtement' | ||
} | } | ||
Ligne 69 : | Ligne 54 : | ||
end | end | ||
-- Gestion de l'affichage en fonction du type d'armure | |||
-- Gestion de l'affichage | |||
local objectTableLabel1 | local objectTableLabel1, objectTable2 | ||
if objectName2 then | if objectName2 then | ||
objectTableLabel1 = | objectTableLabel1 = require( 'Module:Outils' ).simpletitle(mw.getCurrentFrame()) | ||
objectTable2 = { type = 'table', title = objectName2, rows = { | |||
{ type = 'row', label = 'Résistance aux dégâts', value = function() return rd2 end }, | |||
{ type = 'row', label = 'Seuil de dégâts', value = function() return sd2 end }, | |||
{ type = 'row', label = 'Points de vie', value = 'pv2' }, | |||
{ type = 'row', label = 'Poids', value = 'poids2' }, | |||
{ type = 'row', label = 'Valeur', value = 'valeur2' }, | |||
{ type = 'row', label = 'Classe', value = 'classe2' }, | |||
{ type = 'row', label = 'Effets', value = 'effets2' }, | |||
{ type = 'row', label = 'Réparation', value = { 'réparation2', 'reparation2' }}, | |||
{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid2' }, | |||
}} | |||
else | |||
objectTable2 = { type = 'text' } | |||
end | end | ||
local objectTable1 = | local objectTable1 = { type = 'table', title = objectTableLabel1, separator = objectTableLabel1 == nil, rows = { | ||
{ type = 'row', label = 'Résistance aux dégâts', value = function() return rd end }, | |||
{ type = 'row', label = 'Seuil de dégâts', value = function() return sd end }, | |||
{ type = 'row', label = 'Points de vie', value = 'pv' }, | |||
{ type = 'row', label = 'Poids', value = 'poids' }, | |||
{ type = 'row', label = 'Valeur', value = 'valeur' }, | |||
{ type = 'row', label = 'Classe', value = 'classe' }, | |||
{ type = 'row', label = 'Effets', value = 'effets' }, | |||
{ type = 'row', label = 'Réparation', value = { 'réparation', 'reparation' }}, | |||
{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' }, | |||
}} | |||
-------------------------------------------------------- | -------------------------------------------------------- |