Модуль:gases

Вернуться

Строка 95: Строка 95:
end
end
return table.concat(lines, "<br>")
return table.concat(lines, "<br>")
end
local function getProperties(gasPrototype)
return table.concat({
"Теплоёмкость: " .. tostring(gasPrototype.specificHeat) .. " Дж/(моль·K)",
"Адиабата: " .. tostring(gasPrototype.heatCapacityRatio),
"Масса: " .. tostring(gasPrototype.molarMass) .. " г/моль",
"Цена: " .. tostring(gasPrototype.pricePerMole) .. " за моль",
}, "<br>")
end
local function getCollapsedEffects(gasPrototype)
local effects = getEffects(gasPrototype)
if effects == "" then
return ""
end
return '<div class="mw-collapsible mw-collapsed" data-expandtext="Показать" data-collapsetext="Скрыть">Эффекты при вдыхании' .. '<div class="mw-collapsible-content">' .. effects .. '\n</div></div>'
end
end


Строка 107: Строка 124:
end
end


out = out .. '{| class="wikitable sortable" style="width: 100%; text-align: center;"'
out = out .. '{| class="wikitable sortable" style="width: 100%; table-layout: fixed; overflow-wrap: anywhere; font-size: 90%;"'
out = out .. "\n! Газ !! Описание !! Цвет !! Удельная теплоёмкость (Дж/моль·K) !! Показатель адиабаты !! Молярная масса (г/моль) !! Цена за моль !! Получение !! Эффекты"
out = out .. '\n! style="width: 13%;" | Газ !! style="width: 24%;" | Описание !! style="width: 21%;" | Свойства !! style="width: 17%;" | Получение !! style="width: 25%;" | Эффекты'


local additional = frame.args.additional
local additional = frame.args.additional
Строка 135: Строка 152:
local textColor = gasPrototype.textColor or "#FFFFFF"
local textColor = gasPrototype.textColor or "#FFFFFF"


out = out .. '\n|- id="gas_' .. gasId .. '" style="background: ' .. color .. '1E; color: ' .. textColor .. '"'
out = out .. '\n|- id="gas_' .. gasId .. '"'
out = out .. '\n! scope="row" style="font-weight: bold;" | ' .. gasPrototype.name
out = out .. '\n! scope="row" style="background: ' .. color .. '; color: ' .. textColor .. ';" | ' .. gasPrototype.name .. '<br><small>' .. gasPrototype.abbreviation .. '</small>'
out = out .. '\n| style="text-align: left;" | ' .. gasPrototype.desc
out = out .. '\n| ' .. gasPrototype.desc
out = out .. '\n| ' .. color
out = out .. '\n| ' .. getProperties(gasPrototype)
out = out .. '\n| ' .. tostring(gasPrototype.specificHeat or "")
out = out .. '\n| ' .. getRecipes(gasId)
out = out .. '\n| ' .. tostring(gasPrototype.heatCapacityRatio or "")
out = out .. '\n| ' .. getCollapsedEffects(gasPrototype)
out = out .. '\n| ' .. tostring(gasPrototype.molarMass or "")
out = out .. '\n| ' .. tostring(gasPrototype.pricePerMole or "")
out = out .. '\n| style="text-align: left;" | ' .. getRecipes(gasId)
out = out .. '\n| style="text-align: left; font-size: 90%;" | ' .. getEffects(gasPrototype)


return out
return out
Строка 150: Строка 163:


function p.reactionTable(frame)
function p.reactionTable(frame)
local out = '{| class="wikitable sortable" style="width: 100%;"'
local out = '{| class="wikitable sortable" style="width: 100%; table-layout: fixed; overflow-wrap: anywhere; font-size: 90%;"'
out = out .. "\n! Реакция !! Условия !! Расходуется !! Получается !! Примечания"
out = out .. '\n! style="width: 15%;" | Реакция !! style="width: 20%;" | Условия !! style="width: 18%;" | Расходуется !! style="width: 17%;" | Получается !! style="width: 30%;" | Примечания'


for _, reaction in ipairs(sortedReactions()) do
for _, reaction in ipairs(sortedReactions()) do