added vanilla overhaul + K2 overhaul

This commit is contained in:
PreLeyZero 2022-03-19 00:48:21 +01:00
parent 3781b8dc24
commit 8b258f770d
13 changed files with 399 additions and 46 deletions

View file

@ -16,3 +16,7 @@ end
if mods["space-exploration"] then if mods["space-exploration"] then
require('scripts/SE/data-final-fixes') require('scripts/SE/data-final-fixes')
end end
--overhaul K2
if (settings.startup['overhaul_mode'].value == true and mods["Krastorio2"]) then
require('scripts/krastorio2/overhaul')
end

View file

@ -112,3 +112,8 @@ data:extend({
if data.raw.technology["atomic-bomb"] then if data.raw.technology["atomic-bomb"] then
table.insert(data.raw.technology["atomic-bomb"].effects, {type ="unlock-recipe", recipe ="fi_atomic_bomb_recipe"}) table.insert(data.raw.technology["atomic-bomb"].effects, {type ="unlock-recipe", recipe ="fi_atomic_bomb_recipe"})
end end
--overhaul
if settings.startup['overhaul_mode'].value == true then
require('scripts/overhaul')
end

View file

@ -1,6 +1,6 @@
{ {
"name": "248k", "name": "248k",
"version": "0.9.5", "version": "1.0.0",
"title": "248k Mod", "title": "248k Mod",
"author": "PreLeyZero", "author": "PreLeyZero",
"factorio_version": "1.1", "factorio_version": "1.1",

View file

@ -191,7 +191,8 @@ fi_arc_neodym=Molten neodymium
fu_hydrogen=Hydrogen fu_hydrogen=Hydrogen
fu_oxygen=Oxygen fu_oxygen=Oxygen
fu_lead_fluid=Liquid lead fu_lead_fluid_hot=Liquid lead (1500°C)
fu_lead_fluid_cold=Liquid lead (500°C)
fu_protium=Protium-H[1] fu_protium=Protium-H[1]
fu_deuterium=Deuterium-H[2] fu_deuterium=Deuterium-H[2]
fu_tritium=Tritium-H[3] fu_tritium=Tritium-H[3]
@ -533,6 +534,7 @@ el_ki_core_productivity=Enable productivity modules in KI core and amplifier
el_burner_kerosene_power_output=Kerosene generator power output el_burner_kerosene_power_output=Kerosene generator power output
fu_burner_power_output=Fusion Stage burner power output fu_burner_power_output=Fusion Stage burner power output
override_krastorio_endgame=Adjust Krastorio2 recipes for Anti-matter reactor, Intergalactic transreciever override_krastorio_endgame=Adjust Krastorio2 recipes for Anti-matter reactor, Intergalactic transreciever
overhaul_mode=Overaul vanilla/Krastorio2 by inserting 248k in progression, aswell as in techs and recipes. NOTE: When 248k is added in already existing save this may cause problems. For best gameplay use this on new world.
el_ki_beacon_effectivity_2=KI2 beacon effectivity el_ki_beacon_effectivity_2=KI2 beacon effectivity
el_ki_beacon_supply_area_2=KI2 beacon area el_ki_beacon_supply_area_2=KI2 beacon area

View file

@ -144,7 +144,22 @@ data:extend({
order = 'a-a', order = 'a-a',
}, },
{ {
name = 'fu_lead_fluid', name = 'fu_lead_fluid_hot',
type = 'fluid',
icon = sprite('fu_lead_fluid.png'),
icon_size = 64,
default_temperature = 15,
max_temperature = 1500,
heat_capacity = '100kJ',
base_color = { r=0.9, g=0.77, b=0.6 },
flow_color = { r=0.9, g=0.77, b=0.6 },
pressure_to_speed_ratio = 0.400,
flow_to_energy_ratio = 0,
subgroup = 'fu_item_subgroup_e',
order = 'a-a',
},
{
name = 'fu_lead_fluid_cold',
type = 'fluid', type = 'fluid',
icon = sprite('fu_lead_fluid.png'), icon = sprite('fu_lead_fluid.png'),
icon_size = 64, icon_size = 64,

View file

@ -2042,6 +2042,10 @@ data:extend({
type = 'unlock-recipe', type = 'unlock-recipe',
recipe = 'fu_exchanger_2_recipe', recipe = 'fu_exchanger_2_recipe',
}, },
{
type = 'unlock-recipe',
recipe = 'fu_exchanger_3_recipe',
},
}, },
unit = { unit = {
count = '200', count = '200',

View file

@ -46,7 +46,7 @@ data:extend({
{'concrete',60}, {'concrete',60},
{'el_materials_ALK',20}, {'el_materials_ALK',20},
{'iron-gear-wheel',40}, {'iron-gear-wheel',40},
{'electric-engine-unit',15}, {'engine-unit',15},
{'el_energy_crystal_item',10}, {'el_energy_crystal_item',10},
}, },
result = 'fi_crusher_item', result = 'fi_crusher_item',
@ -63,7 +63,7 @@ data:extend({
{'fi_compound_material_item',60}, {'fi_compound_material_item',60},
{'iron-gear-wheel',40}, {'iron-gear-wheel',40},
{'electric-mining-drill',8}, {'electric-mining-drill',8},
{'electric-engine-unit',10}, {'engine-unit',10},
}, },
result = 'fi_miner_item', result = 'fi_miner_item',
result_count = 1, result_count = 1,
@ -706,7 +706,7 @@ data:extend({
{'concrete',60}, {'concrete',60},
{'el_materials_ALK',20}, {'el_materials_ALK',20},
{'iron-gear-wheel',40}, {'iron-gear-wheel',40},
{'electric-engine-unit',15}, {'engine-unit',15},
{'el_energy_crystal_item',10}, {'el_energy_crystal_item',10},
}, },
result = 'fi_fiberer_item', result = 'fi_fiberer_item',
@ -1005,7 +1005,7 @@ data:extend({
{'concrete',60}, {'concrete',60},
{'el_materials_ALK',60}, {'el_materials_ALK',60},
{'iron-gear-wheel',40}, {'iron-gear-wheel',40},
{'electric-engine-unit',15}, {'engine-unit',15},
{'el_energy_crystal_item',20}, {'el_energy_crystal_item',20},
}, },
result = 'fi_compound_machine_item', result = 'fi_compound_machine_item',

View file

@ -331,7 +331,7 @@ data:extend({
{type="item", name="fu_crushed_lead_item", amount=10}, {type="item", name="fu_crushed_lead_item", amount=10},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=100},
}, },
result_count = 1, result_count = 1,
energy_required = 10, energy_required = 10,
@ -343,11 +343,11 @@ data:extend({
category = 'fu_stelar_reactor_crafting_category', category = 'fu_stelar_reactor_crafting_category',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=1000}, {type="fluid", name="fu_lead_fluid_cold", amount=1000},
{type="fluid", name="fu_protium", amount=20}, {type="fluid", name="fu_protium", amount=20},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=1000, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=1000},
}, },
result_count = 1, result_count = 1,
energy_required = 1, energy_required = 1,
@ -358,12 +358,12 @@ data:extend({
category = 'fu_stelar_reactor_crafting_category', category = 'fu_stelar_reactor_crafting_category',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=1000}, {type="fluid", name="fu_lead_fluid_cold", amount=1000},
{type="fluid", name="fu_deuterium", amount=1}, {type="fluid", name="fu_deuterium", amount=1},
{type="fluid", name="fu_tritium", amount=1}, {type="fluid", name="fu_tritium", amount=1},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=1000, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=1000},
}, },
result_count = 1, result_count = 1,
energy_required = 1, energy_required = 1,
@ -374,12 +374,12 @@ data:extend({
category = 'fu_stelar_reactor_crafting_category', category = 'fu_stelar_reactor_crafting_category',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=1000}, {type="fluid", name="fu_lead_fluid_cold", amount=1000},
{type="fluid", name="fu_protium", amount=15}, {type="fluid", name="fu_protium", amount=15},
{type="fluid", name="fu_lithium_6", amount=15}, {type="fluid", name="fu_lithium_6", amount=15},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=1000, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=1000},
}, },
result_count = 1, result_count = 1,
energy_required = 1, energy_required = 1,
@ -391,13 +391,13 @@ data:extend({
main_product = 'fu_materials_charged_container', main_product = 'fu_materials_charged_container',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=300}, {type="fluid", name="fu_lead_fluid_cold", amount=300},
{type="fluid", name="fu_deuterium", amount=1}, {type="fluid", name="fu_deuterium", amount=1},
{type="fluid", name="fu_tritium", amount=1}, {type="fluid", name="fu_tritium", amount=1},
{type="item", name="fu_materials_empty_container", amount=6}, {type="item", name="fu_materials_empty_container", amount=6},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=300, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=300},
{type="item", name="fu_materials_charged_container", amount=6}, {type="item", name="fu_materials_charged_container", amount=6},
}, },
result_count = 1, result_count = 1,
@ -413,13 +413,13 @@ data:extend({
main_product = 'fu_materials_charged_container', main_product = 'fu_materials_charged_container',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=300}, {type="fluid", name="fu_lead_fluid_cold", amount=300},
{type="fluid", name="fu_protium", amount=15}, {type="fluid", name="fu_protium", amount=15},
{type="fluid", name="fu_lithium_6", amount=15}, {type="fluid", name="fu_lithium_6", amount=15},
{type="item", name="fu_materials_empty_container", amount=6}, {type="item", name="fu_materials_empty_container", amount=6},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=300, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=300},
{type="item", name="fu_materials_charged_container", amount=6}, {type="item", name="fu_materials_charged_container", amount=6},
}, },
result_count = 1, result_count = 1,
@ -436,11 +436,11 @@ data:extend({
category = 'fu_tokamak_reactor_crafting_category', category = 'fu_tokamak_reactor_crafting_category',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=110000}, {type="fluid", name="fu_lead_fluid_cold", amount=110000},
{type="fluid", name="fu_deuterium", amount=200}, {type="fluid", name="fu_deuterium", amount=200},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=110000, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=110000},
}, },
result_count = 1, result_count = 1,
energy_required = 100, energy_required = 100,
@ -451,12 +451,12 @@ data:extend({
category = 'fu_tokamak_reactor_crafting_category', category = 'fu_tokamak_reactor_crafting_category',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=180000}, {type="fluid", name="fu_lead_fluid_cold", amount=180000},
{type="fluid", name="fu_deuterium", amount=100}, {type="fluid", name="fu_deuterium", amount=100},
{type="fluid", name="fu_tritium", amount=100}, {type="fluid", name="fu_tritium", amount=100},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=180000, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=180000},
}, },
result_count = 1, result_count = 1,
energy_required = 100, energy_required = 100,
@ -485,11 +485,11 @@ data:extend({
main_product = 'steam', main_product = 'steam',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="fluid", name="water", amount=1000}, {type="fluid", name="water", amount=1000},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="fluid", name="steam", amount=1000, temperature=500}, {type="fluid", name="steam", amount=1000, temperature=500},
}, },
result_count = 1, result_count = 1,
@ -505,11 +505,11 @@ data:extend({
main_product = 'steam', main_product = 'steam',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=100},
{type="fluid", name="water", amount=1000}, {type="fluid", name="water", amount=1000},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=100},
{type="fluid", name="steam", amount=1000, temperature=1000}, {type="fluid", name="steam", amount=1000, temperature=1000},
}, },
result_count = 1, result_count = 1,
@ -518,6 +518,25 @@ data:extend({
order = 'b-a', order = 'b-a',
always_show_made_in = true, always_show_made_in = true,
}, },
{
name = 'fu_exchanger_3_recipe',
type = 'recipe',
category = 'fu_exchanger_crafting_category',
main_product = 'fu_lead_fluid_cold',
enabled = 'false',
ingredients = {
{type="fluid", name="fu_lead_fluid_hot", amount=100},
{type="fluid", name="water", amount=1000},
},
results = {
{type="fluid", name="fu_lead_fluid_cold", amount=100},
},
result_count = 1,
energy_required = 1,
subgroup = 'fu_item_subgroup_e',
order = 'b-a',
always_show_made_in = true,
},
--fu_robo --fu_robo
{ {
name = 'fu_robo_logistic_recipe', name = 'fu_robo_logistic_recipe',
@ -1156,12 +1175,12 @@ data:extend({
main_product = 'fu_materials_energy_crystal', main_product = 'fu_materials_energy_crystal',
subgroup = 'fu_item_subgroup_a-b', subgroup = 'fu_item_subgroup_a-b',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="item", name="fu_materials_refined_crystal", amount=1} {type="item", name="fu_materials_refined_crystal", amount=1}
}, },
results = { results = {
{type="item", name="fu_materials_energy_crystal", amount=1}, {type="item", name="fu_materials_energy_crystal", amount=1},
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500} {type="fluid", name="fu_lead_fluid_hot", amount=50}
}, },
result_count = 1, result_count = 1,
energy_required = 3, energy_required = 3,
@ -1225,12 +1244,12 @@ data:extend({
category = 'fu_magnet_category', category = 'fu_magnet_category',
main_product = 'fu_materials_magnet', main_product = 'fu_materials_magnet',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=20}, {type="fluid", name="fu_lead_fluid_cold", amount=20},
{type="item", name="fi_materials_neodym", amount=6}, {type="item", name="fi_materials_neodym", amount=6},
{type="item", name="fi_materials_GFK", amount=2}, {type="item", name="fi_materials_GFK", amount=2},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=20, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=20},
{type="item", name="fu_materials_magnet", amount=1}, {type="item", name="fu_materials_magnet", amount=1},
}, },
energy_required = 4, energy_required = 4,
@ -1310,10 +1329,10 @@ data:extend({
category = 'fu_laser_category', category = 'fu_laser_category',
main_product = 'fu_materials_laser_card', main_product = 'fu_materials_laser_card',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50} {type="fluid", name="fu_lead_fluid_cold", amount=50}
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="item", name="fu_materials_laser_card", amount=1} {type="item", name="fu_materials_laser_card", amount=1}
}, },
energy_required = 1, energy_required = 1,
@ -1326,11 +1345,11 @@ data:extend({
category = 'fu_plasma_category', category = 'fu_plasma_category',
main_product = 'fu_materials_plasma_card', main_product = 'fu_materials_plasma_card',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="item", name="stone", amount=10} {type="item", name="stone", amount=10}
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="item", name="fu_materials_plasma_card", amount=1} {type="item", name="fu_materials_plasma_card", amount=1}
}, },
energy_required = 1, energy_required = 1,
@ -1343,11 +1362,11 @@ data:extend({
category = 'fu_magnet_category', category = 'fu_magnet_category',
main_product = 'fu_materials_magnet_card', main_product = 'fu_materials_magnet_card',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="item", name="fi_materials_neodym", amount=1} {type="item", name="fi_materials_neodym", amount=1}
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="item", name="fu_materials_magnet_card", amount=1} {type="item", name="fu_materials_magnet_card", amount=1}
}, },
energy_required = 1, energy_required = 1,
@ -1411,10 +1430,10 @@ data:extend({
category = 'crafting-with-fluid', category = 'crafting-with-fluid',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=100}, {type="fluid", name="fu_lead_fluid_hot", amount=100},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=100},
}, },
result_count = 1, result_count = 1,
energy_required = 6, energy_required = 6,

