diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 1928d5a..c844783 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -1,8 +1,10 @@ --insert tech if data.raw.lab['lab'] then - table.insert(data.raw.lab['lab'].inputs, 'fu_space_probe_science_item') table.insert(data.raw.lab['lab'].inputs, 'fi_ki_science') table.insert(data.raw.lab['lab'].inputs, 'fu_ki_science') + if not settings.startup['overhaul_science'].value then + table.insert(data.raw.lab['lab'].inputs, 'fu_space_probe_science_item') + end end --krastorio2 if mods["Krastorio2"] then @@ -26,4 +28,4 @@ if mods["RealisticReactors"] then if settings.startup['overhaul_realistic_reactors'].value then require('scripts/realisticreactors/overhaul') end -end \ No newline at end of file +end diff --git a/data.lua b/data.lua index 4a25453..581937a 100644 --- a/data.lua +++ b/data.lua @@ -61,6 +61,7 @@ require('prototypes/fusion/fu_materials') require('prototypes/fusion/fu_magnet') require('prototypes/fusion/fu_miner') require('prototypes/fusion/fu_turbine') +require('prototypes/fusion/fu_lab') require('prototypes/gravitation/gr_crafter') require('prototypes/gravitation/gr_materials') @@ -140,4 +141,7 @@ require('scripts/gravitation/gr_make_white_hole_recipes') --make item vent recipes require('scripts/electronic/el_burner') +--science overhaul +require('scripts/science_overhaul') + diff --git a/locale/en/lang_en.cfg b/locale/en/lang_en.cfg index 7b93841..2ad4061 100644 --- a/locale/en/lang_en.cfg +++ b/locale/en/lang_en.cfg @@ -426,6 +426,8 @@ gr_black_hole_energy_entity=Black hole generator gr_white_hole_entity=White hole generator gr_lab_entity=S-lab +fu_lab_entity=T-lab + #equipment [equipment-name] el_train_equipment_generator_item=Train electricity generator @@ -579,6 +581,8 @@ el_grenade_tech=Charged grenades fi_grenade_tech=Overcharged grenades fu_grenade_tech=Hypercharged grenades +fu_lab_tech=T-lab + #effects [description] x2_ki_tech_eff=Double the module effects of all your KI cores! (Only works on KI3 beacon) @@ -624,12 +628,17 @@ el_ki_core_energy_usage_3=KI3 core power usage el_ki_core_energy_usage_input_2=KI2 core power input maximum el_ki_core_energy_usage_input_3=KI3 core power input maximum +overhaul_science=Enable [color=#880fb4]science overhaul[/color]. +retexture_science=Enable [color=green]science re-texturing[/color]. + [mod-setting-description] el_ki_core_productivity=Allows to achieve very high productivity values in f.e. crafting machines, so use with caution. overhaul_mode=Overaul vanilla/Krastorio2 by inserting 248k in progression, aswell as in techs and recipes. \n[color=red]NOTE: When 248k is added in already existing save this may cause problems. For best gameplay use this on new world.[/color] overhaul_realistic_reactors=248ks nuclear reactor will become a research reactor to guide towards the realistic reactors. \nNuclear Fuel and other are integrated in 248k progression.[color=red] Only possible in Overaul mode.[/color] override_krastorio_endgame=Adjust Krastorio2 recipes for Anti-matter reactor, Intergalactic transreciever to require late game items of 248k. Intergalactic transceiver will require 1 [color=purple]248k element[/color]. +overhaul_science=[color=red][WIP][/color]. Change science by adding additional lab for exotic science. Will include more ways to make science and simulation methods in the future. \n[color=red]Will not work with Krastorio2. [/color] +retexture_science=Re-textures science packs with 248k icons. \n[color=red]Will not work with Krastorio2. [/color] [item-limitation] limitation_message=This module can not be used here. diff --git a/prototypes/248k_techs.lua b/prototypes/248k_techs.lua index e934083..f6c3057 100644 --- a/prototypes/248k_techs.lua +++ b/prototypes/248k_techs.lua @@ -2890,6 +2890,30 @@ data:extend({ time = 100, }, }, + { + name = 'fu_lab_tech', + type = 'technology', + icon = sprite('fu_lab_tech.png'), + icon_size = 128, + enabled = false, + prerequisites = {'fu_energy_tech'}, + effects = { + { + type = 'unlock-recipe', + recipe = 'fu_lab_recipe', + }, + }, + unit = { + count = '200', + ingredients = { + {'chemical-science-pack',1}, + {'automation-science-pack',1}, + {'logistic-science-pack',1}, + {'utility-science-pack',1} + }, + time = 100, + }, + }, --============================================================================================================================================================ --gravitational { diff --git a/prototypes/fu_recipes.lua b/prototypes/fu_recipes.lua index c1c11f7..85d52b0 100644 --- a/prototypes/fu_recipes.lua +++ b/prototypes/fu_recipes.lua @@ -1891,4 +1891,24 @@ data:extend({ result_count = 1, energy_required = 4, }, + { + name = 'fu_lab_recipe', + type = 'recipe', + enabled = 'false', + category = 'crafting', + main_product = 'fu_lab_item', + ingredients = { + {type="item", name="concrete", amount=100}, + {type="item", name="lab", amount=10}, + {type="item", name="fu_materials_energy_charged_crystal", amount=10}, + {type="item", name="fu_materials_KFK", amount=40}, + {type="item", name="fu_materials_TIM", amount=40}, + {type="item", name="fu_materials_magnet", amount=10}, + }, + results = { + {type="item", name="fu_lab_item", amount=1}, + }, + result_count = 1, + energy_required = 10, + }, }) \ No newline at end of file diff --git a/prototypes/fusion/fu_lab.lua b/prototypes/fusion/fu_lab.lua new file mode 100644 index 0000000..9782bc0 --- /dev/null +++ b/prototypes/fusion/fu_lab.lua @@ -0,0 +1,107 @@ +--local functions +local function config(name) + return settings.startup['fu_fusor_'..name].value +end + +local function sprite(name) + return '__248k__/ressources/fusion/fu_lab/fu_lab_'..name..".png" +end + +--item +data:extend({ + { + name = 'fu_lab_item', + type = 'item', + icon = sprite('icon'), + icon_size = 64, + place_result = 'fu_lab_entity', + stack_size = 20, + subgroup = 'fu_item_subgroup_c', + order = 'a-a', + }, +}) + +--entity +data:extend({ +{ + name = "fu_lab_entity", + type = "lab", + icon = sprite("icon"), + icon_size = 64, + flags = {"player-creation","placeable-neutral"}, + max_health = 1000, + corpse = "big-remnants", + collision_box = {{-5,-5},{5,5}}, + selection_box = {{-5,-5},{5,5}}, + map_color = {r=0, g=0, b=1, a=1}, + minable = { + mining_time = 1, + result = "fu_lab_item", + }, + researching_speed = 10, + energy_source = { + type = "electric", + usage_priority = "secondary-input" + }, + energy_usage = "20MW", + inputs = { + "automation-science-pack", + "chemical-science-pack", + "logistic-science-pack", + "military-science-pack", + "production-science-pack", + "space-science-pack", + "utility-science-pack", + "fu_space_probe_science_item", + "fi_ki_science", + "fu_ki_science" + }, + allowed_effects = {"speed", "productivity", "consumption", "pollution"}, + module_specification = { + module_info_icon_shift = { + 0, + 0.8 + }, + module_slots = 4 + }, + off_animation = { + filename = sprite("off"), + size = {512*2,512*2}, + scale = 0.41, + line_length = 1, + frame_count = 1, + animation_speed = 1, + shift = {1.5,-0.4} + }, + on_animation = { + layers = { + { + filename = sprite("off"), + size = {512*2,512*2}, + scale = 0.41, + line_length = 1, + frame_count = 1, + animation_speed = 0.4, + shift = {1.5,-0.4}, + repeat_count = 16 + }, + { + filename = sprite("animation"), + size = {512*2,512*2}, + scale = 0.41, + line_length = 4, + lines_per_file = 4, + frame_count = 16, + animation_speed = 0.4, + shift = {1.5,-0.4} + } + } + }, + + working_sound = { + sound = { filename = "__base__/sound/lab.ogg"}, + idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 }, + apparent_volume = 0.7, + }, +}, +}) \ No newline at end of file diff --git a/ressources/fusion/fu_lab/fu_lab_animation.png b/ressources/fusion/fu_lab/fu_lab_animation.png new file mode 100644 index 0000000..87cdfa8 Binary files /dev/null and b/ressources/fusion/fu_lab/fu_lab_animation.png differ diff --git a/ressources/fusion/fu_lab/fu_lab_icon.png b/ressources/fusion/fu_lab/fu_lab_icon.png new file mode 100644 index 0000000..5dce088 Binary files /dev/null and b/ressources/fusion/fu_lab/fu_lab_icon.png differ diff --git a/ressources/fusion/fu_lab/fu_lab_off.png b/ressources/fusion/fu_lab/fu_lab_off.png new file mode 100644 index 0000000..0cf09f9 Binary files /dev/null and b/ressources/fusion/fu_lab/fu_lab_off.png differ diff --git a/ressources/icons/fi_solid_1.png b/ressources/icons/fi_solid_1.png new file mode 100644 index 0000000..86b94d6 Binary files /dev/null and b/ressources/icons/fi_solid_1.png differ diff --git a/ressources/icons/fi_solid_2.png b/ressources/icons/fi_solid_2.png new file mode 100644 index 0000000..cb90344 Binary files /dev/null and b/ressources/icons/fi_solid_2.png differ diff --git a/ressources/science/blue_science.png b/ressources/science/blue_science.png new file mode 100644 index 0000000..48eb250 Binary files /dev/null and b/ressources/science/blue_science.png differ diff --git a/ressources/science/blue_science_tech.png b/ressources/science/blue_science_tech.png new file mode 100644 index 0000000..004ad2c Binary files /dev/null and b/ressources/science/blue_science_tech.png differ diff --git a/ressources/science/exotic_science.png b/ressources/science/exotic_science.png new file mode 100644 index 0000000..d8cc2fb Binary files /dev/null and b/ressources/science/exotic_science.png differ diff --git a/ressources/science/exotic_science_tech.png b/ressources/science/exotic_science_tech.png new file mode 100644 index 0000000..d270914 Binary files /dev/null and b/ressources/science/exotic_science_tech.png differ diff --git a/ressources/science/green_science.png b/ressources/science/green_science.png new file mode 100644 index 0000000..1abdb00 Binary files /dev/null and b/ressources/science/green_science.png differ diff --git a/ressources/science/green_science_tech.png b/ressources/science/green_science_tech.png new file mode 100644 index 0000000..ea53a63 Binary files /dev/null and b/ressources/science/green_science_tech.png differ diff --git a/ressources/science/grey_science.png b/ressources/science/grey_science.png new file mode 100644 index 0000000..0a189c4 Binary files /dev/null and b/ressources/science/grey_science.png differ diff --git a/ressources/science/grey_science_tech.png b/ressources/science/grey_science_tech.png new file mode 100644 index 0000000..8c53126 Binary files /dev/null and b/ressources/science/grey_science_tech.png differ diff --git a/ressources/science/purple_science.png b/ressources/science/purple_science.png new file mode 100644 index 0000000..cc68a46 Binary files /dev/null and b/ressources/science/purple_science.png differ diff --git a/ressources/science/purple_science_tech.png b/ressources/science/purple_science_tech.png new file mode 100644 index 0000000..c2d9d05 Binary files /dev/null and b/ressources/science/purple_science_tech.png differ diff --git a/ressources/science/red_science.png b/ressources/science/red_science.png new file mode 100644 index 0000000..3365803 Binary files /dev/null and b/ressources/science/red_science.png differ diff --git a/ressources/science/red_science_tech.png b/ressources/science/red_science_tech.png new file mode 100644 index 0000000..7029de2 Binary files /dev/null and b/ressources/science/red_science_tech.png differ diff --git a/ressources/science/white_science.png b/ressources/science/white_science.png new file mode 100644 index 0000000..0ec7b90 Binary files /dev/null and b/ressources/science/white_science.png differ diff --git a/ressources/science/white_science_tech.png b/ressources/science/white_science_tech.png new file mode 100644 index 0000000..172d88a Binary files /dev/null and b/ressources/science/white_science_tech.png differ diff --git a/ressources/science/yellow_science.png b/ressources/science/yellow_science.png new file mode 100644 index 0000000..38cd695 Binary files /dev/null and b/ressources/science/yellow_science.png differ diff --git a/ressources/science/yellow_science_tech.png b/ressources/science/yellow_science_tech.png new file mode 100644 index 0000000..d31b021 Binary files /dev/null and b/ressources/science/yellow_science_tech.png differ diff --git a/ressources/techs/fu_lab_tech.png b/ressources/techs/fu_lab_tech.png new file mode 100644 index 0000000..7ae3048 Binary files /dev/null and b/ressources/techs/fu_lab_tech.png differ diff --git a/scripts/science_overhaul.lua b/scripts/science_overhaul.lua new file mode 100644 index 0000000..634adce --- /dev/null +++ b/scripts/science_overhaul.lua @@ -0,0 +1,61 @@ +--=================================================================================================================== +-- util +--=================================================================================================================== + +local function sprite(name) + return '__248k__/ressources/science/'..name..'.png' +end + +local function retexture_science(table_in) + for i,v in ipairs(table_in) do + data.raw.tool[v[1]].icon_size = 64 + data.raw.tool[v[1]].icon = sprite(v[2]) + + data.raw.technology[v[1]].icon_size = 128 + data.raw.technology[v[1]].icon = sprite(v[2].."_tech") + end +end + +--=================================================================================================================== +-- tables +--=================================================================================================================== + +retexture_table = { + {"logistic-science-pack", "green_science"}, + {"chemical-science-pack", "blue_science"}, + {"military-science-pack", "grey_science"}, + {"production-science-pack", "purple_science"}, + {"utility-science-pack", "yellow_science"}, + {"space-science-pack", "white_science"}, +} + +--=================================================================================================================== +-- structures and adding +--=================================================================================================================== + +if settings.startup['retexture_science'].value then +-- indent ignored + + --only retexture if no k2 + if not mods["Krastorio2"] then + retexture_science(retexture_table) + + data.raw.tool["automation-science-pack"].icon = sprite("red_science") + data.raw.tool["fu_space_probe_science_item"].icon = sprite("exotic_science") + end + +end --indent ignored + +if settings.startup['overhaul_science'].value then + -- indent ignored + + --only overhaul if no k2 + if not mods["Krastorio2"] then + data.raw.technology["fu_lab_tech"].enabled = true + + table.insert(data.raw.technology["fu_space_probe_3_tech"].prerequisites, "fu_lab_tech") + end + + end --indent ignored + + diff --git a/settings.lua b/settings.lua index 56aecee..eaad05f 100644 --- a/settings.lua +++ b/settings.lua @@ -124,4 +124,18 @@ data:extend({ default_value = true, order = 'i-c', }, + { + name = 'retexture_science', + type = 'bool-setting', + setting_type = 'startup', + default_value = true, + order = 'i-d', + }, + { + name = 'overhaul_science', + type = 'bool-setting', + setting_type = 'startup', + default_value = false, + order = 'i-d', + }, }) \ No newline at end of file