Files
factorio-mod-PHI-CL/PHI-CL/data/u/mbm.lua
2026-03-19 21:48:10 +09:00

79 lines
3.2 KiB
Lua

local param = require 'config'
local main = require 'main'
local items = require 'mbm-c'
-- MBE A 6 AAI_INDUSTRY ENTITY,RECIPE,RESEARCH_EFFECT
-- MBE A 58 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
for _, v in pairs(items) do
v.mod = v.mod or 'base'
v.min = v.min or 2
if v.enabled and (v.mod and mods[v.mod]) and (v.max >= v.min) then
v.category = v.category or 'item'
v.ref_name = v.ref_name or v.name
for j=v.min, v.max, 1 do
main.EEE(v, j)
main.EI(v, j)
main.ER(v, j)
main.ET(v, j)
end
main.EL(v)
end
end
if mods['space-exploration'] and settings.startup['PHI-MB-MACHINE-TIER'].value > 1 then
data.raw['mining-drill']['se-core-miner-drill'].fast_replaceable_group = 'se-core-miner-drill'
local se = {
mod = 'space-exploration',
type = 'mining-drill',
name = 'se-core-miner-drill',
ref_name = 'se-core-miner-drill',
min = 2,
max = 3
}
for i = 2, settings.startup['PHI-MB-MACHINE-TIER'].value do
local miner_name = 'se-core-miner-drill-' .. i
main.EEE(se, i)
data.raw['mining-drill'][miner_name].minable.result = miner_name
data.raw['mining-drill'][miner_name].placeable_by.item = miner_name
data.raw['mining-drill'][miner_name].localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)}
data.raw['mining-drill'][miner_name].localised_description = {'entity-description.se-core-miner-drill'}
local item = table.deepcopy(data.raw['item']['se-core-miner-drill'])
item.name = 'se-core-miner-drill-' .. i
item.place_result = miner_name
item.order = 'zzzz-core-miner-drill-' .. i
item.icons = {{icon = '__space-exploration-graphics__/graphics/icons/core-miner.png', tint = param['tint'][i], icon_size = 64}}
item.icon = nil
item.icon_size = nil
item.localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)}
item.localised_description = {'entity-description.se-core-miner-drill'}
data:extend({item})
data:extend({{
type = 'recipe',
name = miner_name,
energy_required = 2,
enabled = false,
ingredients = (i > 2 and {{type = 'item', name = 'se-core-miner-drill-' .. (i - 1), amount = 1}, {type = 'item', name = 'se-core-miner-drill', amount = 1}}) or {{type = 'item', name = 'se-core-miner-drill', amount = 2}},
results = {{type = 'item', name = miner_name, amount = 1}},
localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)},
localised_description = {'entity-description.se-core-miner-drill'}
}})
data.raw['mining-drill'][miner_name].fast_replaceable_group = data.raw['mining-drill']['se-core-miner-drill'].fast_replaceable_group
table.insert(data.raw.technology['se-core-miner'].effects, {type='unlock-recipe', recipe=miner_name})
end
for i = 3, settings.startup['PHI-MB-MACHINE-TIER'].value + 1 do
data.raw['assembling-machine']['se-space-radiator-' .. i].localised_name = {'phi-cl.combine', {'entity-name.se-space-radiator'}, tostring(i)}
end
end