This commit is contained in:
2023-05-13 23:27:09 +09:00
parent 6d4ede4661
commit d826d3d1e1
15 changed files with 412 additions and 310 deletions

304
PHI-RS/config.lua Normal file
View File

@@ -0,0 +1,304 @@
local items = {
{
name='iron-plate',
tech='automation'
},
{
name='copper-plate',
tech='automation'
},
{
name='stone-brick',
tech='automation'
},
{
name='steel-plate',
tech='steel-processing'
},
{
name='basic-oil-processing',
tech='oil-processing'
},
{
name='advanced-oil-processing',
tech='advanced-oil-processing'
},
{
name='heavy-oil-cracking',
tech='advanced-oil-processing'
},
{
name='light-oil-cracking',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-light-oil',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-heavy-oil',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-petroleum-gas',
tech='oil-processing'
},
{
name='coal-liquefaction',
tech='coal-liquefaction'
},
{
name='sulfur',
tech='sulfur-processing'
},
{
name='sulfuric-acid',
tech='sulfur-processing'
},
{
name='lubricant',
tech='lubricant'
},
{
name='plastic-bar',
tech='plastics'
},
{
name='battery',
tech='battery'
},
{
name='explosives',
tech='explosives'
},
{
name='cliff-explosives',
tech='cliff-explosives'
},
{
name='empty-barrel',
tech='fluid-handling'
},
{
name='copper-cable',
tech='automation'
},
{
name='iron-stick',
tech='automation'
},
{
name='iron-gear-wheel',
tech='automation'
},
{
name='pipe',
tech='automation'
},
{
name='electronic-circuit',
tech='automation'
},
{
name='advanced-circuit',
tech='advanced-electronics'
},
{
name='processing-unit',
tech='advanced-electronics-2'
},
{
name='engine-unit',
tech='engine'
},
{
name='electric-engine-unit',
tech='electric-engine'
},
{
name='flying-robot-frame',
tech='robotics'
},
{
name='low-density-structure',
tech='low-density-structure'
},
{
name='rocket-fuel',
tech='rocket-fuel'
},
{
name='rocket-control-unit',
tech='rocket-control-unit'
},
{
name='automation-science-pack',
tech='automation'
},
{
name='logistic-science-pack',
tech='logistic-science-pack'
},
{
name='chemical-science-pack',
tech='chemical-science-pack'
},
{
name='military-science-pack',
tech='military-science-pack'
},
{
name='production-science-pack',
tech='production-science-pack'
},
{
name='utility-science-pack',
tech='utility-science-pack'
},
{
name='inserter',
tech='automation'
},
{
name='transport-belt',
tech='automation'
},
{
name='grenade',
tech='military-2'
},
{
name='firearm-magazine',
tech='automation'
},
{
name='piercing-rounds-magazine',
tech='military-2'
},
{
name='stone-wall',
tech='stone-wall'
},
{
name='rail',
tech='railway'
},
{
name='electric-furnace',
tech='advanced-material-processing-2'
},
{
name='concrete',
tech='concrete'
},
{
name='uranium-processing',
tech='uranium-processing'
},
{
name='uranium-fuel-cell',
tech='uranium-processing'
},
{
name='nuclear-fuel-reprocessing',
tech='nuclear-fuel-reprocessing'
},
{
name='kovarex-enrichment-process',
tech='kovarex-enrichment-process'
},
{
name='nuclear-fuel',
tech='kovarex-enrichment-process'
},
{
name='speed-module',
tech='speed-module'
},
{
name='speed-module-2',
tech='speed-module-2'
},
{
name='speed-module-3',
tech='speed-module-3'
},
{
name='productivity-module',
tech='productivity-module'
},
{
name='productivity-module-2',
tech='productivity-module-2'
},
{
name='productivity-module-3',
tech='productivity-module-3'
},
{
name='effectivity-module',
tech='effectivity-module'
},
{
name='effectivity-module-2',
tech='effectivity-module-2'
},
{
name='effectivity-module-3',
tech='effectivity-module-3'
},
{
name='fast-inserter',
tech='fast-inserter'
},
{
name='filter-inserter',
tech='fast-inserter'
},
{
name='long-handed-inserter',
tech='automation'
},
{
name='stack-inserter',
tech='stack-inserter'
},
{
name='stack-filter-inserter',
tech='stack-inserter'
},
{
name='uranium-rounds-magazine',
tech='uranium-ammo'
},
{
name='explosive-cannon-shell',
tech='tank'
},
{
name='artillery-shell',
tech='artillery'
},
{
name='rocket',
tech='rocketry'
},
{
name='explosive-rocket',
tech='explosive-rocketry'
},
{
name='solar-panel',
tech='solar-energy'
},
{
name='accumulator',
tech='electric-energy-accumulators'
},
{
name='radar',
tech='automation'
}
}
return items

View File

