Skip to content

Commit

Permalink
Merge branch 'mox-fuel-split'
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheCoolingFan committed Oct 5, 2024
2 parents 4091c3a + a79ed0e commit 7dc7632
Show file tree
Hide file tree
Showing 80 changed files with 814 additions and 592 deletions.
24 changes: 15 additions & 9 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
---------------------------------------------------------------------------------------------------
Version: 1.6.5
Date: 2024-08-18
Balancing:
Version: 1.7.0
Date: 2024-09-29
Major Changes:
- Replaced Plutonium Atomic bomb by Plutonium Atomic Artillery shell.
Also significantly increased the damage and range of the Plutoinium
atomic explosion. The recipe is a combination of both Artillery Shell
and Atomic Bomb.
- The MOX fuel cell as a concept has been split into two:
Plutonium fuel cell is a fuel cell made with plutonium which can be used in a regular reactor
MOX fuel cell is made from a combination of Pu-238 and U-238 and can be used in a MOX reactor
Minor changes:
- Rearranged nuclear cells, reprocessing and enrichment recipes in the recipe menu.
Graphics:
- Added a new custom icon for the MOX fuel cell, previous icon reused for Plutonium fuel cell
- Uranium Waste solution and Plutonium-rich Nuclear Waste solution icons have been updated.
They now appear much more distinct and won't be mistaken for lubricant.
Also updated colors for flow and barrells, they appear distinctly bright now.
- Changed style of the reprocessing recipe icons for improved clarity.
Balancing:
- Decreased Plutonium-239 output from advanced uranium fuel cell
reprocessing from 0.25 to 0.02
- Increased amount of Plutonium-239 from breeder fuel cell reprocessing
Expand All @@ -20,12 +32,6 @@ Date: 2024-08-18
cell instead of varying in alternative recipes
- Increased time, resource usage and output of Breeder fuel cell
reprocessing recipes by a factor of 2.5 except for amount of cells
- Removed Uranium-235 from MOX fuel recipe
- Increased Plutonium-239 requirement for MOX fuel from 3 to 4
- Increased Plutonium-238 requirement for MOX fuel from 15 to 16
- Decreased Plutonium-239 output from MOX fuel reprocessing from 0.15 to
0.01
- Decreased Plutonium-238 output from Mox fuel reprocessing from 5 to 4
---------------------------------------------------------------------------------------------------
Version: 1.6.4
Date: 2024-08-15
Expand Down
23 changes: 23 additions & 0 deletions compat/IndustrialRevolution3/barrelling.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- IR3 uses a barrelling technology and special barrelling machines, so hide the "convenience" recipes and add additional prerequisites

data.raw['technology']['plutonium-processing'].prerequisites = {
"uranium-processing",
"nuclear-fuel-reprocessing",
"ir-barrelling"
}

-- Hide a recipe and remove it from technologies
local function hide_recipe(name, technology_name)
data.raw['recipe'][name].hidden = true
data.raw['recipe'][name].enabled = false
if technology_name ~= nil then
for index, effect in pairs(data.raw['technology'][technology_name].effects) do
if effect.recipe == name then
table.remove(data.raw['technology'][technology_name].effects, index)
end
end
end
end

hide_recipe('advanced-nuclear-fuel-reprocessing-with-barrelling', 'plutonium-processing')
hide_recipe('breeder-fuel-cell-reprocessing-with-barrelling', 'nuclear-breeding')
14 changes: 14 additions & 0 deletions compat/IndustrialRevolution3/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
log("Applying Industrial Revolution 3 compatibility tweaks")

-- Tweak Plutonium Ammo technology cost
if data.raw['technology']['plutonium-ammo'] then
data.raw['technology']['plutonium-ammo'].unit.count = 2000
data.raw['technology']['plutonium-ammo'].unit.time = 60
end

-- Tweak the shell icon to be consistent with IR3
data.raw['ammo']['plutonium-atomic-artillery-shell'].icon =
'__PlutoniumEnergy__/graphics/icons/plutonium-atomic-artillery-shell-IR3.png'

require('barrelling')
require('subgroup-and-order')
96 changes: 96 additions & 0 deletions compat/IndustrialRevolution3/recipe-tweaks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
-- Add radiation shielding to recipes

