Модуль:BotanyStats
Версия от 19:38, 22 августа 2024; Pok (обсуждение | вклад)
Для документации этого модуля может быть создана страница Модуль:BotanyStats/doc
local p = {}
function p.templateCells(frame)
local anchorName = frame.args.anchorName or "" -- Название якоря
local fruitId = frame.args.fruitId or "" -- ID плода
local plantId = frame.args.plantId or "" -- ID растения
local seedId = frame.args.seedId or "" -- ID семечка
local potency = frame.args.potency or "-" -- Потенция
local yield = frame.args.yield or "-" -- Урожайность
local lifespan = frame.args.lifespan or "-" -- Время жизни
local maturation = frame.args.maturation or "-" -- Созревания
local production = frame.args.production or "-" -- Продуктивность
local growthStages = frame.args.growthStages or "-" -- Стадии роста
local waterConsumption = frame.args.waterConsumption or "-" -- Вода
local nutrientConsumption = frame.args.nutrientConsumption or "-" -- Удобрения
local idealHeat = frame.args.idealHeat or "-" -- Температура
local idealLight = frame.args.idealLight or "-" -- Освещения
local description = frame.args.description or "" -- Описание
local location = frame.args.location or "" -- Местонахождение
local mutation = frame.args.mutation or "" -- Мутации
-- Формирование строк для ячеек таблицы
local out = ""
out = out .. frame:preprocess('!{{Anchor|' .. anchorName .. '}}{{#invoke:Entity Lookup|createimagetooltip|Файл:' .. fruitId .. '.png|' .. fruitId .. '|Мета=64x64px,link=}}<br>{{#invoke:Entity Lookup|getname|' .. fruitId .. '}} \n')
out = out .. frame:preprocess('!{{#invoke:Entity Lookup|createimagetooltip|Файл:' .. plantId .. '.png|' .. plantId .. '|Мета=64x64px,link=}} \n')
out = out .. frame:preprocess('!{{#invoke:Entity Lookup|createimagetooltip|Файл:' .. seedId .. '.png|' .. seedId .. '|Мета=64x64px,link=}} \n')
out = out .. '|style="text-wrap:nowrap;"| \n'
out = out .. frame:preprocess('* {{tooltip|Потенция|Потенция растения, которая влияет на количество химических веществ в растении|color=#e1f6ff}}: ' .. '<b>' .. potency .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Урожайность|Количество продуктов, которые растение дает за один урожай|color=#e1f6ff}}: ' .. '<b>' .. yield .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Время жизни|Продолжительность жизни растения|color=#e1f6ff}}: ' .. '<b>' .. lifespan .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Созревания|Время созревания растения|color=#e1f6ff}}: ' .. '<b>' .. maturation .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Продуктивность|Время, необходимое для производства следующего урожая после созревания|color=#e1f6ff}}: ' .. '<b>' .. production .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Стадии роста|Этапы роста растения, которые оно проходит от начальной стадии до полной зрелости|color=#e1f6ff}}: ' .. '<b>' .. growthStages .. '</b>' .. '\n')
out = out .. '|style="text-wrap:nowrap;"| \n'
out = out .. frame:preprocess('* {{tooltip|Вода|Потребления воды в секунду|color=#e1f6ff}}: ' .. '<b>' .. waterConsumption .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Удобрения|Потребления удобрений в секунду|color=#e1f6ff}}: ' .. '<b>' .. nutrientConsumption .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Температура|Оптимальная температура|color=#e1f6ff}}: ' .. '<b>' .. idealHeat .. '</b>' .. '\n')
out = out .. frame:preprocess('* {{tooltip|Освещения|Оптимальный уровень освещения|color=#e1f6ff}}: ' .. '<b>' .. idealLight .. '</b>' .. '\n')
out = out .. '| ' .. description .. '\n'
out = out .. '| ' .. location .. '\n'
out = out .. '| ' .. mutation .. '\n'
out = out .. '|- \n'
return out
end
return p