Module:Description/formesSpéciales

De Poképédia
Révision datée du 30 janvier 2023 à 14:59 par Matt. (discussion | contributions) (Cas spécial pour son apparition dans Café ReMix)

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 switch_special = {
		["025"] = 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"
					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,
		["133"] = 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,
		["150"] = function()	-- Mewtwo
				if has_form
				then if form == "Armure"
					then special_form_name = " en"
						return
					end
				end
			end,
		["172"] = 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,
		["201"] = function()	-- Zarbi
				if has_form
				then special_form_name = ""
					name_category = name_category .. " " .. form
				end
			end,
		["483"] = 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,
		["484"] = function()	-- Palkia
				if has_form
				then if form == "Originelle"
					then special_form_name = " Originel"
						info_indix_beginning = info_indix_end + 1
					end
				end
			end,
		["555"] = function()	-- Darumacho
				if not has_form then form = "Normal" end
				special_form_name = " Mode " .. form
				info_indix_beginning = info_indix_beginning + 1
			end,
		["646"] = function()	-- Kyurem
				if has_form
				then name = name .. " " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["647"] = function()	-- Keldeo
				if not has_form then form = "Normal" end
				special_form_name = " Aspect " .. form
				info_indix_beginning = info_indix_end + 1
			end,
		["649"] = 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,
		["670"] = function()	-- Floette
				if form ~= "Éternelle"
				then special_form_name = " Fleur"
				end
			end,
		["676"] = function()	-- Couafarel
				if has_form and form ~= "Sauvage"
				then special_form_name = " Coupe"
				end
			end,
		["773"] = 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,
		["774"] = 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,
		["800"] = 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,
		["869"] = function()	-- Charmilly
				if has_form
				then special_form_name = " dans sa forme"
					special_form_as_name_suffix = false
				end
			end,
		["890"] = function()	-- Éthernatos
				if has_form
				then name = name .. " " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["898"] = function()	-- Sylveroy
				if has_form
				then name = name .. ", le " .. form
					name_category = name
					info_indix_beginning = info_indix_end + 1
				end
			end,
		["966"] = 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
	}
	
	local f = switch_special[ndex]
	if f
	then f()
	end
	
	return {
		["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