Модуль:Prototypes/Машина/Станок: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 238: | Строка 238: | ||
[3] = "#d72a2a" | [3] = "#d72a2a" | ||
} | } | ||
local materialUseMultiplier = Lathe.materialUseMultiplier or 1 | |||
local timeMultiplier = Lathe.timeMultiplier or 1 | |||
for _, recipe in ipairs(recipes) do | for _, recipe in ipairs(recipes) do | ||
local scaledTime = format_seconds_to_short_string(recipe.completetime) * timeMultiplier | |||
out = out .. '{{Шаблон:Prototypes/Машина/Станок|product=' .. recipe.result | out = out .. '{{Шаблон:Prototypes/Машина/Станок|product=' .. recipe.result | ||
out = out .. '|complete-time=' .. | out = out .. '|complete-time=' .. scaledTime | ||
out = out .. '|materials=' | out = out .. '|materials=' | ||
| Строка 247: | Строка 251: | ||
for material, amount in pairs(recipe.materials) do | for material, amount in pairs(recipe.materials) do | ||
local stackEntity = materialMapping[material] or material | local stackEntity = materialMapping[material] or material | ||
local scaledAmount = amount / 100 | local scaledAmount = (amount / 100) * materialUseMultiplier | ||
out = out .. '<b>[[File:' .. stackEntity .. '.png|32x32px|link=]] ' .. scaledAmount .. ' {{#invoke:Entity Lookup|getname|' .. stackEntity .. '}}</b>' | out = out .. '<b>[[File:' .. stackEntity .. '.png|32x32px|link=]] ' .. scaledAmount .. ' {{#invoke:Entity Lookup|getname|' .. stackEntity .. '}}</b>' | ||
end | end | ||