Skip to content

Commit 1369be8

Browse files
Split IR3 compat files
1 parent 9d12848 commit 1369be8

File tree

5 files changed

+60
-59
lines changed

5 files changed

+60
-59
lines changed

compat/IndustrialRevolution3.lua

-58
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- IR3 uses a barrelling technology and special barrelling machines, so hide the "convenience" recipes and add additional prerequisites
2+
3+
data.raw['technology']['plutonium-processing'].prerequisites = {
4+
"uranium-processing",
5+
"nuclear-fuel-reprocessing",
6+
"ir-barrelling"
7+
}
8+
9+
-- Hide a recipe and remove it from technologies
10+
local function hide_recipe(name, technology_name)
11+
data.raw['recipe'][name].hidden = true
12+
data.raw['recipe'][name].enabled = false
13+
if technology_name ~= nil then
14+
for index, effect in pairs(data.raw['technology'][technology_name].effects) do
15+
if effect.recipe == name then
16+
table.remove(data.raw['technology'][technology_name].effects, index)
17+
end
18+
end
19+
end
20+
end
21+
22+
hide_recipe('advanced-nuclear-fuel-reprocessing-with-barrelling', 'plutonium-processing')
23+
hide_recipe('breeder-fuel-cell-reprocessing-with-barrelling', 'nuclear-breeding')

compat/IndustrialRevolution3/main.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
log("Applying Industrial Revolution 3 compatibility tweaks")
2+
3+
-- Tweak Plutonium Ammo technology cost
4+
if data.raw['technology']['plutonium-ammo'] then
5+
data.raw['technology']['plutonium-ammo'].unit.count = 2000
6+
data.raw['technology']['plutonium-ammo'].unit.time = 60
7+
end
8+
9+
-- Tweak the shell icon to be consistent with IR3
10+
data.raw['ammo']['plutonium-atomic-artillery-shell'].icon =
11+
'__PlutoniumEnergy__/graphics/icons/plutonium-atomic-artillery-shell-IR3.png'
12+
13+
require('barrelling')
14+
require('subgroup-and-order')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
-- Set subgroup and order to an item
2+
local function subgroup_and_order(name, subgroup, order, item_type)
3+
if item_type == nil then
4+
item_type = 'item'
5+
end
6+
data.raw[item_type][name].subgroup = subgroup
7+
data.raw[item_type][name].order = order
8+
end
9+
10+
-- assign IR3 subgroups to items
11+
subgroup_and_order('MOX-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[mox-reactor]')
12+
subgroup_and_order('breeder-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[breeder-reactor]')
13+
subgroup_and_order('MOX-fuel-cell', 'ir-fuels', 'zz[mox-fuel]')
14+
subgroup_and_order('used-up-MOX-fuel-cell', 'ir-fuels', 'zz[mox-fuel-used]')
15+
subgroup_and_order('breeder-fuel-cell', 'ir-fuels', 'zz[breeder-fuel-cell]')
16+
subgroup_and_order('used-up-breeder-fuel-cell', 'ir-fuels', 'zz[breeder-fuel-cell-used]')
17+
subgroup_and_order('plutonium-238', 'ir-fuels', 'cc[plutonium-238]')
18+
subgroup_and_order('plutonium-239', 'ir-fuels', 'cc[plutonium-239]')
19+
20+
if settings.startup['enable-plutonium-ammo'].value then
21+
subgroup_and_order('plutonium-rounds-magazine', 'ir-ammo', 'c-q', 'ammo')
22+
end

data-updates.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if mods['IndustrialRevolution3'] then
2-
require('compat.IndustrialRevolution3')
2+
require('compat.IndustrialRevolution3.main')
33
end
44

55
if mods['SchallRadioactiveWaste'] then

0 commit comments

Comments
 (0)