View file

@ -741,12 +741,12 @@ data:extend({
category = 'fu_magnet_category', category = 'fu_magnet_category',
main_product = 'gr_materials_magnet', main_product = 'gr_materials_magnet',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="item", name="gr_materials_plasma_cube", amount=2}, {type="item", name="gr_materials_plasma_cube", amount=2},
{type="item", name="fu_materials_magnet", amount=1}, {type="item", name="fu_materials_magnet", amount=1},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="item", name="gr_materials_magnet", amount=1}, {type="item", name="gr_materials_magnet", amount=1},
}, },
energy_required = 2, energy_required = 2,
@ -760,12 +760,12 @@ data:extend({
category = 'fu_plasma_category', category = 'fu_plasma_category',
main_product = 'gr_materials_plasma_cube', main_product = 'gr_materials_plasma_cube',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="item", name="fu_materials_KFK", amount=2}, {type="item", name="fu_materials_KFK", amount=2},
{type="item", name="fi_materials_gold", amount=1}, {type="item", name="fi_materials_gold", amount=1},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="item", name="gr_materials_plasma_cube", amount=1}, {type="item", name="gr_materials_plasma_cube", amount=1},
}, },
energy_required = 2, energy_required = 2,

View file

@ -113,11 +113,11 @@ data:extend({
main_product = 'steam', main_product = 'steam',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=50},
{type="fluid", name="water", amount=1000/2}, {type="fluid", name="water", amount=1000/2},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=50, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=50},
{type="fluid", name="steam", amount=1000/2, temperature=425}, {type="fluid", name="steam", amount=1000/2, temperature=425},
}, },
result_count = 1, result_count = 1,
@ -133,11 +133,11 @@ data:extend({
main_product = 'steam', main_product = 'steam',
enabled = 'false', enabled = 'false',
ingredients = { ingredients = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=1500}, {type="fluid", name="fu_lead_fluid_hot", amount=100},
{type="fluid", name="water", amount=1000/4}, {type="fluid", name="water", amount=1000/4},
}, },
results = { results = {
{type="fluid", name="fu_lead_fluid", amount=100, temperature=500}, {type="fluid", name="fu_lead_fluid_cold", amount=100},
{type="fluid", name="steam", amount=1000/4, temperature=975}, {type="fluid", name="steam", amount=1000/4, temperature=975},
}, },
result_count = 1, result_count = 1,