@@ -1,302 +1,10 @@
local recipe_multiplier = {4, 8}
local items = require 'config'
local recipe_list = {
{
name='iron-plate',
tech='automation'
},
{
name='copper-plate',
tech='automation'
},
{
name='stone-brick',
tech='automation'
},
{
name='steel-plate',
tech='steel-processing'
},
{
name='basic-oil-processing',
tech='oil-processing'
},
{
name='advanced-oil-processing',
tech='advanced-oil-processing'
},
{
name='heavy-oil-cracking',
tech='advanced-oil-processing'
},
{
name='light-oil-cracking',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-light-oil',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-heavy-oil',
tech='advanced-oil-processing'
},
{
name='solid-fuel-from-petroleum-gas',
tech='oil-processing'
},
{
name='coal-liquefaction',
tech='coal-liquefaction'
},
{
name='sulfur',
tech='sulfur-processing'
},
{
name='sulfuric-acid',
tech='sulfur-processing'
},
{
name='lubricant',
tech='lubricant'
},
{
name='plastic-bar',
tech='plastics'
},
{
name='battery',
tech='battery'
},
{
name='explosives',
tech='explosives'
},
{
name='cliff-explosives',
tech='cliff-explosives'
},
{
name='empty-barrel',
tech='fluid-handling'
},
{
name='copper-cable',
tech='automation'
},
{
name='iron-stick',
tech='automation'
},
{
name='iron-gear-wheel',
tech='automation'
},
{
name='pipe',
tech='automation'
},
{
name='electronic-circuit',
tech='automation'
},
{
name='advanced-circuit',
tech='advanced-electronics'
},
{
name='processing-unit',
tech='advanced-electronics-2'
},
{
name='engine-unit',
tech='engine'
},
{
name='electric-engine-unit',
tech='electric-engine'
},
{
name='flying-robot-frame',
tech='robotics'
},
{
name='low-density-structure',
tech='low-density-structure'
},
{
name='rocket-fuel',
tech='rocket-fuel'
},
{
name='rocket-control-unit',
tech='rocket-control-unit'
},
{
name='automation-science-pack',
tech='automation'
},
{
name='logistic-science-pack',
tech='logistic-science-pack'
},
{
name='chemical-science-pack',
tech='chemical-science-pack'
},
{
name='military-science-pack',
tech='military-science-pack'
},
{
name='production-science-pack',
tech='production-science-pack'
},
{
name='utility-science-pack',
tech='utility-science-pack'
},
{
name='inserter',
tech='automation'
},
{
name='transport-belt',
tech='automation'
},
{
name='grenade',
tech='military-2'
},
{
name='firearm-magazine',
tech='automation'
},
{
name='piercing-rounds-magazine',
tech='military-2'
},
{
name='stone-wall',
tech='stone-wall'
},
{
name='rail',
tech='railway'
},
{
name='electric-furnace',
tech='advanced-material-processing-2'
},
{
name='concrete',
tech='concrete'
},
{
name='uranium-processing',
tech='uranium-processing'
},
{
name='uranium-fuel-cell',
tech='uranium-processing'
},
{
name='nuclear-fuel-reprocessing',
tech='nuclear-fuel-reprocessing'
},
{
name='kovarex-enrichment-process',
tech='kovarex-enrichment-process'
},
{
name='nuclear-fuel',
tech='kovarex-enrichment-process'
},
{
name='speed-module',
tech='speed-module'
},
{
name='speed-module-2',
tech='speed-module-2'
},
{
name='speed-module-3',
tech='speed-module-3'
},
{
name='productivity-module',
tech='productivity-module'
},
{
name='productivity-module-2',
tech='productivity-module-2'
},
{
name='productivity-module-3',
tech='productivity-module-3'
},
{
name='effectivity-module',
tech='effectivity-module'
},
{
name='effectivity-module-2',
tech='effectivity-module-2'
},
{
name='effectivity-module-3',
tech='effectivity-module-3'
},
{
name='fast-inserter',
tech='fast-inserter'
},
{
name='filter-inserter',
tech='fast-inserter'
},
{
name='long-handed-inserter',
tech='automation'
},
{
name='stack-inserter',
tech='stack-inserter'
},
{
name='stack-filter-inserter',
tech='stack-inserter'
},
{
name='uranium-rounds-magazine',
tech='uranium-ammo'
},
{
name='explosive-cannon-shell',
tech='tank'
},
{
name='artillery-shell',
tech='artillery'
},
{
name='rocket',
tech='rocketry'
},
{
name='explosive-rocket',
tech='explosive-rocketry'
},
}
for i=1, #recipe_list, 1 do
if data.raw.recipe[recipe_list[i].name] ~= nil then
for i=1, #items, 1 do
if data.raw.recipe[items[i].name] ~= nil then
for j=1, #recipe_multiplier, 1 do
local item = table.deepcopy(data.raw.recipe[recipe_list[i].name])
local item = table.deepcopy(data.raw.recipe[items[i].name])
item.enabled = false
if (item.normal ~= nil) and (item.normal ~= false) then
@@ -399,7 +107,7 @@ for i=1, #recipe_list, 1 do
item.name = item.name .. '-s' .. j
data:extend({item})
table.insert(data.raw.technology[recipe_list[i].tech].effects, {type='unlock-recipe', recipe=item.name})
table.insert(data.raw.technology[items[i].tech].effects, {type='unlock-recipe', recipe=item.name})
end
end
end

View File

@@ -1,8 +1,8 @@
{
"name": "PHI-RS",
"version": "1.0.4",
"version": "1.0.5",
"factorio_version": "1.1",
"date": "2023-05-08",
"date": "2023-05-13",
"title": "Phidias Recipe Scaling",
"author": "PHIDIAS0303",
"contributers": "",

View File

@@ -1,3 +1,5 @@
local items = require '__PHI-RS__/config'
for index, force in pairs(game.forces) do
local technologies = force.technologies
local recipes = force.recipes
@@ -6,4 +8,15 @@ for index, force in pairs(game.forces) do
recipes['electric-filter-furnace'].enabled = true
recipes['electric-filter-furnace'].reload()
end
for _, v in pairs(items) do
if technologies[v.tech] ~= nil then
if technologies[v.tech].researched then
recipes[v.name .. '-s1'].enabled = true
recipes[v.name .. '-s1'].reload()
recipes[v.name .. '-s2'].enabled = true
recipes[v.name .. '-s2'].reload()
end
end
end
end