« Module:Abréviation » : différence entre les versions
Aucun résumé des modifications |
Magic |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 14 : | Ligne 14 : | ||
D20 = 'Fallout Pen and Paper d20', | D20 = 'Fallout Pen and Paper d20', | ||
FB = 'Fallout Bible', | FB = 'Fallout Bible', | ||
FM = 'Magic: The Gathering – Fallout', | |||
FBG = 'Fallout : Le jeu de plateau', | FBG = 'Fallout : Le jeu de plateau', | ||
FJP = 'Fallout : Le jeu de plateau', | FJP = 'Fallout : Le jeu de plateau', | ||
Ligne 66 : | Ligne 67 : | ||
FOS = 'Fallout Shelter', | FOS = 'Fallout Shelter', | ||
FOSO = 'Fallout Shelter Online', | FOSO = 'Fallout Shelter Online', | ||
FSBG = 'Fallout Shelter : Le jeu de plateau', | |||
FSJP = 'Fallout Shelter : Le jeu de plateau', | |||
FOT = 'Fallout Tactics', | FOT = 'Fallout Tactics', | ||
FOT2 = 'Fallout Tactics 2', | FOT2 = 'Fallout Tactics 2', | ||
Ligne 79 : | Ligne 82 : | ||
LH = 'Lionheart', | LH = 'Lionheart', | ||
NON = 'uniquement mentionné(e)', | NON = 'uniquement mentionné(e)', | ||
OMCP = 'One Man, and a Crate of Puppets', | |||
TAR = 'The Armageddon Rag', | TAR = 'The Armageddon Rag', | ||
TORN = 'TORN', | TORN = 'TORN', |
Dernière version du 28 mai 2024 à 19:58
La documentation pour ce module peut être créée à Module:Abréviation/doc
local p = {}
local tools = require('Module:Outils')
------------------------------------------------------
------------ Référentiel des jeux Fallout ------------
--- Merci de ne pas dupliquer ces données ailleurs ---
-- Si un nouveau jeu sort (\o/), merci de l'ajouter --
------------------------------------------------------
local abr = {
['2D20'] = 'Fallout 2d20',
AR = 'All Roads',
D20 = 'Fallout Pen and Paper d20',
FB = 'Fallout Bible',
FM = 'Magic: The Gathering – Fallout',
FBG = 'Fallout : Le jeu de plateau',
FJP = 'Fallout : Le jeu de plateau',
FBGNC = 'Fallout: New California',
FJPNC = 'Fallout: New California',
FILM = 'Fallout (film)',
FIXT = 'Fallout FIXT',
FNV = 'Fallout: New Vegas',
FNVCS = 'Courier\'s Stash',
FNVDM = 'Dead Money',
FNVGRA = 'Gun Runners\' Arsenal',
FNVHH = 'Honest Hearts',
FNVLR = 'Lonesome Road',
FNVOWB = 'Old World Blues',
FO = 'Fallout',
FO1 = 'Fallout',
FO2 = 'Fallout 2',
FO3 = 'Fallout 3',
FO3BS = 'Broken Steel',
FO3MZ = 'Mothership Zeta',
FO3OA = 'Operation: Anchorage',
FO3PL = 'Point Lookout',
FO3TP = 'Point Lookout',
FO3TP = 'The Pitt',
FO4 = 'Fallout 4',
FO4AM = 'Automatron',
FO4FH = 'Far Harbor',
FO4NW = 'Nuka-World',
FO4VW = 'Vault-Tec Workshop',
FO4WW = 'Wasteland Workshop',
FO76 = 'Fallout 76',
FO76WA = 'Wild Appalachia',
FO76NW = 'Nuclear Winter',
FO76WL = 'Wastelanders',
FO76LR = 'La Course Légendaire',
FO76OW = 'Terres désolées pour tous',
FO76SD = 'Aube d\'Acier',
FO76LL = 'Paré à tout',
FO76SR = 'Règne d\'Acier',
FO76FW = 'Les mondes changent',
FO76NM = 'Nuit de la Phalène',
FO76IB = 'Les envahisseurs d\'au-delà',
FO76TM = 'De quel métal êtes-vous fait ?',
FO76TP = 'Expéditions : The Pitt',
FO76NT = 'Tournée Nuka-World',
FO76MI = 'L\'invasion mutante',
FO76OB = 'Rendez-vous avec la lune',
FOBOS = 'Fallout: Brotherhood of Steel',
FOBOS2 = 'Fallout: Brotherhood of Steel 2',
FOOL = 'Fallout Online',
FORPG = 'Fallout : Le jeu de rôle officiel',
FOS = 'Fallout Shelter',
FOSO = 'Fallout Shelter Online',
FSBG = 'Fallout Shelter : Le jeu de plateau',
FSJP = 'Fallout Shelter : Le jeu de plateau',
FOT = 'Fallout Tactics',
FOT2 = 'Fallout Tactics 2',
FOTV = 'Fallout (série télévisée)',
FOW = 'Fallout: Warfare',
FOWW = 'Fallout: Wasteland Warfare',
FOFNW = 'Fallout Factions: Nuka World',
FFNW = 'Fallout Factions: Nuka World',
FOX = 'Fallout Extreme',
FS = 'Fallout Shelter',
FSO = 'Fallout Shelter Online',
JES = 'J.E. Sawyer\'s Fallout RPG',
LH = 'Lionheart',
NON = 'uniquement mentionné(e)',
OMCP = 'One Man, and a Crate of Puppets',
TAR = 'The Armageddon Rag',
TORN = 'TORN',
V13 = 'Project V13',
VB = 'Van Buren',
WIKI = 'Les Archives de Vault-Tec:À propos de',
}
------------------------------------------------------
-- Vérifie l'existence d'une abréviation
function p.contains(frame)
local arg = tools.extractArgs(frame)[1] or ''
return abr[arg:upper()] ~= nil
end
-- Retourne le nom d'un jeu
function p.name(frame)
local arg = tools.extractArgs(frame)[1] or ''
return abr[arg:upper()] or ''
end
-- Génère une liste de catégories
function p.categories(frame)
local args = tools.extractArgs(frame)
local categories = ''
local abbs = args[1] or ''
local subject = args[2]
local sortkey = args[3]
if #abbs > 0 then
abbs = mw.text.split(abbs, "%s*,%s*")
end
if #abbs > 0 then
local prefix = ''
if subject then
prefix = subject .. ' de '
end
if sortkey then
sortkey = '|' .. sortkey
else
sortkey = ''
end
for i, abb in ipairs(abbs) do
local gameName = abr[abb:upper()]
if gameName then
categories = categories .. '[[Catégorie:' .. prefix .. gameName .. sortkey .. ']]'
end
end
end
if categories == '' then categories = nil end
return categories
end
-- Génère une liste de lien
function p.links(frame)
local args = tools.extractArgs(frame)
local links = ''
local abbs = args[1] or ''
local link = args['lien'] or args[2]
local subject = args['sujet'] or args[3]
local separator = args['séparateur'] or ', '
if #abbs > 0 then
abbs = mw.text.split(abbs, "%s*,%s*")
end
if #abbs > 0 then
local linkPrefix = ''
if link then
linkPrefix = link .. ' de '
end
local subjectPrefix = ''
if subject then
subjectPrefix = subject .. ' de '
end
for i, abb in ipairs(abbs) do
local gameName = abr[abb:upper()]
if gameName then
if i == 1 then
if abb:upper() == 'NON' then
links = subject .. ' ' .. gameName
else
links = '[['..linkPrefix..gameName..'|'..subjectPrefix..'\'\''..gameName..'\'\']]'
end
else
links = links..separator..'[['..linkPrefix..gameName..'|\'\''..gameName..'\'\']]'
end
end
end
elseif link then
links = '[['..link..'|'..(subject or link)..']]'
elseif subject then
links = subject
end
if links == '' then links = nil end
return links
end
return p