mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-05-12 21:08:43 +09:00
.
This commit is contained in:
@@ -32,7 +32,6 @@ for _, v in pairs(items) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if mods['space-exploration'] and settings.startup['PHI-MB-MACHINE-TIER'].value > 1 then
|
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'
|
data.raw['mining-drill']['se-core-miner-drill'].fast_replaceable_group = 'se-core-miner-drill'
|
||||||
|
|
||||||
|
|||||||
@@ -1,51 +1,86 @@
|
|||||||
local items = require '__PHI-CL__/config'
|
local mbe = require 'mbe-c'
|
||||||
|
local mbm = require 'mbm-c'
|
||||||
|
local mbq = require 'mbq-c'
|
||||||
|
|
||||||
for _, force in pairs(game.forces) do
|
for _, force in pairs(game.forces) do
|
||||||
local technologies = force.technologies
|
local technologies = force.technologies
|
||||||
local recipes = force.recipes
|
local recipes = force.recipes
|
||||||
|
|
||||||
for _, v in pairs(items['item']) do
|
for _, v in pairs(mbe) do
|
||||||
if v.enabled then
|
v.mod = v.mod or 'base'
|
||||||
|
|
||||||
|
if (v.mod and mods[v.mod]) and (v.max >= (v.min or 2)) then
|
||||||
|
v.tech = v.tech or 'compound-energy'
|
||||||
|
|
||||||
if (v.tech == 'compound-energy') then
|
if (v.tech == 'compound-energy') then
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
if ((not technologies['compound-energy-' .. j]) or technologies['compound-energy-' .. j].researched) and recipes[v.name .. '-' .. j] then
|
local vn = (v.ref_name or v.name) .. '-' .. j
|
||||||
recipes[v.name .. '-' .. j].enabled = true
|
|
||||||
recipes[v.name .. '-' .. j].reload()
|
if ((not technologies['compound-energy-' .. j]) or technologies['compound-energy-' .. j].researched) and recipes[vn] then
|
||||||
|
recipes[vn].enabled = true
|
||||||
|
recipes[vn].reload()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif (not technologies[v.tech]) or technologies[v.tech].researched then
|
||||||
|
for j=v.min, v.max, 1 do
|
||||||
|
local vn = (v.ref_name or v.name) .. '-' .. j
|
||||||
|
|
||||||
|
if recipes[vn] then
|
||||||
|
recipes[vn].enabled = true
|
||||||
|
recipes[vn].reload()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
for _, v in pairs(mbm) do
|
||||||
|
v.mod = v.mod or 'base'
|
||||||
|
|
||||||
|
if (v.mod and mods[v.mod]) and (v.max >= (v.min or 2)) then
|
||||||
if (not technologies[v.tech]) or technologies[v.tech].researched then
|
if (not technologies[v.tech]) or technologies[v.tech].researched then
|
||||||
if string.find(v.type, '-equipment') then
|
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
if recipes[v.name .. '-mk' .. j .. '-equipment'] then
|
local vn = (v.ref_name or v.name) .. '-' .. j
|
||||||
recipes[v.name .. '-mk' .. j .. '-equipment'].enabled = true
|
|
||||||
recipes[v.name .. '-mk' .. j .. '-equipment'].reload()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
if recipes[vn] then
|
||||||
for j=v.min, v.max, 1 do
|
recipes[vn].enabled = true
|
||||||
if recipes[v.name .. '-' .. j] then
|
recipes[vn].reload()
|
||||||
recipes[v.name .. '-' .. j].enabled = true
|
|
||||||
recipes[v.name .. '-' .. j].reload()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ((not technologies['power-armor-mk2']) or technologies['power-armor-mk2'].researched) and recipes['power-armor-mk3'] then
|
for _, v in pairs(mbq) do
|
||||||
|
v.mod = v.mod or 'base'
|
||||||
|
|
||||||
|
if (v.mod and mods[v.mod]) and (v.max >= (v.min or 2)) then
|
||||||
|
v.category = 'equipment'
|
||||||
|
|
||||||
|
if (not technologies[v.tech]) or technologies[v.tech].researched then
|
||||||
|
for j=v.min, v.max, 1 do
|
||||||
|
local vn = (v.ref_name or v.name) .. '-' .. j .. '-equipment'
|
||||||
|
|
||||||
|
if recipes[vn] then
|
||||||
|
recipes[vn].enabled = true
|
||||||
|
recipes[vn].reload()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if settings.startup['PHI-MB-EQUIPMENT-ARMOR'].value then
|
||||||
|
if technologies['power-armor-mk2'] and technologies['power-armor-mk2'].researched and recipes['power-armor-mk3'] then
|
||||||
recipes['power-armor-mk3'].enabled = true
|
recipes['power-armor-mk3'].enabled = true
|
||||||
recipes['power-armor-mk3'].reload()
|
recipes['power-armor-mk3'].reload()
|
||||||
end
|
end
|
||||||
|
|
||||||
if ((not technologies['mech-armor']) or technologies['mech-armor'].researched) and recipes['mech-armor-mk2'] then
|
if technologies['mech-armor'] and technologies['mech-armor'].researched and recipes['mech-armor-mk2'] then
|
||||||
recipes['mech-armor-mk2'].enabled = true
|
recipes['mech-armor-mk2'].enabled = true
|
||||||
recipes['mech-armor-mk2'].reload()
|
recipes['mech-armor-mk2'].reload()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if settings.startup['PHI-CT'].value then
|
if settings.startup['PHI-CT'].value then
|
||||||
recipes['electric-boiler'].enabled = true
|
recipes['electric-boiler'].enabled = true
|
||||||
@@ -61,35 +96,12 @@ for _, force in pairs(game.forces) do
|
|||||||
recipes['passive-energy-void'].reload()
|
recipes['passive-energy-void'].reload()
|
||||||
|
|
||||||
if (not technologies['steel-processing']) or technologies['steel-processing'].researched then
|
if (not technologies['steel-processing']) or technologies['steel-processing'].researched then
|
||||||
if recipes['basic-steel-chest'] then
|
|
||||||
recipes['basic-steel-chest'].enabled = true
|
|
||||||
recipes['basic-steel-chest'].reload()
|
|
||||||
end
|
|
||||||
|
|
||||||
if recipes['trash-chest'] then
|
if recipes['trash-chest'] then
|
||||||
recipes['trash-chest'].enabled = true
|
recipes['trash-chest'].enabled = true
|
||||||
recipes['trash-chest'].reload()
|
recipes['trash-chest'].reload()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ((not technologies['construction-robotics']) or technologies['construction-robotics'].researched) or ((not technologies['logistic-robotics']) or technologies['logistic-robotics'].researched) then
|
|
||||||
for _, r in pairs({'passive-provider', 'storage'}) do
|
|
||||||
if recipes['basic-' .. r .. '-chest'] then
|
|
||||||
recipes['basic-' .. r .. '-chest'].enabled = true
|
|
||||||
recipes['basic-' .. r .. '-chest'].reload()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (not technologies['logistic-system']) or technologies['logistic-system'].researched then
|
|
||||||
for _, r in pairs({'active-provider', 'buffer', 'requester'}) do
|
|
||||||
if recipes['basic-' .. r .. '-chest'] then
|
|
||||||
recipes['basic-' .. r .. '-chest'].enabled = true
|
|
||||||
recipes['basic-' .. r .. '-chest'].reload()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (not technologies['automation']) or technologies['automation'].researched and recipes['trash-pipe'] then
|
if (not technologies['automation']) or technologies['automation'].researched and recipes['trash-pipe'] then
|
||||||
recipes['trash-pipe'].enabled = true
|
recipes['trash-pipe'].enabled = true
|
||||||
recipes['trash-pipe'].reload()
|
recipes['trash-pipe'].reload()
|
||||||
|
|||||||
Reference in New Issue
Block a user