View file

@ -0,0 +1,125 @@
local function add_to_recipe(recipe, item, item_amount)
if not data.raw.recipe[recipe] then
return
end
if data.raw.recipe[recipe].ingredients then
table.insert(data.raw.recipe[recipe].ingredients, {type="item", name=item, amount=item_amount})
end
if data.raw.recipe[recipe].normal and data.raw.recipe[recipe].expensive then
table.insert(data.raw.recipe[recipe].normal.ingredients, {type="item", name=item, amount=item_amount})
table.insert(data.raw.recipe[recipe].expensive.ingredients, {type="item", name=item, amount=item_amount})
end
end
local function add_to_recipes(table_in)
--table structure: {{recipe, item, item_amount}, ... , ...}
for i,v in pairs(table_in) do
add_to_recipe(table_in[i].recipe, table_in[i].item, table_in[i].item_amount)
end
end
local function change_table_index(table_in, structure)
local indexed_table = {}
for _,v in ipairs(table_in) do
local indexed_sub_table = {}
for i,x in ipairs(v) do
indexed_sub_table[structure[i]] = x
end
table.insert(indexed_table, indexed_sub_table)
end
return indexed_table
end
local function add_to_tech(tech, pre_tech)
if not data.raw.technology[tech] then
return
end
if not data.raw.technology[pre_tech] then
return
end
table.insert(data.raw.technology[tech].prerequisites, pre_tech)
end
local function add_to_techs(table_in)
--table structure: {{tech, pre_tech}, ... , ...}
for i,v in pairs(table_in) do
add_to_tech(table_in[i].tech, table_in[i].pre_tech)
end
end
local function remove_tech_card(tech, card)
if not data.raw.technology[tech] then
return
end
for i,v in ipairs(data.raw.technology[tech].unit.ingredients) do
for j,w in ipairs(v) do
if w == card then
v = nil
end
end
end
end
local function remove_tech_cards(table_in)
--table structure: {{tech, card}, ... , ...}
for i,v in pairs(table_in) do
remove_tech_card(table_in[i].tech, table_in[i].card)
end
end
--===================================================================================================================
-- 248k items to Krastorio2 recipes
--===================================================================================================================
--[BUILDINGS]
building_table = {
}
--[ITEMS]
item_table = {
{"productivity-module-2", "fi_modules_core_item", 1},
{"productivity-module-3", "fi_modules_core_item", 3},
{"speed-module-2", "fi_modules_core_item", 1},
{"speed-module-3", "fi_modules_core_item", 3},
{"effectivity-module-2", "fi_modules_core_item", 1},
{"effectivity-module-3", "fi_modules_core_item", 3},
}
--[TECH]
tech_table = {
}
--[REMOVE TECH CARDS]
card_table = {
{"el_purifier_tech", "logistic-science-pack"},
{"el_arc_furnace_tech", "logistic-science-pack"},
{"el_caster_tech", "logistic-science-pack"},
{"el_ALK_tech", "logistic-science-pack"},
}
--===================================================================================================================
-- structure and adding
--===================================================================================================================
recipe_structure = {"recipe", "item", "item_amount"}
tech_structure = {"tech", "pre_tech"}
card_structure = {"tech", "card"}
add_to_recipes(change_table_index(building_table, recipe_structure))
add_to_recipes(change_table_index(item_table, recipe_structure))
add_to_techs(change_table_index(tech_table, tech_structure))
remove_tech_cards(change_table_index(card_table, card_structure))