for name, amount in pairs({
['MOX-fuel-cell'] = 10,
['breeder-fuel-cell'] = 10,
['breeder-fuel-cell-from-uranium-cell'] = 10,
['breeder-fuel-cell-from-MOX-fuel-cell'] = 10
}) do
for i, ingredient in pairs(data.raw['recipe'][name].ingredients) do
if ingredient[0] == 'iron-plate' then
table.remove(data.raw['recipe'][name].ingredients, i)
end
end
table.insert(data.raw['recipe'][name].ingredients, { 'lead-plate-special', amount })
end

data.raw['recipe']['MOX-reactor'].ingredients = {
{ "lead-plate-special", 80 },
{ "computer-mk3", 4 },
{ "heat-pipe", 4 },
{ "graphite", 60 },
}
data.raw['recipe']['breeder-reactor'].ingredients = {
{ "lead-plate-special", 200 },
{ "computer-mk3", 6 },
{ "heat-pipe", 12 },
{ "graphite", 160 },
}

local function subgroup_and_order(name, subgroup, order, item_type)
if item_type == nil then
item_type = 'item'
end
data.raw[item_type][name].subgroup = subgroup
data.raw[item_type][name].order = order
end

subgroup_and_order('MOX-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[mox-reactor]', 'recipe')

subgroup_and_order('breeder-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[breeder-reactor]', 'recipe')

if settings.startup['enable-plutonium-ammo'].value then
subgroup_and_order('plutonium-rounds-magazine', 'ir-ammo', 'c-q', 'recipe')
end

-- IR3 removes uranium-fuel, not a usable fuel for vehicles
data.raw['recipe']['plutonium-fuel'].hidden = true
data.raw['recipe']['plutonium-fuel'].enabled = false


-- Add steel, lead, and concrete scrap to reprocessing recipes
for name, items in pairs({
['MOX-fuel-cell-reprocessing'] = {
{ name = "steel-scrap", amount_max = 3, amount_min = 1 },
{ name = "lead-scrap", amount_max = 2, amount_min = 1 },
{ name = "concrete-scrap", amount_max = 2, amount_min = 1 }
},

['breeder-fuel-cell-reprocessing'] = {
{ name = "steel-scrap", amount_max = 6, amount_min = 3 },
{ name = "lead-scrap", amount_max = 4, amount_min = 2 },
{ name = "concrete-scrap", amount_max = 4, amount_min = 2 }
},

['advanced-nuclear-fuel-reprocessing'] = {
{ name = "steel-scrap", amount_max = 3, amount_min = 1 },
{ name = "lead-scrap", amount_max = 2, amount_min = 1 },
{ name = "concrete-scrap", amount_max = 2, amount_min = 1 }
}

}) do
for _, item in pairs(items) do
table.insert(data.raw['recipe'][name].results, item)
end
end

-- new subgroup, after uranium recipes
data:extend({ {
type = 'item-subgroup',
name = 'pe',
group = 'ir-processing',
order = 'zzzz',
} })
for _, name in pairs({
'MOX-fuel-cell',
'breeder-fuel-cell',
'MOX-fuel-cell-reprocessing',
'breeder-fuel-cell-reprocessing',
'advanced-nuclear-fuel-reprocessing',
'breeder-fuel-cell-from-MOX-fuel-cell',
'breeder-fuel-cell-from-uranium-cell',
'used-up-uranium-fuel-cell-solution-centrifuging',
'used-up-breeder-fuel-cell-solution-centrifuging'
}) do
data.raw['recipe'][name].subgroup = 'pe'
end
22 changes: 22 additions & 0 deletions compat/IndustrialRevolution3/subgroup-and-order.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Set subgroup and order to an item
local function subgroup_and_order(name, subgroup, order, item_type)
if item_type == nil then
item_type = 'item'
end
data.raw[item_type][name].subgroup = subgroup
data.raw[item_type][name].order = order
end

