Module:Description/formesSpéciales/Pokémon Café ReMix
Apparence
Ce module est un sous-module du Module:Description, qui permet de gérer l'affichage du nom des formes et costumes de Pokémon spécifiques à Pokémon Café ReMix.
return function(ndex, name, form, special_form_name, info_indix_beginning, info_indix_end)
local has_form = info_indix_beginning <= info_indix_end
local name_prefix = ""
local name_suffix = ""
local special_form_as_name_suffix = true
local name_category = name
local form_between_commas = ""
local switch_cm = {
["0492"] = function() -- Shaymin
if has_form
then local form_first_word = mw.text.split(form, " ")[1]
local form_rest = form:gsub(form_first_word .. " ", "")
if form_rest == form then form_rest = "" end
special_form_name = ""
if form_first_word == "Terrestre" or form_first_word == "Céleste"
then special_form_name = " dans sa [[forme]] " .. form_first_word
else form_rest = form
end
if form_rest ~= ""
then special_form_name = " (" .. form_rest .. ")" .. special_form_name
end
info_indix_beginning = info_indix_end + 1
special_form_as_name_suffix = false
return true
end
end,
["0778"] = function() -- Mimiqui
if has_form
then local form_first_word = mw.text.split(form, " ")[1]
local form_rest = form:gsub(form_first_word .. " ", "")
if form_rest == form then form_rest = "" end
special_form_name = ""
if form_first_word == "Déguisée" or form_first_word == "Démasquée"
then special_form_name = " dans sa [[forme]] " .. form_first_word
else form_rest = form
end
if form_rest ~= ""
then special_form_name = " (" .. form_rest .. ")" .. special_form_name
end
info_indix_beginning = info_indix_end + 1
special_form_as_name_suffix = false
return true
end
end,
["0869"] = function() -- Charmilly
if has_form
then local form_words = mw.text.split(form, " ")
local form_first_word = form_words[1]
local form_second_word = form_words[2]
local form_beginning = ""
local form_rest = ""
if form_first_word and form_second_word
then form_beginning = form_first_word .. " " .. form_second_word
form_rest = form:gsub(form_beginning .. " ", "")
end
if form_rest == form then form_rest = "" end
special_form_name = ""
if form_beginning == "Lait Vanille" or form_beginning == "Lait Ruby" or form_beginning == "Lait Matcha"
or form_beginning == "Lait Menthe" or form_beginning == "Lait Citron" or form_beginning == "Lait Salé"
or form_beginning == "Mélange Ruby" or form_beginning == "Mélange Caramel" or form_beginning == "Mélange Tricolore"
then special_form_name = " dans sa [[forme]] " .. form_beginning
end
if form_rest ~= ""
then special_form_name = " (" .. form_rest .. ")" .. special_form_name
end
info_indix_beginning = info_indix_end + 1
special_form_as_name_suffix = false
return true
end
end,
["0978"] = function() -- Nigirigon
if has_form
then local form_first_word = mw.text.split(form, " ")[1]
local form_rest = form:gsub(form_first_word .. " ", "")
if form_rest == form then form_rest = "" end
special_form_name = ""
if form_first_word == "Courbée" or form_first_word == "Affalée" or form_first_word == "Raide"
then special_form_name = " dans sa [[forme]] " .. form_first_word
else form_rest = form
end
if form_rest ~= ""
then special_form_name = " (" .. form_rest .. ")" .. special_form_name
end
info_indix_beginning = info_indix_end + 1
special_form_as_name_suffix = false
return true
end
end,
["0999"] = function() -- Mordudor
if has_form
then local form_first_word = mw.text.split(form, " ")[1]
local form_rest = form:gsub(form_first_word .. " ", "")
if form_rest == form then form_rest = "" end
special_form_name = ""
if form_first_word == "Coffre" or form_first_word == "Marche"
then special_form_name = " dans sa [[forme]] " .. form_first_word
else form_rest = form
end
if form_rest ~= ""
then special_form_name = " (" .. form_rest .. ")" .. special_form_name
end
info_indix_beginning = info_indix_end + 1
special_form_as_name_suffix = false
return true
end
end,
}
local has_found_special_form = false
local f = switch_cm[ndex]
if f
then has_found_special_form = f() -- f() has border effects
has_found_special_form = has_found_special_form == true
end
return {
["form_between_commas"] = form_between_commas,
["has_found_special_form"] = has_found_special_form,
["info_indix_beginning"] = info_indix_beginning,
["info_indix_end"] = info_indix_end,
["name"] = name,
["name_category"] = name_category,
["name_prefix"] = name_prefix,
["name_suffix"] = name_suffix,
["special_form_name"] = special_form_name,
["special_form_as_name_suffix"] = special_form_as_name_suffix
}
end