Minecraft Wiki
Advertisement

Este módulo implementa {{uso de criação de estandarte}}.

Dependências

[ver | editar | histórico | purgar]A documentação acima é transcluída de Módulo:Banner crafting usage/doc.
local p = {}
p.crafting = function( f )
	local args = f:getParent().args
	local crafting = require( [[Módulo:Crafting]] ).table
	
	local dye = args[1] or mw.title.getCurrentTitle().text
	local dyeColours = {
		['Bolsa de Tinta'] = 'Preto',
		['Vermelho da Rosa'] = 'Vermelho',
		['Verde do Cacto'] = 'Verde',
		['Sementes de Cacau'] = 'Marrom',
		['Lápis-Lazúli'] = 'Azul',
		['Amarelo do Dente-de-Leão'] = 'Amarelo',
		['Farinha de Osso'] = 'Branco'
	}
	local colour = dyeColours[dye] or dye:match( '^(.+) Corante$' )
	local banner = 'Estandarte'
	if dye == 'Farinha de Osso' then
		banner = '[Estandarte]Estandarte Cinza Claro'
	end
	
	local dyeOrder = {
		'Faixa na Base', 'Faixa no Chefe', 'Pala Dextra', 'Pala Sinistra', 'Pala', 'Faixa', 'Banda', 'Banda Sinistra', 'Palado', 'Aspa',
		'Cruz', 'Talhado', 'Fendido', 'Fendido Invertido', 'Talhado Invertido', 'Partido',
		'Partido Invertido', 'Cortado', 'Cortado Invertido', 'Cantão na Base Dextra', 'Cantão na Base Sinistra',
		'Cantão no Chefe Dextro', 'Cantão no Chefe Sinistro', 'Asna', 'Asna Invertida', 'Dentado na Base', 'Dentado no Chefe', 'Besante', 'Losango',
		'Borda', 'Gradiente', 'Gradiente na Base'
	}
	local otherOrder = { 'Borda Dentada', 'Campo em Alvenaria', 'Figura de Creeper', 'Figura de Crânio', 'Figura de Flor', 'Coisa' }
	
	-- 0 = empty, 1 = banner, 2 = dye
	local dyeRecipes = {
		['Faixa na Base'] = {
			0, 0, 0,
			0, 1, 0,
			2, 2, 2,
		},
		['Faixa no Chefe'] = {
			2, 2, 2,
			0, 0, 0,
			0, 1, 0,
		},
		['Pala Dextra'] = {
			2, 0, 0,
			2, 0, 0,
			2, 1, 0,
		},
		['Pala Sinistra'] = {
			0, 0, 2,
			0, 0, 2,
			0, 1, 2,
		},
		['Pala'] = {
			0, 2, 0,
			0, 2, 1,
			0, 2, 0,
		},
		['Faixa'] = {
			0, 0, 0,
			2, 2, 2,
			0, 1, 0,
		},
		['Banda'] = {
			2, 0, 0,
			0, 2, 0,
			0, 1, 2,
		},
		['Banda Sinistra'] = {
			0, 0, 2,
			0, 2, 0,
			2, 1, 0,
		},
		['Palado'] = {
			2, 0, 2,
			2, 0, 2,
			0, 1, 0,
		},
		['Aspa'] = {
			2, 0, 2,
			0, 2, 0,
			2, 1, 2,
		},
		['Cruz'] = {
			0, 2, 0,
			2, 2, 2,
			1, 2, 0,
		},
		['Talhado'] = {
			2, 2, 0,
			2, 0, 0,
			0, 1, 0,
		},
		['Fendido'] = {
			0, 2, 2,
			0, 0, 2,
			0, 1, 0,
		},
		['Fendido Invertido'] = {
			0, 1, 0,
			2, 0, 0,
			2, 2, 0,
		},
		['Talhado Invertido'] = {
			0, 1, 0,
			0, 0, 2,
			0, 2, 2,
		},
		['Partido'] = {
			2, 2, 0,
			2, 2, 1,
			2, 2, 0,
		},
		['Partido Invertido'] = {
			0, 2, 2,
			1, 2, 2,
			0, 2, 2,
		},
		['Cortado'] = {
			2, 2, 2,
			2, 2, 2,
			0, 1, 0,
		},
		['Cortado Invertido'] = {
			0, 1, 0,
			2, 2, 2,
			2, 2, 2,
		},
		['Cantão na Base Dextra'] = {
			0, 0, 0,
			0, 0, 0,
			2, 1, 0,
		},
		['Cantão na Base Sinistra'] = {
			0, 0, 0,
			0, 0, 0,
			0, 1, 2,
		},
		['Cantão no Chefe Dextro'] = {
			2, 0, 0,
			0, 0, 0,
			0, 1, 0,
		},
		['Cantão no Chefe Sinistro'] = {
			0, 0, 2,
			0, 0, 0,
			0, 1, 0,
		},
		['Asna'] = {
			0, 0, 0,
			0, 2, 0,
			2, 1, 2,
		},
		['Asna Invertida'] = {
			2, 0, 2,
			0, 2, 0,
			0, 1, 0,
		},
		['Dentado na Base'] = {
			0, 0, 0,
			2, 1, 2,
			0, 2, 0,
		},
		['Dentado no Chefe'] = {
			0, 2, 0,
			2, 0, 2,
			0, 1, 0,
		},
		['Besante'] = {
			0, 0, 0,
			0, 2, 0,
			0, 1, 0,
		},
		['Losango'] = {
			0, 2, 0,
			2, 1, 2,
			0, 2, 0,
		},
		['Borda'] = {
			2, 2, 2,
			2, 1, 2,
			2, 2, 2,
		},
		['Gradiente'] = {
			2, 1, 2,
			0, 2, 0,
			0, 2, 0,
		},
		['Gradiente na Base'] = {
			0, 2, 0,
			0, 2, 0,
			2, 1, 2,
		},
	}
	local items = {
		['Borda Dentada'] = 'Vinhas',
		['Campo em Alvenaria'] = 'Tijolos',
		['Figura de Creeper'] = 'Cabeça de Creeper',
		['Figura de Crânio'] = 'Crânio de Esqueleto Wither',
		['Figura de Flor'] = 'Margarida',
		['Coisa'] = 'Maçã Dourada Encantada',
	}
	
	local shapedArgs = {
		'A1', 'B1', 'C1',
		'A2', 'B2', 'C2',
		'A3', 'B3', 'C3',
	}
	local dyeArgs = {
		head = '1',
		ignoreusage = '1',
		showdescription = args.description,
		name = '[[Estandarte]] pattern ' .. colour,
		ingredients = '[[' .. dye .. ']] +<br>[[Estandarte]]',
	}
	for i = 1, 9 do
		local dyeArg = {}
		for _, pattern in ipairs( dyeOrder ) do
			local iType = dyeRecipes[pattern][i]
			local ingredient = ''
			if iType == 1 then
				ingredient = banner
			elseif iType == 2 then
				ingredient = dye
			end
			table.insert( dyeArg, ingredient )
		end
		dyeArgs[shapedArgs[i]] = table.concat( dyeArg, ';' )
	end
	local dyeOutputArg = {}
	for _, pattern in ipairs( dyeOrder ) do
		table.insert( dyeOutputArg, 'Estandarte ' .. pattern .. ' ' .. colour )
	end
	dyeArgs.Output = table.concat( dyeOutputArg, ';' )
	dyeArgs.Olink = 'Estandarte'
	dyeArgs.fixed = '1'
	dyeArgs.notfixed = 'o estandarte'
	
	local otherArgs = {}
	otherArgs.ignoreusage = '1'
	otherArgs.name = 'Imagem do [[Estandarte]] ' .. colour
	otherArgs.ingredients = '[[' .. dye .. ']] +<br>[[Estandarte]] +<br>[[Vinhas]] ou<br>[[Tijolos]] ou<br>[[Cabeça de Creeper]] ou<br>[[Crânio de Esqueleto Wither]] ou<br>[[Margarida]] ou<br>[[Maçã Dourada Encantada]]'
	local otherItemArg = {}
	local otherOutputArg = {}
	for _, pattern in ipairs( otherOrder ) do
		table.insert( otherItemArg, items[pattern] )
		table.insert( otherOutputArg, 'Estandarte ' .. pattern .. ' ' .. colour )
	end
	otherArgs[1] = table.concat( otherItemArg, ';' )
	otherArgs[2] = dye
	otherArgs[3] = banner
	otherArgs.Output = table.concat( otherOutputArg, ';' )
	otherArgs.Olink = 'Estandarte'
	if not args.continue then
		otherArgs.foot = '1'
	end
	
	return crafting( dyeArgs ) .. crafting( otherArgs )
end
return p
Advertisement