-- assign IR3 subgroups to items
subgroup_and_order('MOX-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[mox-reactor]')
subgroup_and_order('breeder-reactor', 'ir-nuclear-machines', 'f[nuclear-energy]-a[breeder-reactor]')
subgroup_and_order('MOX-fuel-cell', 'ir-fuels', 'zz[mox-fuel]')
subgroup_and_order('used-up-MOX-fuel-cell', 'ir-fuels', 'zz[mox-fuel-used]')
subgroup_and_order('breeder-fuel-cell', 'ir-fuels', 'zz[breeder-fuel-cell]')
subgroup_and_order('used-up-breeder-fuel-cell', 'ir-fuels', 'zz[breeder-fuel-cell-used]')
subgroup_and_order('plutonium-238', 'ir-fuels', 'cc[plutonium-238]')
subgroup_and_order('plutonium-239', 'ir-fuels', 'cc[plutonium-239]')

if settings.startup['enable-plutonium-ammo'].value then
subgroup_and_order('plutonium-rounds-magazine', 'ir-ammo', 'c-q', 'ammo')
end
4 changes: 4 additions & 0 deletions compat/RealisticReactors.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- big TODO
-- Basically need a rewrite

log("Realistic Reactors no-op compat loaded")
13 changes: 13 additions & 0 deletions compat/SchallRadioactiveWaste.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
log("SchallRadioactiveWaste compat tweaks")

---@diagnostic disable: undefined-global
SchallRadioactiveWaste_add_incineration_recipe('used-up-MOX-fuel', 22.3, 0.9)
SchallRadioactiveWaste_add_incineration_recipe('used-up-breeder-fuel-cell', 45.0, 1.5)
SchallRadioactiveWaste_add_incineration_recipe('plutonium-238', 3, 0.85)
SchallRadioactiveWaste_add_incineration_recipe('plutonium-239', 700, 0.85)

SchallRadioactiveWaste_add_radioactive_effects('plutonium-atomic-rocket', 84, 2.8, 70)

if data.raw['artillery-projectile']['plutonium-atomic-artillery-projectile'] then
SchallRadioactiveWaste_add_radioactive_effects('plutonium-atomic-artillery-projectile', 84, 2.8, 70)
end
Empty file added compat/attack-parameters.lua
Empty file.
45 changes: 45 additions & 0 deletions compat/nuclear-artillery.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
log("Nuclear artillery tweaks")

-- Add nuclear artillery to artillery guns

local function contains(table_to_search, item)
for _, v in pairs(table_to_search) do
if v == item then
return true
end
end
return false
end

for _, gun in pairs(data.raw['gun']) do
if gun.attack_parameters.ammo_categories and not gun.attack_parameters.ammo_category then
if contains(gun.attack_parameters.ammo_categories, 'artillery-shell') then
table.insert(gun.attack_parameters.ammo_categories, 'artillery-shell')
end
end
if gun.attack_parameters.ammo_category == 'artillery-shell' then
gun.attack_parameters.ammo_categories = { 'artillery-shell', 'nuclear-artillery' }
gun.attack_parameters.ammo_category = nil
end
end

-- Add nuclear artillery damage bonus

local function affects_ammotype(effects, ammotype)
for _, effect in pairs(effects) do
if effect.type == "ammo-damage" and effect.ammo_category == ammotype then
return effect.modifier
end
end
return nil
end

for name, tech in pairs(data.raw['technology']) do
if tech.effects ~= nil then
local ammotype_effect = affects_ammotype(tech.effects, 'rocket')
if ammotype_effect then
table.insert(data.raw['technology'][name].effects,
{ type = "ammo-damage", ammo_category = "nuclear-artillery", modifier = ammotype_effect })
end
end
end
19 changes: 19 additions & 0 deletions compat/productivity.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
log("Tweaking productivity restrictions")

-- Add some recipes to productivty modules limitation (which is whitelist for some reason)
local limitation_to_add = {
'advanced-nuclear-fuel-reprocessing',
'MOX-fuel-cell', 'MOX-fuel-cell-reprocessing',
'plutonium-fuel',
'breeder-fuel-cell-reprocessing',
'used-up-uranium-fuel-cell-solution-centrifuging',
'used-up-breeder-fuel-cell-solution-centrifuging',
'breeder-fuel-cell',
}
for _, module in pairs(data.raw['module']) do
if module.limitation and module.effect.productivity then
for _, recipe in pairs(limitation_to_add) do
table.insert(module.limitation, recipe)
end
end
end
Loading

0 comments on commit 7dc7632

Please sign in to comment.