(FichE) |
Aucun résumé des modifications |
||
(38 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 2 : | Ligne 2 : | ||
local Tableau |
local Tableau |
||
− | local modDlc = require( 'Module:Dlc' ) |
||
local modElements = require( 'Module:Elements' ) |
local modElements = require( 'Module:Elements' ) |
||
− | local modIcone = require( 'Module:Icone' ) |
||
− | local modSucces = require( 'Module:Succes' ) |
||
local police = require( 'Module:Police' ) |
local police = require( 'Module:Police' ) |
||
+ | function p.mode( f, listeModes ) |
||
− | --[[ FONCTIONS ARGUMENTS : DEBUT ]] |
||
+ | local moduleFiche = require( f:getTitle() ) |
||
− | |||
+ | local args = moduleFiche.args( f ) |
||
− | |||
+ | local disp = mw.text.split( args.disp, '-') |
||
− | function p.argsBase( f ) |
||
− | local modeNb = 1 |
||
− | local modeNom = 'mode1' |
||
− | local mode = {} |
||
− | local paramNb = 1 |
||
− | local paramNom = 'param1' |
||
− | local param = {} |
||
− | local valeurNom = 'valeur1' |
||
− | local valeur = {} |
||
− | local _t = { |
||
− | disp = f:getParent().args['disp'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | nom = f:getParent().args['nom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | Type = f:getParent().args['type'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | while f:getParent().args[modeNom] do |
||
− | mode[modeNb] = f:getParent().args[modeNom] |
||
− | modeNb = modeNb + 1 |
||
− | modeNom = 'mode' .. tostring( modeNb ) |
||
− | end |
||
− | mode.nb = modeNb - 1 |
||
− | while f:getParent().args[paramNom] do |
||
− | param[paramNb] = f:getParent().args[paramNom] |
||
− | valeur[paramNb] = f:getParent().args[valeurNom] |
||
− | paramNb = paramNb + 1 |
||
− | paramNom = 'param' .. tostring( paramNb ) |
||
− | valeurNom = 'valeur' .. tostring( paramNb ) |
||
− | end |
||
− | param.nb = paramNb - 1 |
||
− | table.insert( _t, mode ) |
||
− | table.insert( _t, param ) |
||
− | table.insert( _t, valeur ) |
||
− | |||
− | return _t |
||
− | end |
||
− | |||
− | function p.argsPersonnage( f ) |
||
− | return { |
||
− | cadenceTir = f:getParent().args['cadencetir'], |
||
− | chance = f:getParent().args['chance'], |
||
− | consommable = f:getParent().args['consommable'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | degats = f:getParent().args['dégâts'], |
||
− | disp = f:getParent().args['disp'], |
||
− | nom = f:getParent().args['nom'], |
||
− | objet = f:getParent().args['objet'], |
||
− | portee = f:getParent().args['portée'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | sante = f:getParent().args['santé'], |
||
− | temp = f:getParent().args['temp'], |
||
− | vitesse = f:getParent().args['vitesse'], |
||
− | vitesseLarmes = f:getParent().args['vitesselarmes'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsObjetActif( f ) |
||
− | return { |
||
− | animation = f:getParent().args['animation'], |
||
− | citation = f:getParent().args['citation'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | grille = f:getParent().args['grille'], |
||
− | grilleold = f:getParent().args['grilleold'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | larmes = f:getParent().args['larmes'], |
||
− | liste = f:getParent().args['liste'], |
||
− | nom = f:getParent().args['nom'], |
||
− | personnage = f:getParent().args['personnage'], |
||
− | recharge = f:getParent().args['recharge'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsObjetPassif( f ) |
||
− | return { |
||
− | animation = f:getParent().args['animation'], |
||
− | citation = f:getParent().args['citation'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | grille = f:getParent().args['grille'], |
||
− | grilleold = f:getParent().args['grilleold'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | larmes = f:getParent().args['larmes'], |
||
− | liste = f:getParent().args['liste'], |
||
− | nom = f:getParent().args['nom'], |
||
− | personnage = f:getParent().args['personnage'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsBabiole( f ) |
||
− | return { |
||
− | animation = f:getParent().args['animation'], |
||
− | citation = f:getParent().args['citation'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | larmes = f:getParent().args['larmes'], |
||
− | liste = f:getParent().args['liste'], |
||
− | nom = f:getParent().args['nom'], |
||
− | personnage = f:getParent().args['personnage'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsCarte( f ) |
||
− | return { |
||
− | citation = f:getParent().args['citation'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | nom = f:getParent().args['nom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsRune( f ) |
||
− | return { |
||
− | citation = f:getParent().args['citation'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | nom = f:getParent().args['nom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsCarteSpeciale( f ) |
||
− | return { |
||
− | animation = f:getParent().args['animation'], |
||
− | citation = f:getParent().args['citation'], |
||
− | deblocage = f:getParent().args['déblocage'], |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | id = f:getParent().args['id'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | nom = f:getParent().args['nom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | temp = f:getParent().args['temp'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | function p.argsMonstre( f ) |
||
− | return { |
||
− | description = f:getParent().args['description'], |
||
− | disp = f:getParent().args['disp'], |
||
− | dlc = f:getParent().args['dlc'], |
||
− | environnement = f:getParent().args['environnement'], |
||
− | grande = f:getParent().args['grande'], |
||
− | imageCase = f:getParent().args['image-case'], |
||
− | imageNom = f:getParent().args['image-nom'], |
||
− | imageTableau = f:getParent().args['image-tableau'], |
||
− | miniBoss = f:getParent().args['miniboss'], |
||
− | nom = f:getParent().args['nom'], |
||
− | remplaceImage = f:getParent().args['remplaceimage'], |
||
− | remplaceNom = f:getParent().args['remplacenom'], |
||
− | santeBase = f:getParent().args['santébase'], |
||
− | santeEtage = f:getParent().args['santéétage'], |
||
− | Type = f:getParent().args['type'], |
||
− | visible = f:getParent().args['visible'] |
||
− | } |
||
− | end |
||
− | |||
− | |||
− | --[[ FONCTIONS ARGUMENTS : FIN ]] |
||
− | --[[ FONCTIONS MODES BASE : DEBUT ]] |
||
− | |||
− | |||
− | function p.modeBase( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
local page = modElements.page( args.nom ) |
local page = modElements.page( args.nom ) |
||
− | local |
+ | local modes = {} |
− | local i = 1 |
||
− | local modeExiste = false |
||
+ | for index, objet in pairs( args ) do |
||
− | if blocage[2] == 'dlc' then |
||
+ | if objet == '' then |
||
− | page.valeur.dlc = args.dlc |
||
+ | args[index] = nil |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' and args.forme == 'tableau' then |
||
− | return p.modeBaseTableau( f ) |
||
− | elseif args.disp == '{{{2}}}' then |
||
− | return p.ficheBase( f ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeBaseCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeBaseNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeBaseTableau( f, page.valeur.dlc, true ) |
||
− | else |
||
− | for index, objet in pairs( pages ) do |
||
− | if args.disp == 'mode' .. tostring( i ) then |
||
− | modeExiste = true |
||
− | return args.mode[i] |
||
− | end |
||
− | end |
||
− | if not modeExiste then |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
end |
end |
||
end |
end |
||
− | end |
||
− | |||
− | |||
− | function p.modeBaseCase( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeBaseNom( f, iconeDlc ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeBaseTableau( f, iconeDlc, tComplet ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | Tableau = '|-\n|' |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '\n| style="text-align:center" | ' .. args.id |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n| style="text-align:center" | ' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) |
||
− | |||
− | if tComplet and args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '\n|' .. p.citation( args.citation, true ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n|' .. args.description |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.ficheBase( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '{| class="wikitable" style="border:solid #45264D; float:right; max-width:400px"' .. '\n! style="background:#45264D; width:300px; font-size:10pt; color:#FFFFFF; font-weight:bold" |' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n|-\n| style="text-align:center; font-size:9pt" |' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '70x70px', false, '', '_Icon' ) .. '\n[[Fichier:Item_altar.png|100px|centre|lien=]]' |
||
− | |||
− | if args.personnage ~= nil and args.personnage ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Apparence du personnage\n|-\n| style="text-align:center; font-weight:normal" |' .. p.image( args.nom, args.remplaceNom, args.personnage, '100px', false, '', '_App' ) |
||
− | end |
||
− | |||
− | if args.larmes ~= nil and args.larmes ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Apparence des larmes\n|-\n| style="text-align:center; font-weight:normal" |' .. p.image( args.nom, args.remplaceNom, args.larmes, '100px', false, '', '_Tears' ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n|-\n! Type d\'objet\n|-\n| style="text-align:center; font-weight:normal" | [[Objets#Objets Actifs|Objet Actif]]' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! ID de l\'objet\n|-\n| style="text-align:center; font-weight:normal" |' .. args.id |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Citation\n|-\n| style="text-align:center; font-weight:normal" |' .. p.citation( args.citation, true ) |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Animation\n|-\n| style="text-align:center; font-weight:normal" |' .. args.animation |
||
− | end |
||
− | |||
− | if args.recharge ~= nil and args.recharge ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Temps de rechargement\n|-\n| style="text-align:center; font-weight:normal" |' .. p.recharge( args.recharge ) |
||
− | end |
||
− | |||
− | if args.liste ~= nil and args.liste ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Liste de génération\n|-\n| style="text-align:center; font-weight:normal" |' .. p.liste( args.liste ) |
||
− | end |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Méthode de déblocage\n|-\n| style="text-align:center; font-weight:normal" |' .. modSucces.deblocage( args.deblocage, false ) |
||
− | end |
||
− | |||
− | if args.grille ~= nil and args.grille ~= '' then |
||
− | Tableau = Tableau .. '\n|-\n! Grille de collection\n|-\n| style="text-align:center; font-weight:normal" |' |
||
− | if args.grilleold ~= nil and args.grilleold ~= '' then |
||
− | Tableau = Tableau .. modDlc.icon( 'Afterbirth' ) .. ' <u>Afterbirth</u>\n' .. p.grilleCollection( args.grille, 20, 6, true ) .. '<u>Rebirth</u>\n' .. p.grilleCollection( args.grilleold, 10, 10, true ) |
||
− | else |
||
− | Tableau = Tableau .. p.grilleCollection( args.grille, 20, 6, true ) |
||
− | end |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n|}' |
||
− | end |
||
− | |||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES BASE : FIN ]] |
||
− | --[[ FONCTIONS MODES OBJET ACTIF : DEBUT ]] |
||
− | |||
− | function p.modeObjetActif( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
if not page.valeur.dlc then |
if not page.valeur.dlc then |
||
− | + | page.valeur.dlc = '' |
|
end |
end |
||
− | if |
+ | if disp[2] == 'dlc' then |
page.valeur.dlc = args.dlc |
page.valeur.dlc = args.dlc |
||
− | elseif |
+ | elseif disp[2] == 'nodlc' then |
page.valeur.dlc = 'Booster Pack 10' |
page.valeur.dlc = 'Booster Pack 10' |
||
end |
end |
||
+ | if listeModes then |
||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
+ | local tableauModes = mw.text.split( listeModes, '%s/%s' ) |
||
− | if args.disp == '{{{2}}}' then |
||
+ | local i = 1 |
||
− | return p.ficheObjetActif( f ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeObjetActifCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeObjetActifNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeObjetActifTableau( f, page.valeur.dlc, true ) |
||
− | elseif args.disp == 'phraseIntro' then |
||
− | return p.modeObjetActifIntro( f ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetActifIntro( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | Tableau = "'''" .. args.nom .. "''' est un [[objet actif]]" |
||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. ' déblocable' |
||
− | end |
||
− | if args.dlc ~= nil and args.dlc ~= '' then |
||
− | if args.dlc == 'Afterbirth' then |
||
− | Tableau = Tableau .. " ajouté dans l'extension ''[[The Binding of Isaac: Afterbirth]]''" |
||
− | elseif args.dlc == 'Afterbirth' then |
||
− | Tableau = Tableau .. " ajouté dans l'extension ''[[The Bindiéng of Isaac: Afterbirth ���]]''" |
||
− | else |
||
− | local bp = mw.text.split( args.dlc, '%s' ) |
||
− | if bp[1] == 'Booster' then |
||
− | Tableau = Tableau .. " ajouté dans le ''[[Booster Pack #" .. bp[3] .. "]]''" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | return Tableau .. '.' |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetActifCase( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetActifNom( f, iconeDlc ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetActifTableau( f, iconeDlc, tComplet ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | |||
− | Tableau = '<tr><td>' .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td style="text-align:center>' .. args.id .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td style="text-align:center; white-space:nowrap">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. ' ' .. p.recharge( args.recharge, 1 ) .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td>' .. p.citation( args.citation, true ) .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td>' .. args.description .. '</td></tr>' |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.ficheObjetActif( f ) |
||
− | local args = p.argsObjetActif( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '<table class="ficheCadre" ><tr><td><table class="ficheCadreLargeDebut"><th style="height:80px">' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</th><tr><td style="height:220px">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '70x70px', false, '', '_Icon' ) .. '\n[[Fichier:Item_altar.png|100px|centre|lien=]]</td></tr></table>' |
||
− | |||
− | Tableau = Tableau .. '<table class="ficheCadreLargeCentre"><tr><td>[[Image:TableDividingLine1.png]]</td></tr>' |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Citation' ) .. '</th></tr><tr><td>' .. p.citation( args.citation, true ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '<tr><td>' .. p.image( args.nom, args.remplaceNom, args.animation, '70x70px', false, '', '_Icon', '.gif' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.personnage ~= nil and args.personnage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence du personnage' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.personnage, '100px', false, '', '_App' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.larmes ~= nil and args.larmes ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence des larmes' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.larmes, '100px', false, '', '_Tears' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine2.png]]</td></tr>' |
||
− | |||
− | if args.recharge ~= nil and args.recharge ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Temps de rechargement' ) .. '</th></tr><tr><td>' .. p.recharge( args.recharge ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Recharge]]' |
||
− | end |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'ID de l\'objet' ) .. '</th></tr><tr><td>' .. args.id .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | if args.liste ~= nil and args.liste ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Liste de gEnEration', 'E-eacute' ) .. '</th></tr><tr><td>' .. p.liste( args.liste ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Liste]]' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine3.png]]</td></tr>' |
||
− | |||
− | if args.grille ~= nil and args.grille ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Grille de collection' ) .. '</th></tr><tr><td>' |
||
− | if args.grilleold ~= nil and args.grilleold ~= '' then |
||
− | Tableau = Tableau .. modDlc.icon( 'Afterbirth' ) .. police.standard( 'TeamMeat', 'Afterbirth' ) .. '\n' .. p.grilleCollection( args.grille, 20, 6, true ) .. police.standard( 'TeamMeat', 'Rebirth' ) .. '\n' .. p.grilleCollection( args.grilleold, 10, 10, true ) .. '</td></tr>' |
||
− | else |
||
− | Tableau = Tableau .. p.grilleCollection( args.grille, 20, 6, true ) .. '</td></tr>' |
||
− | end |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Grille]]' |
||
− | end |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'MEthode de dEblocage', 'E-eacute' ) .. '</th></tr><tr><td>' .. modSucces.deblocage( args.deblocage, false ) .. '</td></tr>' |
||
− | end |
||
+ | repeat |
||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeFin"><tr><td style="height: 110px"></td></tr></table></td></tr></table>' |
||
+ | modes[tableauModes[i]] = true |
||
− | end |
||
+ | i = i + 1 |
||
− | |||
+ | until not tableauModes[i] |
||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES OBJET ACTIF : FIN ]] |
||
− | --[[ FONCTIONS MODES OBJET PASSIF : DEBUT ]] |
||
− | |||
− | function p.modeObjetPassif( f ) |
||
− | local args = p.argsObjetPassif( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if not page.valeur.dlc then |
||
− | page.valeur.dlc = '' |
||
− | end |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
end |
end |
||
if args.temp == args.nom or args.temp == '{{{1}}}' then |
if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
if args.disp == '{{{2}}}' then |
if args.disp == '{{{2}}}' then |
||
− | return |
+ | return moduleFiche.fiche( args, page ) |
− | elseif |
+ | elseif disp[1] == 'case' and modes.case then |
− | return |
+ | return moduleFiche.case( args, page ) |
− | elseif |
+ | elseif disp[1] == 'nom' and modes.nom then |
− | return |
+ | return moduleFiche.nom( args, page ) |
− | elseif |
+ | elseif disp[1] == 'tableau' and modes.tableau then |
+ | if disp[2] == 'simple' and modes.tableauSimple or disp[3] == 'simple' and modes.tableauSimple then |
||
− | return p.modeObjetPassifTableau( f, page.valeur.dlc, true ) |
||
+ | return moduleFiche.tableauSimple( args, page ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetPassifCase( f ) |
||
− | local args = p.argsObjetPassif( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetPassifNom( f, iconeDlc ) |
||
− | local args = p.argsObjetPassif( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeObjetPassifTableau( f, iconeDlc, tComplet ) |
||
− | local args = p.argsObjetPassif( f ) |
||
− | |||
− | Tableau = '<tr><td>' .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td style="text-align:center">' .. args.id .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td style="text-align:center">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td>' .. p.citation( args.citation, true ) .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td>' .. args.description .. '</td></tr>' |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.ficheObjetPassif( f ) |
||
− | local args = p.argsObjetPassif( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '<table class="ficheCadre" ><tr><td><table class="ficheCadreLargeDebut"><th style="height:80px">' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</th><tr><td style="height:220px">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '70x70px', false, '', '_Icon' ) .. '\n[[Fichier:Item_altar.png|100px|centre|lien=]]</td></tr></table>' |
||
− | |||
− | Tableau = Tableau .. '<table class="ficheCadreLargeCentre"><tr><td>[[Image:TableDividingLine1.png]]</td></tr>' |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Citation' ) .. '</th></tr><tr><td>' .. p.citation( args.citation, true ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '<tr><td>' .. p.image( args.nom, args.remplaceNom, args.animation, '70x70px', false, '', '_Icon', '.gif' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.personnage ~= nil and args.personnage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence du personnage' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.personnage, '100px', false, '', '_App' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.larmes ~= nil and args.larmes ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence des larmes' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.larmes, '100px', false, '', '_Tears' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine2.png]]</td></tr>' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'ID de l\'objet' ) .. '</th></tr><tr><td>' .. args.id .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | if args.liste ~= nil and args.liste ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Liste de gEnEration', 'E-eacute' ) .. '</th></tr><tr><td>' .. p.liste( args.liste ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans Liste]]' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine3.png]]</td></tr>' |
||
− | |||
− | if args.grille ~= nil and args.grille ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Grille de collection' ) .. '</th></tr><tr><td>' |
||
− | if args.grilleold ~= nil and args.grilleold ~= '' then |
||
− | Tableau = Tableau .. modDlc.icon( 'Afterbirth' ) .. police.standard( 'TeamMeat', 'Afterbirth' ) .. '\n' .. p.grilleCollection( args.grille, 20, 6, true ) .. police.standard( 'TeamMeat', 'Rebirth' ) .. '\n' .. p.grilleCollection( args.grilleold, 10, 10, true ) .. '</td></tr>' |
||
else |
else |
||
+ | return moduleFiche.tableau( args, page ) |
||
− | Tableau = Tableau .. p.grilleCollection( args.grille, 20, 6, true ) .. '</td></tr>' |
||
end |
end |
||
+ | elseif disp[1] == 'phraseIntro' and modes.phraseIntro then |
||
− | else |
||
+ | return moduleFiche.intro( args ) |
||
− | _c = _c .. '[[Catégorie:Objets sans Grille]]' |
||
− | end |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'MEthode de dEblocage', 'E-eacute' ) .. '</th></tr><tr><td>' .. modSucces.deblocage( args.deblocage, false ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeFin"><tr><td style="height: 110px"></td></tr></table></td></tr></table>' |
||
− | end |
||
− | |||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES OBJET PASSIF : FIN ]] |
||
− | --[[ FONCTIONS MODES BABIOLE : DEBUT ]] |
||
− | |||
− | function p.modeBabiole( f ) |
||
− | local args = p.argsBabiole( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if not page.valeur.dlc then |
||
− | page.valeur.dlc = '' |
||
− | end |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' then |
||
− | return p.ficheBabiole( f ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeBabioleCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeBabioleNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeBabioleTableau( f, page.valeur.dlc, true ) |
||
else |
else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de |
+ | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de fiche inconnu]]" |
end |
end |
||
end |
end |
||
end |
end |
||
− | |||
− | function p.modeBabioleCase( f ) |
||
− | local args = p.argsBabiole( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeBabioleNom( f, iconeDlc ) |
||
− | local args = p.argsBabiole( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeBabioleTableau( f, iconeDlc, tComplet ) |
||
− | local args = p.argsBabiole( f ) |
||
− | |||
− | Tableau = '<tr><td>' .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td style="text-align:center">' .. args.id .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td style="text-align:center">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) .. '</td>' |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '<td>' .. p.citation( args.citation, true ) .. '</td>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td>' .. args.description .. '</td></tr>' |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.ficheBabiole( f ) |
||
− | local args = p.argsBabiole( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '<table class="ficheCadre" ><tr><td><table class="ficheCadreLargeDebut"><th style="height:80px">' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</th><tr><td style="height:120px">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '70x70px', false, '', '_Icon' ) .. '</td></tr><tr><td>\n\n[[Image:TableDividingLine1.png]]</td></tr>' |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Citation' ) .. '</th></tr><tr><td>' .. p.citation( args.citation, true ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '<tr><td style="height:120px">[[Catégorie:Objets sans Citation]]</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeCentre">' |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '<tr><td>' .. p.image( args.nom, args.remplaceNom, args.animation, '70x70px', false, '', '_Icon', '.gif' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.personnage ~= nil and args.personnage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence du personnage' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.personnage, '100px', false, '', '_App' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.larmes ~= nil and args.larmes ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence des larmes' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.larmes, '100px', false, '', '_Tears' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine2.png]]</td></tr>' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'ID de l\'objet' ) .. '</th></tr><tr><td>' .. args.id .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | if args.liste ~= nil and args.liste ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Liste de gEnEration', 'E-eacute' ) .. '</th></tr><tr><td>' .. p.liste( args.liste ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'MEthode de dEblocage', 'E-eacute' ) .. '</th></tr><tr><td>' .. modSucces.deblocage( args.deblocage, false ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeFin"><tr><td style="height: 110px"></td></tr></table></td></tr></table>' |
||
− | end |
||
− | |||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES BABIOLES : FIN ]] |
||
− | --[[ FONCTIONS MODES CARTE : DEBUT ]] |
||
− | |||
− | function p.modeCarte( f ) |
||
− | local args = p.argsCarte( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if not page.valeur.dlc then |
||
− | page.valeur.dlc = '' |
||
− | end |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' then |
||
− | return p.modeCarteTableau( f, page.valeur.dlc, true ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeCarteCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeCarteNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeCarteTableau( f, page.valeur.dlc, false ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteCase( f ) |
||
− | local args = p.argsCarte( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteNom( f, iconeDlc ) |
||
− | local args = p.argsCarte( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteTableau( f, iconeDlc, categories ) |
||
− | local args = p.argsCarte( f ) |
||
− | |||
− | Tableau = '<tr><td>' .. p.nom( args.nom, args.remplaceNom, 3 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</td>' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<td style="text-align:center">' .. args.id .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td style="text-align:center">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) .. '</td>' |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<td>' .. p.citation( args.citation, true ) .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | if args.description ~= nil and args.description ~= '' then |
||
− | Tableau = Tableau .. '<td>' .. args.description .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | return Tableau .. '</tr>' |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES CARTE : FIN ]] |
||
− | --[[ FONCTIONS MODES RUNE : DEBUT ]] |
||
− | |||
− | function p.modeRune( f ) |
||
− | local args = p.argsRune( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if not page.valeur.dlc then |
||
− | page.valeur.dlc = '' |
||
− | end |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' then |
||
− | return p.modeRuneTableau( f, page.valeur.dlc, true ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeRuneCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeRuneNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeRuneTableau( f, page.valeur.dlc, false ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeRuneCase( f ) |
||
− | local args = p.argsRune( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeRuneNom( f, iconeDlc ) |
||
− | local args = p.argsRune( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeRuneTableau( f, iconeDlc, categories ) |
||
− | local args = p.argsRune( f ) |
||
− | |||
− | Tableau = '<tr><td>' .. p.nom( args.nom, args.remplaceNom, 3 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</td>' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<td style="text-align:center">' .. args.id .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<td style="text-align:center">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) .. '</td>' |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '<td>' .. modSucces.deblocage( args.deblocage, false ) .. '</td>' |
||
− | end |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<td>' .. p.citation( args.citation, true ) .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | if args.description ~= nil and args.description ~= '' then |
||
− | Tableau = Tableau .. '<td>' .. args.description .. '</td>' |
||
− | elseif categories then |
||
− | Tableau = Tableau .. '[[Catégorie:Objets sans Citation]]' |
||
− | end |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES RUNE : FIN ]] |
||
− | --[[ FONCTIONS MODES CARTE SPÉCIALE : DEBUT ]] |
||
− | |||
− | function p.modeCarteSpeciale( f ) |
||
− | local args = p.argsCarteSpeciale( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if not page.valeur.dlc then |
||
− | page.valeur.dlc = '' |
||
− | end |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' then |
||
− | return p.ficheCarteSpeciale( f ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeCarteSpecialeCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeCarteSpecialeNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeCarteSpecialeTableau( f, page.valeur.dlc, true ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteSpecialeCase( f ) |
||
− | local args = p.argsCarteSpeciale( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteSpecialeNom( f, iconeDlc ) |
||
− | local args = p.argsCarteSpeciale( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeCarteSpecialeTableau( f, iconeDlc, tComplet ) |
||
− | local args = p.argsCarteSpeciale( f ) |
||
− | |||
− | Tableau = '|-\n|' |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | if tComplet then |
||
− | Tableau = Tableau .. '\n| style="text-align:center" | ' .. args.id |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n| style="text-align:center" | ' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) |
||
− | |||
− | if tComplet and args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '\n|' .. p.citation( args.citation, true ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n|' .. args.description |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | function p.ficheCarteSpeciale( f ) |
||
− | local args = p.argsCarteSpeciale( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '<table class="ficheCadre" ><tr><td><table class="ficheCadreLargeDebut"><th style="height:80px">' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</th><tr><td style="height:120px">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '70x70px', false, '', '_Icon' ) .. '</td></tr><tr><td>\n\n[[Image:TableDividingLine1.png]]</td></tr>' |
||
− | |||
− | if args.citation ~= nil and args.citation ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Citation' ) .. '</th></tr><tr><td>' .. p.citation( args.citation, true ) .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '<tr><td style="height:120px">[[Catégorie:Objets sans Citation]]</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeCentre">' |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '<tr><td>' .. p.image( args.nom, args.remplaceNom, args.animation, '70x70px', false, '', '_Icon', '.gif' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.personnage ~= nil and args.personnage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence du personnage' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.personnage, '100px', false, '', '_App' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.larmes ~= nil and args.larmes ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Apparence des larmes' ) .. '</th></tr><tr><td>' .. p.image( args.nom, args.remplaceNom, args.larmes, '100px', false, '', '_Tears' ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine2.png]]</td></tr>' |
||
− | |||
− | if args.id ~= nil and args.id ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'ID de l\'objet' ) .. '</th></tr><tr><td>' .. args.id .. '</td></tr>' |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Objets sans ID]]' |
||
− | end |
||
− | |||
− | if args.liste ~= nil and args.liste ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Liste de gEnEration', 'E-eacute' ) .. '</th></tr><tr><td>' .. p.liste( args.liste ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | if args.deblocage ~= nil and args.deblocage ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'MEthode de dEblocage', 'E-eacute' ) .. '</th></tr><tr><td>' .. modSucces.deblocage( args.deblocage, false ) .. '</td></tr>' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeFin"><tr><td style="height: 110px"></td></tr></table></td></tr></table>' |
||
− | end |
||
− | |||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | |||
− | --[[ FONCTIONS MODES CARTE SPÉCIALE : FIN ]] |
||
− | --[[ FONCTIONS MODES MONSTRE : DEBUT ]] |
||
− | |||
− | function p.modeMonstre( f ) |
||
− | local args = p.argsMonstre( f ) |
||
− | local page = modElements.page( args.nom ) |
||
− | local blocage = mw.text.split( args.disp, '-') |
||
− | |||
− | if blocage[2] == 'dlc' then |
||
− | page.valeur.dlc = args.dlc |
||
− | elseif blocage[2] == 'nodlc' then |
||
− | page.valeur.dlc = 'Booster Pack 10' |
||
− | end |
||
− | |||
− | if args.temp == args.nom or args.temp == '{{{1}}}' then |
||
− | if args.disp == '{{{2}}}' then |
||
− | return p.ficheMonstre( f ) |
||
− | elseif args.disp == 'case' then |
||
− | return p.modeMonstreCase( f ) |
||
− | elseif args.disp == 'nom' then |
||
− | return p.modeMonstreNom( f, page.valeur.dlc ) |
||
− | elseif args.disp == 'tableau' then |
||
− | return p.modeMonstreTableau( f, page.valeur.dlc ) |
||
− | else |
||
− | return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de modèle manquant]]" |
||
− | end |
||
− | end |
||
− | end |
||
− | |||
− | |||
− | function p.modeMonstreCase( f ) |
||
− | local args = p.argsMonstre( f ) |
||
− | |||
− | Tableau = p.image( args.nom, args.remplaceNom, args.imageCase, '40x40px', true, '', '_Icon' ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeMonstreNom( f, iconeDlc ) |
||
− | local args = p.argsMonstre( f ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. p.image( args.nom, args.remplaceNom, args.imageNom, '20x20px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.modeMonstreTableau( f, iconeDlc ) |
||
− | local args = p.argsMonstre( f ) |
||
− | |||
− | Tableau = '|-\n|' |
||
− | |||
− | Tableau = Tableau .. p.nom( args.nom, args.remplaceNom, 2 ) |
||
− | |||
− | if args.dlc ~= nil and iconeDlc then |
||
− | Tableau = Tableau .. modDlc.icon( args.dlc ) |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '\n| style="text-align:center" | ' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '45x45px', true, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. '\n|' .. args.description |
||
− | |||
− | return Tableau |
||
− | end |
||
− | |||
− | |||
− | function p.ficheMonstre( f ) |
||
− | local args = p.argsMonstre( f ) |
||
− | local affichage = mw.text.split( args.disp, ', ' ) |
||
− | local _c = '' |
||
− | |||
− | if args.visible ~= 0 then |
||
− | Tableau = '<table class="ficheCadre" ><tr><td><table class="ficheCadreLargeDebut"><th style="height:80px">' .. p.nom( args.nom, args.remplaceNom, 0 ) |
||
− | |||
− | local dlc = modDlc.icon( args.dlc ) |
||
− | if dlc ~= nil then |
||
− | Tableau = Tableau .. '<br>' .. dlc |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</th><tr><td style="height:220px">' .. p.image( args.nom, args.remplaceNom, args.remplaceImage, '100x200px', false, '', '_Icon' ) |
||
− | |||
− | Tableau = Tableau .. '<table class="ficheCadreLargeCentre"><tr><td>[[Image:TableDividingLine1.png]]</td></tr>' |
||
− | |||
− | if args.animation ~= nil and args.animation ~= '' then |
||
− | Tableau = Tableau .. '<tr><td>' .. p.image( args.nom, args.remplaceNom, args.animation, '70x70px', false, '', '_Icon', '.gif' ) .. '</td></tr>' |
||
− | Tableau = Tableau .. '<tr><td>[[Image:TableDividingLine2.png]]</td></tr>' |
||
− | end |
||
− | |||
− | if args.environnement ~= nil and args.environnement ~= '' then |
||
− | Tableau = Tableau .. '<tr><th>' .. police.gras( 'TeamMeat', 'Environnement' ) .. '</th></tr><tr><td>' .. modIcone.environnement( args.environnement ) |
||
− | else |
||
− | _c = _c .. '[[Catégorie:Monstres sans Environnement]]' |
||
− | end |
||
− | |||
− | Tableau = Tableau .. '</table><table class="ficheCadreLargeDiv"><tr><td style="height: 22px"></td></tr></table></td></tr></table>' |
||
− | end |
||
− | |||
− | return Tableau .. _c |
||
− | end |
||
− | |||
− | --[[ FONCTIONS MODES MONSTRE : FIN ]] |
||
− | --[[ FONCTIONS GENERALES : DEBUT ]] |
||
− | |||
− | --[[ FONCTION NOM ]] |
||
function p.nom( nom, remplaceNom, mode ) |
function p.nom( nom, remplaceNom, mode ) |
||
− | local nomFinal = nom |
+ | local nomFinal = remplaceNom or nom |
if remplaceNom ~= nil and remplaceNom ~= '' then |
if remplaceNom ~= nil and remplaceNom ~= '' then |
||
Ligne 1 339 : | Ligne 78 : | ||
end |
end |
||
− | --[[ FONCTION IMAGE ]] |
||
function p.image( nom, remplaceNom, remplaceImage, _t, lien, _sD, _sF, _e ) |
function p.image( nom, remplaceNom, remplaceImage, _t, lien, _sD, _sF, _e ) |
||
Ligne 1 347 : | Ligne 85 : | ||
local autres = false |
local autres = false |
||
− | + | _e = _e or '.png' |
|
− | _e = '.png' |
||
− | end |
||
if remplaceImage ~= nil and remplaceImage ~= '' then |
if remplaceImage ~= nil and remplaceImage ~= '' then |
||
local image = mw.text.split( remplaceImage, '%s' ) |
local image = mw.text.split( remplaceImage, '%s' ) |
||
Ligne 1 355 : | Ligne 91 : | ||
if image[1] then |
if image[1] then |
||
repeat |
repeat |
||
− | if image[n]:find( '%.' ) then |
+ | if image[n]:reverse():find( '%.', image[n]:len()-2 ) then |
_e = image[n] |
_e = image[n] |
||
− | elseif image[n]:find( 'px' ) or image[n]:find( '%%' ) then |
+ | elseif image[n]:find( 'px', image[n]:len()-3 ) or image[n]:find( '%%', image[n]:len()-2 ) then |
_t = image[n] |
_t = image[n] |
||
elseif not autres then |
elseif not autres then |
||
Ligne 1 378 : | Ligne 114 : | ||
end |
end |
||
− | --[[ FONCTION TYPE ]] |
||
− | |||
− | function p.type( Type ) |
||
− | if Type == 'objet actif' then |
||
− | return '[[Objets#Objets Actifs|Objet Actif]]' |
||
− | elseif Type == 'objet passif' then |
||
− | return '[[Objets#Objets Passifs|Objet Passif]]' |
||
− | elseif Type == 'babiole' then |
||
− | return '[[Babioles|Babiole]]' |
||
− | elseif Type == 'carte' then |
||
− | return '[[Cartes et Runes#Cartes|Carte]]' |
||
− | elseif Type == 'carte spéciale' then |
||
− | return '[[Cartes et Runes#Cartes Spéciales|Carte Spéciale]]' |
||
− | elseif Type == 'rune' then |
||
− | return '[[Cartes et Runes#Runes|Rune]]' |
||
− | elseif Type == 'consommable' then |
||
− | return '[[Cartes et Runes#Autres|Consommable]]' |
||
− | else |
||
− | return Type |
||
− | end |
||
− | end |
||
− | |||
− | --[[ FONCTION CITATION ]] |
||
function p.citation( citation, italique ) |
function p.citation( citation, italique ) |
||
Ligne 1 411 : | Ligne 124 : | ||
phrase[2] = mw.text.trim( phrase[2], 'vf%(' ) |
phrase[2] = mw.text.trim( phrase[2], 'vf%(' ) |
||
phrase[2] = mw.text.trim( phrase[2], '%)' ) |
phrase[2] = mw.text.trim( phrase[2], '%)' ) |
||
+ | if italique then |
||
− | _c = "[[Fichier:Drapeau_EN.png|18px|lien=|Texte original]] ''\"" .. phrase[1] .. "\"''<br/>[[Fichier:Drapeau_FR.png|18px|lien=|Traduction française]] ''\"" .. phrase[2] .. "\"''" |
||
+ | _c = "[[Fichier:Drapeau_EN.png|18px|lien=|Texte original]] ''\"" .. phrase[1] .. "\"''<br/>[[Fichier:Drapeau_FR.png|18px|lien=|Traduction française]] ''\"" .. phrase[2] .. "\"''" |
||
+ | else |
||
+ | _c = '[[Fichier:Drapeau_EN.png|18px|lien=|Texte original]] "' .. phrase[1] .. '"<br/>[[Fichier:Drapeau_FR.png|18px|lien=|Traduction française]] "' .. phrase[2] .. '"' |
||
+ | end |
||
else |
else |
||
phrase = mw.text.trim( citation, 'vo%(' ) |
phrase = mw.text.trim( citation, 'vo%(' ) |
||
phrase = mw.text.trim( citation, '%)' ) |
phrase = mw.text.trim( citation, '%)' ) |
||
+ | if italique then |
||
− | _c = "''\"" .. phrase .. "\"''" |
||
+ | _c = "''\"" .. phrase .. "\"''" |
||
+ | else |
||
+ | _c = '"' .. phrase .. '"' |
||
+ | end |
||
end |
end |
||
Ligne 1 421 : | Ligne 142 : | ||
end |
end |
||
− | --[[ FONCTION RECHARGE ]] |
||
function p.recharge( recharge, mode ) |
function p.recharge( recharge, mode ) |
||
Ligne 1 429 : | Ligne 149 : | ||
if mode == 1 then |
if mode == 1 then |
||
− | + | imgParam = '|15px|lien=' |
|
else |
else |
||
− | + | imgParam = '|6px|lien=' |
|
end |
end |
||
if args[1] == '1' then |
if args[1] == '1' then |
||
Ligne 1 454 : | Ligne 174 : | ||
if mode == 1 then |
if mode == 1 then |
||
− | + | return _i |
|
else |
else |
||
+ | return _i .. ' ' .. ( args[1] == 'utilisation unique' and 'Utilisation unique' or args[1] == 'infinie' and 'Infinie' or string.find( args[1], 's' ) and mw.text.trim( args[1], 's' ) .. ' secondes' or args[1] ) |
||
− | return _i .. ' ' .. recharge |
||
end |
end |
||
end |
end |
||
− | --[[ FONCTION LISTE ]] |
||
− | |||
− | function p.liste( liste ) |
||
− | local args = mw.text.split( liste, ',%s' ) |
||
− | |||
− | return modIcone.liste( args, 'm' ) |
||
− | end |
||
− | |||
− | --[[ FONCTIONS GRILLE COLLECTION ]] |
||
function p.grilleCollection( grille, maxColonne, maxLigne, texte ) |
function p.grilleCollection( grille, maxColonne, maxLigne, texte ) |
||
Ligne 1 481 : | Ligne 192 : | ||
end |
end |
||
− | _g = '\n |
+ | _g = '\n<table class="wikitable" style="margin:1em auto 1em auto; line-height:0">' |
for i=1, maxLigne, 1 do |
for i=1, maxLigne, 1 do |
||
if ligne == i then |
if ligne == i then |
||
− | _g = _g .. ' |
+ | _g = _g .. '<tr style="background-color:#CCC">' |
else |
else |
||
− | _g = _g .. ' |
+ | _g = _g .. '<tr>' |
end |
end |
||
for j=1, maxColonne, 1 do |
for j=1, maxColonne, 1 do |
||
if colonne == j and ligne == i then |
if colonne == j and ligne == i then |
||
− | _g = _g .. ' |
+ | _g = _g .. '<td style="background-color:#888"></td>' |
elseif colonne == j then |
elseif colonne == j then |
||
− | _g = _g .. ' |
+ | _g = _g .. '<td style="background-color:#CCC"></td>' |
else |
else |
||
− | _g = _g .. ' |
+ | _g = _g .. '<td></td>' |
end |
end |
||
end |
end |
||
+ | _g = _g .. '</tr>' |
||
end |
end |
||
− | _g = _g .. ' |
+ | _g = _g .. '</table>' |
return _t .. _g |
return _t .. _g |
||
end |
end |
||
− | |||
− | --[[ FONCTIONS GENERALES : FIN ]] |
||
return p |
return p |
Dernière version du 25 novembre 2017 à 21:23
Fonction
| |
---|---|
Cette fonction met en place la structure d'un module fiche. | |
Arguments | Renvois |
|
|
Fonction
| |
---|---|
Cette fonction gère l'affichage du titre d'une fiche. | |
Arguments | Renvois |
|
|
La documentation ci-haut est transcluse de Module:Fiche/doc. (modifier | historique)
local p = {}
local Tableau
local modElements = require( 'Module:Elements' )
local police = require( 'Module:Police' )
function p.mode( f, listeModes )
local moduleFiche = require( f:getTitle() )
local args = moduleFiche.args( f )
local disp = mw.text.split( args.disp, '-')
local page = modElements.page( args.nom )
local modes = {}
for index, objet in pairs( args ) do
if objet == '' then
args[index] = nil
end
end
if not page.valeur.dlc then
page.valeur.dlc = ''
end
if disp[2] == 'dlc' then
page.valeur.dlc = args.dlc
elseif disp[2] == 'nodlc' then
page.valeur.dlc = 'Booster Pack 10'
end
if listeModes then
local tableauModes = mw.text.split( listeModes, '%s/%s' )
local i = 1
repeat
modes[tableauModes[i]] = true
i = i + 1
until not tableauModes[i]
end
if args.temp == args.nom or args.temp == '{{{1}}}' then
if args.disp == '{{{2}}}' then
return moduleFiche.fiche( args, page )
elseif disp[1] == 'case' and modes.case then
return moduleFiche.case( args, page )
elseif disp[1] == 'nom' and modes.nom then
return moduleFiche.nom( args, page )
elseif disp[1] == 'tableau' and modes.tableau then
if disp[2] == 'simple' and modes.tableauSimple or disp[3] == 'simple' and modes.tableauSimple then
return moduleFiche.tableauSimple( args, page )
else
return moduleFiche.tableau( args, page )
end
elseif disp[1] == 'phraseIntro' and modes.phraseIntro then
return moduleFiche.intro( args )
else
return "''Mode d'affichage inconnu <sup>[<nowiki/>[" .. args.nom .. "]<nowiki/>]</sup>'' [[Catégorie:Mode de fiche inconnu]]"
end
end
end
function p.nom( nom, remplaceNom, mode )
local nomFinal = remplaceNom or nom
if remplaceNom ~= nil and remplaceNom ~= '' then
nomFinal = remplaceNom
end
if mode == 1 then
return nom .. '|' .. nomFinal
elseif mode == 2 then
return '[[' .. nom .. '|' .. nomFinal .. ']]'
elseif mode == 3 then
return nomFinal
else
return police.titre( 'TeamMeat', nomFinal, 2 )
end
end
function p.image( nom, remplaceNom, remplaceImage, _t, lien, _sD, _sF, _e )
local n = 1
local _i = nom
local _l = ''
local autres = false
_e = _e or '.png'
if remplaceImage ~= nil and remplaceImage ~= '' then
local image = mw.text.split( remplaceImage, '%s' )
if image[1] then
repeat
if image[n]:reverse():find( '%.', image[n]:len()-2 ) then
_e = image[n]
elseif image[n]:find( 'px', image[n]:len()-3 ) or image[n]:find( '%%', image[n]:len()-2 ) then
_t = image[n]
elseif not autres then
_i = image[n]
autres = true
else
_c = '[[Catégorie:Paramètres d\'image inconnus]]'
end
n = n + 1
until not image[n]
end
end
if lien then
_l = p.nom( nom, remplaceNom, 1 )
else
_l = ''
end
return '[[Image:' .. _sD .. _i .. _sF .. _e .. '|' .. _t .. '|lien=' .. _l .. ']]'
end
function p.citation( citation, italique )
local phrase
local _c = ''
if citation:find( 'vf' ) then
phrase = mw.text.split( citation, '%)%s' )
phrase[1] = mw.text.trim( phrase[1], 'vo%(' )
phrase[2] = mw.text.trim( phrase[2], 'vf%(' )
phrase[2] = mw.text.trim( phrase[2], '%)' )
if italique then
_c = "[[Fichier:Drapeau_EN.png|18px|lien=|Texte original]] ''\"" .. phrase[1] .. "\"''<br/>[[Fichier:Drapeau_FR.png|18px|lien=|Traduction française]] ''\"" .. phrase[2] .. "\"''"
else
_c = '[[Fichier:Drapeau_EN.png|18px|lien=|Texte original]] "' .. phrase[1] .. '"<br/>[[Fichier:Drapeau_FR.png|18px|lien=|Traduction française]] "' .. phrase[2] .. '"'
end
else
phrase = mw.text.trim( citation, 'vo%(' )
phrase = mw.text.trim( citation, '%)' )
if italique then
_c = "''\"" .. phrase .. "\"''"
else
_c = '"' .. phrase .. '"'
end
end
return _c
end
function p.recharge( recharge, mode )
local args = mw.text.split( recharge, ',%s' )
local _i = ''
local imgParam
if mode == 1 then
imgParam = '|15px|lien='
else
imgParam = '|6px|lien='
end
if args[1] == '1' then
_i = '[[Image:Recharge_1.png' .. imgParam .. '|Recharge à 1 cran]]'
elseif args[1] == '2' then
_i = '[[Image:Recharge_2.png' .. imgParam .. '|Recharge à 2 crans]]'
elseif args[1] == '3' then
_i = '[[Image:Recharge_3.png' .. imgParam .. '|Recharge à 3 crans]]'
elseif args[1] == '4' then
_i = '[[Image:Recharge_4.png' .. imgParam .. '|Recharge à 4 crans]]'
elseif args[1] == '6' then
_i = '[[Image:Recharge_6.png' .. imgParam .. '|Recharge à 6 crans]]'
elseif args[1] == '12' then
_i = '[[Image:Recharge_12.png' .. imgParam .. '|Recharge à 12 crans]]'
elseif args[1] == 'utilisation unique' then
_i = '[[Image:Recharge_one_time.png' .. imgParam .. '|Utilisation unique]]'
elseif args[1] == 'infinie' then
_i = '[[Image:Recharge_unlimited.png' .. imgParam .. '|Infinie]]'
elseif string.find( args[1], 's' ) then
_i = '[[Image:Recharge_time.png' .. imgParam .. '|Recharge en ' .. mw.text.trim( args[1], 's' ) .. ' secondes]]'
end
if mode == 1 then
return _i
else
return _i .. ' ' .. ( args[1] == 'utilisation unique' and 'Utilisation unique' or args[1] == 'infinie' and 'Infinie' or string.find( args[1], 's' ) and mw.text.trim( args[1], 's' ) .. ' secondes' or args[1] )
end
end
function p.grilleCollection( grille, maxColonne, maxLigne, texte )
local args = mw.text.split( grille, '%s' )
local colonne = tonumber( args[2] )
local ligne = tonumber( args[3] )
local _t = ''
local _g = ''
if texte then
_t = '(page ' .. args[1] .. ', colonne ' .. args[2] .. ', ligne ' .. args[3] .. ')'
end
_g = '\n<table class="wikitable" style="margin:1em auto 1em auto; line-height:0">'
for i=1, maxLigne, 1 do
if ligne == i then
_g = _g .. '<tr style="background-color:#CCC">'
else
_g = _g .. '<tr>'
end
for j=1, maxColonne, 1 do
if colonne == j and ligne == i then
_g = _g .. '<td style="background-color:#888"></td>'
elseif colonne == j then
_g = _g .. '<td style="background-color:#CCC"></td>'
else
_g = _g .. '<td></td>'
end
end
_g = _g .. '</tr>'
end
_g = _g .. '</table>'
return _t .. _g
end
return p