Module:Description/formesSpéciales

De Poképédia
Aller à la navigation Aller à la recherche

Ce module est un sous-module du Module:Description, qui permet de gérer l'affichage du nom des formes de Pokémon.

Certains jeux possèdent des formes spéciales qui leur sont propres :


return function(ndex, name, form, special_form_name, info_indix_beginning, info_indix_end, game)
	
	if game == "GO"
	then local switch_go = require("Module:Description/formesSpéciales/Pokémon GO")
		local t = switch_go(ndex, name, form, special_form_name, info_indix_beginning, info_indix_end)
		
		if t.has_found_special_form
		then return t
		end
	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_special = {
		["0025"] = function()	-- Pikachu
				if has_form
				then if form == "Cosplayeur" or form == "Rockeur" or form == "Lady"
						or form == "Star" or form == "Docteur" or form == "Catcheur"
						or form == "Partenaire"
					then name_category = name
						name = name .. " " .. form
						info_indix_beginning = info_indix_end + 1
						return
					end
					
					local form_words = mw.text.split(form, " ")
					local form_first_word = form_words[1]
					
					if form_first_word == "Casquette" and form ~= "Casquette de détective"
					then special_form_name = ""
						name_category = name
						name = name .. " à Casquette"
						info_indix_beginning = info_indix_beginning + 1
						return
					end
					
					if form_first_word == "Sweets"
					then special_form_name = " (« " .. form .. " »)"
						info_indix_beginning = info_indix_end + 1
						special_form_as_name_suffix = false
						return
					end
					
					if form_first_word == "Volant" or form_first_word == "Surfeur"
					then name = name .. " " .. form_first_word
						name_category = name
						info_indix_beginning = info_indix_beginning + 1
						special_form_as_name_suffix = false
					end
				end
			end,
		["0133"] = function()	-- Évoli
				if has_form
				then if form == "Partenaire"
					then name_category = name
						name = name .. " " .. form
						info_indix_beginning = info_indix_end + 1
						return
					end
					
					if form == "Sweets"
					then special_form_name = " (« " .. form .. " »)"
						info_indix_beginning = info_indix_end + 1
						special_form_as_name_suffix = false
						return
					end
				end
			end,
		["0150"] = function()	-- Mewtwo
				if has_form
				then if form == "Armure"
					then special_form_name = " en"
						return
					end
				end
			end,
		["0172"] = function()	-- Pichu
				if has_form
				then if form == "Troizépi"
					then name_category = name
						name = name .. " " .. form
						info_indix_beginning = info_indix_end + 1
						return
					end
				end
			end,
		["0201"] = function()	-- Zarbi
				if has_form
				then special_form_name = ""
					name_category = name_category .. " " .. form
				end
			end,
		["0483"] = function()	-- Dialga
				if has_form
				then if form == "Originelle"
					then special_form_name = " Originel"
						info_indix_beginning = info_indix_end + 1
					elseif form == "Primal"
						then name_category = name
						name = name .. " " .. form
						info_indix_beginning = info_indix_end + 1
						return
					end
				end
			end,
		["0484"] = function()	-- Palkia
				if has_form
				then if form == "Originelle"
					then special_form_name = " Originel"
						info_indix_beginning = info_indix_end + 1
					end
				end
			end,
		["0492"] = function()	-- Shaymin
				if has_form
				then special_form_name = " dans sa [[forme]]"
					special_form_as_name_suffix = false
				end
			end,
		["0555"] = function()	-- Darumacho
				if not has_form then form = "Normal" end
				special_form_name = " Mode " .. form
				info_indix_beginning = info_indix_beginning + 1
			end,
		["0646"] = function()	-- Kyurem
				if has_form
				then name = name .. " " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["0647"] = function()	-- Keldeo
				if not has_form then form = "Normal" end
				special_form_name = " Aspect " .. form
				info_indix_beginning = info_indix_end + 1
			end,
		["0649"] = function()	-- Genesect
				if has_form
				then special_form_name = " avec son [[Module " .. form .. "]]"
					info_indix_beginning = info_indix_end + 1
					special_form_as_name_suffix = false
				end
			end,
		["0670"] = function()	-- Floette
				if form ~= "Éternelle"
				then special_form_name = " Fleur"
				end
			end,
		["0676"] = function()	-- Couafarel
				if has_form and form ~= "Sauvage"
				then special_form_name = " Coupe"
				end
			end,
		["0773"] = function()	-- Silvallié
				if not has_form then form = "Normal" end
				special_form_name = " dans sa [[forme]] Type : " .. form
				special_form_as_name_suffix = false
				info_indix_beginning = info_indix_beginning + 1
			end,
		["0774"] = function()	-- Météno
				if has_form
				then if form ~= "Météore"
					then special_form_name = " dans sa [[forme]] Noyau"
					end
				else special_form_name = " dans sa [[forme]] Météore"
				end
				special_form_as_name_suffix = false
			end,
		["0800"] = function()	-- Necrozma
				if has_form
				then if form == "Ultra"
					then name = "Ultra-" .. name
						info_indix_beginning = info_indix_beginning + 1
					else name = name .. " " .. form
						info_indix_beginning = info_indix_end + 1
					end
					name_category = name
				end
			end,
		["0869"] = function()	-- Charmilly
				if has_form
				then special_form_name = " dans sa [[forme]]"
					special_form_as_name_suffix = false
				end
			end,
		["0890"] = function()	-- Éthernatos
				if has_form
				then name = name .. " " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["0898"] = function()	-- Sylveroy
				if has_form
				then name = name .. ", le " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["0901"] = function()	-- Ursaking
				if has_form
				then special_form_name = ", « " .. form .. " »"
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["0966"] = function()	-- Vrombotor
				if has_form
				then special_form_name = " en tant que Starmobile"
					special_form_as_name_suffix = false
				end
			end,
		["1007"] = function()	-- Koraidon
				if has_form
				then local de = ""
					if form == "Course" or form == "Nage"
					then de = "de "
					end
					
					special_form_name = " dans sa [[forme]] " .. de .. form
					special_form_as_name_suffix = false
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["1017"] = function()	-- Ogerpon
				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]
					
					if form_second_word
					then form_between_commas = form_second_word
					end
					
					special_form_name = " au [[Masque "
					if form_first_word == "Puits" or form_first_word == "Fourneau"
						then special_form_name = special_form_name .. "du "
					elseif form_first_word == "Pierre"
						then special_form_name = special_form_name .. "de la "
					end
					special_form_name = special_form_name .. form_first_word .. "]]"
					special_form_as_name_suffix = false
					info_indix_beginning = info_indix_end + 1
				end
			end
	}
	
	local f = switch_special[ndex]
	if f
	then f()
	end
	
	return {
		["form_between_commas"] = form_between_commas,
		["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