« Module:Infobox/Consommable » : différence entre les versions

aucun résumé des modifications
Kharmitch (discussion | contributions)
Page créée avec « local localdata = require('Module:Infobox/Localdata') function buildPerkLabel(localdata, index) local label = nil if(localdata['aptitude' .. index]) then label = '[['… »
 
Aucun résumé des modifications
 
(14 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
local localdata = require('Module:Infobox/Localdata')
local localdata = require('Module:Infobox/Localdata')


function buildPerkLabel(localdata, index)
function buildPerkRow(localdata, index)
local label = nil
local row = { type = 'text' } --fake
if(localdata['aptitude' .. index]) then
label = '[[' .. localdata['aptitude' .. index] .. ']]'
local perkLink = localdata['aptitude' .. index]
local perkEffect = localdata['effets aptitude' .. index]
if perkLink and perkEffect then
row = {
type = 'row',
label = function(localdata) return localdata['aptitude' .. index] end,
value = function(localdata) return localdata['effets aptitude' .. index] end,
}
end
end
return label
end
return row
 
function buildPerkValue(localdata, index)
local value = nil
if(localdata['effets aptitude' .. index]) then
value = localdata['effets aptitude' .. index]
end
return value
end
end


Ligne 26 : Ligne 27 :
{ type = 'row', label = 'Addiction', value = 'addiction' },
{ type = 'row', label = 'Addiction', value = 'addiction' },
{ type = 'row', label = 'Faim', value = 'faim' },
{ type = 'row', label = 'Faim', value = 'faim' },
{ type = 'row', label = 'Maladie', value = 'maladie' },
{ type = 'row', label = 'Points de vie', value = 'pv' },
{ type = 'row', label = 'Radiation', value = 'radiation' },
{ type = 'row', label = 'Soif', value = 'soif' }
{ type = 'row', label = 'Soif', value = 'soif' }
}},
{ type = 'table', title = 'Effets des aptitudes', collapseparameters = { collapsible = true, collapsed = true }, rows = {
{ type = 'row', label = 'Mutation', value = 'mutation' },
buildPerkRow(localdata, 1),
buildPerkRow(localdata, 2),
buildPerkRow(localdata, 3),
buildPerkRow(localdata, 4),
buildPerkRow(localdata, 5)
}},
}},
{ type = 'table', title = 'Artisanat', rows = {
{ type = 'table', title = 'Artisanat', rows = {
Ligne 37 : Ligne 49 :
{ type = 'row', label = 'Valeur', value = 'valeur' },
{ type = 'row', label = 'Valeur', value = 'valeur' },
{ type = 'row', label = 'Quêtes', value = 'quêtes' },
{ type = 'row', label = 'Quêtes', value = 'quêtes' },
{ type = 'row', label = 'Événements', value = 'événements' },
{ type = 'row', label = 'Durée avant détérioration', value = 'détérioration' },
{ type = 'row', label = 'Durée avant détérioration', value = 'détérioration' },
{ type = 'row', label = 'Se détériore en', value = 'détériore' },
{ type = 'row', label = 'Se détériore en', value = 'détériore' },
{ type = 'row', label = 'Recette', value = 'recette' }
{ type = 'row', label = 'Recette', value = 'recette' }
}},
}},
{ type = 'table', title = 'Aptitudes', collapseparameters = { collapsible = true, collapsed = true }, rows = {
{ type = 'table', title = 'Technique', collapseparameters = { collapsible = true, collapsed = true }, rows = {
{ type = 'row', label = function(localdata) return buildPerkLabel(localdata, '') end,  value = function(localdata) return buildPerkValue(localdata, '') end },
{ type = 'row', label = function(localdata) return buildPerkLabel(localdata, '2') end, value = function(localdata) return buildPerkValue(localdata, '2') end },
{ type = 'row', label = function(localdata) return buildPerkLabel(localdata, '3') end, value = function(localdata) return buildPerkValue(localdata, '3') end },
{ type = 'row', label = function(localdata) return buildPerkLabel(localdata, '4') end, value = function(localdata) return buildPerkValue(localdata, '4') end },
{ type = 'row', label = function(localdata) return buildPerkLabel(localdata, '5') end, value = function(localdata) return buildPerkValue(localdata, '5') end }
}},
{ type = 'table', title = 'Technique', rows = {
{ type = 'row', label = 'Prototype ID', value = 'proto' },
{ type = 'row', label = 'Prototype ID', value = 'proto' },
{ type = 'row', label = 'Editor ID', value = 'editor id' },
{ type = 'row', label = 'Editor ID', value = 'editor id' },
{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' },
{ type = 'row', label = '[[Form ID]]', value = 'formid' },
{ type = 'row', label = 'Fichier message', value = 'message' }
{ type = 'row', label = 'Fichier message', value = 'message' }
}},
}},
{ type = 'images', imageparameters = 'emplacement', captionparameter = 'emplacement desc', defaultcaption = 'Emplacement' },
{ type = 'text', value = 'pied' }
{ type = 'text', value = 'pied' }
}
}
}
}