Изменения

Модуль:Варка

1453 байта добавлено, 14:25, 24 октября 2018
м
Удаление ссылок на ванильные предметы и блоки
local name = ''
local description = ''
local effect = '' local duration = '' if args["название"] or args["показатьимя"] == '1' or multirow and args["показатьимя"] ~= '0' then name = 'Name Название !! '
f:callParserFunction( '#dplvar:set', 'brewingname', '1' )
end
if args["показатьописание"] == '1' then
description = ' !! class="unsortable" | DescriptionОписание'
f:callParserFunction( '#dplvar:set', 'brewingdescription', '1' )
end
if args["эффект"] then
effect = ' !! class="unsortable" | Эффект'
f:callParserFunction( '#dplvar:set', 'brewingeffect', '1' )
end
if args["продолжительность"] then
duration = ' !! class="unsortable" | Продолжительность<br />(минуты : секунды)'
f:callParserFunction( '#dplvar:set', 'brewingduration', '1' )
end
local class = args["класс"] or ''
end
header = table.concat( {
' {| class="wikitable ' .. class .. '" style="text-align:center" data-description="Рецепты Схема варки"', '! ' .. name .. 'Ингридиенты width="150" | Ингредиенты !! ' .. recipeClass .. ' Рецепты [[Зельеварение|Схема варки]]' .. effect .. duration .. description,
'|-'
}, '\n' )
end
-- Name cellЯчейка с названием
local nameCell
if args.name ["название"] or '' ~= '' then
nameCell = args["название"]
elseif multirow or f:callParserFunction( '#dplvar', 'brewingname' ) == '1' then
local link = ''
if parts.mod then
link = '[[' .. parts.mod .. '/' .. parts.name .. '|'.. parts.name .. ']]' else link = parts.name
end
if parts.name:find( '^Люб' ) then
table.insert( links, mw.ustring.sub( parts.name, 0, 6 ) .. '[[' .. link .. mw.ustring.sub( parts.name, 6 ) .. ']]' )
else
table.insert( links, '[[' .. link .. parts.name .. ']]' )
end
names[( parts.mod or '' ) .. parts.name] = 1
if nameCell and args["запланированное"] then
nameCell = nameCell .. '<br>([[' .. args["запланированное"] .. ']])'
end
-- Ячейка с ингредиентами
local ingredientsCell
if args["ингредиенты"] or '' ~= '' and fuelslot ~= '' then ingredientsCell = args["ингредиенты"] .. ' +<br>Огненный порошок (топливо)' elseif args["ингредиенты"] or '' ~= '' then
ingredientsCell = args["ингредиенты"]
else
end
if parts.mod then link = '[[' .. parts.mod .. '/' .. parts.name .. '|'.. parts.name .. ']]' else link = parts.name end if parts.name:find( '^Люб' ) then table.insert( ingredientsCell, separator .. mw.ustring.sub( parts.name, 0, 6 ) .. '[[' .. link .. mw.ustring.sub( parts.name, 6 ) .. ']]' ) else table.insert( ingredientsCell, separator .. '[[' .. link .. parts.name .. ']]' ) end
separator = ''
end
end
if fuelslot ~= '' then ingredientsCell = table.concat( ingredientsCell ) .. '&nbsp;+<br>\nОгненный порошок (топливо)' else ingredientsCell = table.concat( ingredientsCell ) end
end
-- Whether to show base or output
local newArgs = {}
if args["показатьосновупоказатьресурс"] == '1' then
newArgs["Выход2"] = base
newArgs["Выход1"] = args["Ресурс2"]
newArgs["В1назв"] = args["В2назв"]
newArgs["В3назв"] = args["В3назв"]
newArgs.fuelslot = fuelslot
-- Ячейка с рецептом
table.insert( row, 1, nameCell )
end
 
-- Ячейка с эффектом
local effectCell = args["эффект"] or ''
if f:callParserFunction( '#dplvar', 'brewingeffect' ) == '1' then
table.insert( row, effectCell )
end
 
-- Ячейка с продолжительностьительностью
local durationCell = args["продолжительность"] or ''
if f:callParserFunction( '#dplvar', 'brewingduration' ) == '1' then
table.insert( row, durationCell )
end
 
local descriptionCell = args["описание"] or ''
if f:callParserFunction( '#dplvar', 'brewingdescription' ) == '1' then
table.insert( row, descriptionCell )
end
 
row = table.concat( row, '\n|' )
if foot ~= '' then
footer = '|}'
f:callParserFunction( '#dplvar:set', 'brewingname', '0', 'brewingeffect', '0', 'brewingduration', '0', 'brewingdescription', '0' )
end
1136
правок