172
scripts/overhaul.lua Normal file
View file

@ -0,0 +1,172 @@
local function add_to_recipe(recipe, item, item_amount)
if not data.raw.recipe[recipe] then
return
end
if data.raw.recipe[recipe].ingredients then
table.insert(data.raw.recipe[recipe].ingredients, {type="item", name=item, amount=item_amount})
end
if data.raw.recipe[recipe].normal and data.raw.recipe[recipe].expensive then
table.insert(data.raw.recipe[recipe].normal.ingredients, {type="item", name=item, amount=item_amount})
table.insert(data.raw.recipe[recipe].expensive.ingredients, {type="item", name=item, amount=item_amount})
end
end
local function add_to_recipes(table_in)
--table structure: {{recipe, item, item_amount}, ... , ...}
for i,v in pairs(table_in) do
add_to_recipe(table_in[i].recipe, table_in[i].item, table_in[i].item_amount)
end
end
local function change_table_index(table_in, structure)
local indexed_table = {}
for _,v in ipairs(table_in) do
local indexed_sub_table = {}
for i,x in ipairs(v) do
indexed_sub_table[structure[i]] = x
end
table.insert(indexed_table, indexed_sub_table)
end
return indexed_table
end
local function add_to_tech(tech, pre_tech)
if not data.raw.technology[tech] then
return
end
if not data.raw.technology[pre_tech] then
return
end
table.insert(data.raw.technology[tech].prerequisites, pre_tech)
end
local function add_to_techs(table_in)
--table structure: {{tech, pre_tech}, ... , ...}
for i,v in pairs(table_in) do
add_to_tech(table_in[i].tech, table_in[i].pre_tech)
end
end
--===================================================================================================================
-- 248k items to vanilla recipes
--===================================================================================================================
--[BUILDINGS]
building_table = {
{"assembling-machine-2", "el_materials_ALK", 5},
--
--{"fast-inserter", "el_aluminum_item", 2},
--{"long-handed-inserter", "el_aluminum_item", 2},
--
{"engine-unit", "el_materials_ALK", 5},
{"fast-transport-belt", "el_materials_ALK", 1},
{"fast-splitter", "el_materials_ALK", 3},
{"fast-underground-belt", "el_materials_ALK", 8},
{"chemical-plant", "el_materials_ALK", 10},
{"oil-refinery", "el_materials_ALK", 10},
{"medium-electric-pole", "el_materials_ALK", 4},
{"big-electric-pole", "el_materials_ALK", 8},
{"stack-inserter", "el_energy_crystal_item", 2},
{"express-splitter", "fi_materials_GFK", 3},
{"express-transport-belt", "fi_materials_GFK", 1},
{"express-underground-belt","fi_materials_GFK", 8},
{"electric-furnace", "fi_materials_GFK", 12},
{"centrifuge", "fi_materials_GFK", 25},
{"steam-turbine", "fi_materials_GFK", 20},
{"heat-exchanger", "fi_materials_GFK", 10},
{"heat-pipe", "fi_materials_titan",2},
{"rocket-silo", "fu_materials_KFK", 40},
{"beacon", "fi_materials_titan", 12},
{"substation", "fi_materials_titan", 6},
{"assembling-machine-3", "fi_materials_titan", 6},
}
--[ITEMS]
item_table = {
{"advanced-circuit", "el_materials_ceramic", 5},
{"processing-unit", "fi_materials_gold", 3},
{"electric-engine-unit", "fi_materials_gold", 3},
{"flying-robot-frame", "fi_materials_neodym", 6},
{"productivity-module-2", "fi_modules_core_item", 1},
{"productivity-module-3", "fi_modules_core_item", 3},
{"speed-module-2", "fi_modules_core_item", 1},
{"speed-module-3", "fi_modules_core_item", 3},
{"effectivity-module-2", "fi_modules_core_item", 1},
{"effectivity-module-3", "fi_modules_core_item", 3},
{"satellite", "fu_materials_KFK", 10},
--{"automation-science-pack", "fi_modules_core_item", 3},
--{"logistic-science-pack", "fi_modules_core_item", 3},
{"chemical-science-pack", "el_energy_crystal_item",3},
{"production-science-pack", "fi_materials_titan", 1},
{"utility-science-pack", "fi_materials_neodym", 1},
}
--[TECHS]
tech_table = {
{"automation-2", "el_ALK_tech"},
{"chemical-science-pack", "el_grower_tech"},
{"engine", "el_ALK_tech"},
{"oil-processing", "el_ALK_tech"},
{"electric-energy-distribution-1", "el_ALK_tech"},
{"el_energy_tech", "solar-energy"},
{"stack-inserter", "el_grower_tech"},
{"electric-engine", "fi_caster_tech"},
{"robotics", "fi_caster_tech"},
{"production-science-pack", "fi_caster_tech"},
{"utility-science-pack", "fi_caster_tech"},
{"electric-energy-distribution-2", "fi_caster_tech"},
{"uranium-processing", "fi_materials_tech"},
{"advanced-electronics-2", "fi_materials_tech"},
{"fi_energy_tech", "nuclear-power"},
{"nuclear-power", "fi_materials_tech"},
{"effect-transmission", "fi_materials_tech"},
{"automation-3", "fi_materials_tech"},
{"logistics-3", "fi_materials_tech"},
{"effectivity-module-2", "fi_modules_1_tech"},
{"speed-module-2", "fi_modules_1_tech"},
{"productivity-module-2", "fi_modules_1_tech"},
{"kovarex-enrichment-process", "el_ki_eff_1_tech"},
{"kovarex-enrichment-process", "fi_ki_eff_1_tech"},
{"rocket-silo", "fu_KFK_tech"},
{"space-science-pack", "fu_KFK_tech"},
{"el_train_tech", "railway"},
{"el_kerosene_tech", "oil-processing"},
{"fi_refining_tech", "uranium-processing"},
{"fi_crafter_tech", "fi_refining_tech"},
--add science packs
{"fi_stage_tech", "chemical-science-pack"},
{"fu_stage_tech", "utility-science-pack"},
{"el_purifier_tech", "logistic-science-pack"},
{"fu_tokamak_tech", "production-science-pack"},
{"fu_space_probe_1_tech", "production-science-pack"},
{"fu_space_probe_1_tech", "space-science-pack"},
{"fu_star_engine_tech", "space-science-pack"},
{"fu_hydrogen_1_tech", "production-science-pack"},
{"fu_hydrogen_2_tech", "space-science-pack"},
}
--===================================================================================================================
-- structure and adding
--===================================================================================================================
recipe_structure = {"recipe", "item", "item_amount"}
tech_structure = {"tech", "pre_tech"}
add_to_recipes(change_table_index(building_table, recipe_structure))
add_to_recipes(change_table_index(item_table, recipe_structure))
add_to_techs(change_table_index(tech_table, tech_structure))

View file

@ -185,4 +185,11 @@ data:extend({
default_value = true, default_value = true,
order = 'b', order = 'b',
}, },
{
name = 'overhaul_mode',
type = 'bool-setting',
setting_type = 'startup',
default_value = true,
order = 'b',
},
}) })