From 66c0bed8963a43d45ad41d672c6478ac5a593a6c Mon Sep 17 00:00:00 2001 From: PreLeyZero Date: Sat, 9 Apr 2022 17:37:15 +0200 Subject: [PATCH] fluid/item handler --- data.lua | 11 +++++---- prototypes/248k_techs.lua | 20 +++++++--------- prototypes/el_recipes.lua | 2 +- prototypes/fu_recipes.lua | 41 ++++++++++++++++++++++++++++---- prototypes/fusion/fu_burner.lua | 10 ++++---- scripts/electronic/el_burner.lua | 41 ++++++++++++++++++++++++++++++++ 6 files changed, 99 insertions(+), 26 deletions(-) create mode 100644 scripts/electronic/el_burner.lua diff --git a/data.lua b/data.lua index 41c3c9a..082225b 100644 --- a/data.lua +++ b/data.lua @@ -91,9 +91,6 @@ if mods["space-exploration"] then require('scripts/SE/data') end -require('scripts/gravitation/gr_make_white_hole_recipes') - - data:extend({ { type = "sprite", @@ -113,4 +110,10 @@ end --overhaul if settings.startup['overhaul_mode'].value == true then require('scripts/overhaul') -end \ No newline at end of file +end + +--white hole +require('scripts/gravitation/gr_make_white_hole_recipes') + +--make item vent recipes +require('scripts/electronic/el_burner') \ No newline at end of file diff --git a/prototypes/248k_techs.lua b/prototypes/248k_techs.lua index 6e89728..360ae3e 100644 --- a/prototypes/248k_techs.lua +++ b/prototypes/248k_techs.lua @@ -85,6 +85,10 @@ data:extend({ type = 'unlock-recipe', recipe = 'el_burner_kerosene_recipe', }, + { + type = 'unlock-recipe', + recipe = 'fu_burner_recipe', + }, }, unit = { count = '150', @@ -192,10 +196,10 @@ data:extend({ type = 'unlock-recipe', recipe = 'el_purify_stone_acidic_recipe', }, - { - type = 'unlock-recipe', - recipe = 'el_purify_uranium_acidic_recipe', - }, + --{ + -- type = 'unlock-recipe', + -- recipe = 'el_purify_uranium_acidic_recipe', + --}, { type = 'unlock-recipe', recipe = 'el_dirty_water_vent_2_recipe', @@ -1877,14 +1881,6 @@ data:extend({ type = 'unlock-recipe', recipe = 'fu_boiler_recipe', }, - { - type = 'unlock-recipe', - recipe = 'fu_burn_oxygen_recipe', - }, - { - type = 'unlock-recipe', - recipe = 'fu_burner_recipe', - }, { type = 'unlock-recipe', recipe = 'fu_lithium_6_recipe', diff --git a/prototypes/el_recipes.lua b/prototypes/el_recipes.lua index 5865cfc..d8c1265 100644 --- a/prototypes/el_recipes.lua +++ b/prototypes/el_recipes.lua @@ -202,7 +202,7 @@ data:extend({ {type="fluid", name="el_kerosene", amount=200}, }, results = { - {type="fluid", name="el_desulfurized_kerosene", amount=80,temperature=40}, + {type="fluid", name="el_desulfurized_kerosene", amount=80}, {type="fluid", name="el_acidic_water", amount=120}, }, result_count = 1, diff --git a/prototypes/fu_recipes.lua b/prototypes/fu_recipes.lua index 1eb4227..4449ba6 100644 --- a/prototypes/fu_recipes.lua +++ b/prototypes/fu_recipes.lua @@ -81,9 +81,8 @@ data:extend({ hidden = false, ingredients = { {'el_burner_item',1}, - {'pipe',60}, - {'fu_materials_KFK',25}, - {'fu_materials_TIM',15} + {'pipe',20}, + {'electronic-circuit',20} }, result = 'fu_burner_item', result_count = 1, @@ -1541,7 +1540,8 @@ data:extend({ category = 'fu_burner_category', icon = '__248k__/ressources/elements/fu_oxygen.png', icon_size = 64, - enabled = 'false', + enabled = true, + hidden = true, ingredients = { {type="fluid", name="fu_oxygen", amount=60}, }, @@ -1551,6 +1551,39 @@ data:extend({ always_show_made_in = true, subgroup = 'fu_item_subgroup_f', }, + { + name = 'fu_burn_steam_recipe', + type = 'recipe', + category = 'fu_burner_category', + enabled = true, + hidden = true, + ingredients = { + {type="fluid", name="steam", amount=100}, + }, + results = { + {type="fluid", name="water", amount=100}, + }, + result_count = 1, + energy_required = 1, + always_show_made_in = true, + subgroup = 'fu_item_subgroup_f', + }, + { + name = 'fu_burn_water_recipe', + type = 'recipe', + category = 'fu_burner_category', + icon = data.raw.fluid["water"].icon, + icon_size = data.raw.fluid["water"].icon_size, + hidden = true, + ingredients = { + {type="fluid", name="water", amount=100}, + }, + results = {}, + result_count = 1, + energy_required = 1, + always_show_made_in = true, + subgroup = 'fu_item_subgroup_f', + }, }) \ No newline at end of file diff --git a/prototypes/fusion/fu_burner.lua b/prototypes/fusion/fu_burner.lua index 450378f..b852f83 100644 --- a/prototypes/fusion/fu_burner.lua +++ b/prototypes/fusion/fu_burner.lua @@ -16,8 +16,8 @@ data:extend({ icon_size = 64, place_result = 'fu_burner_entity', stack_size = 20, - subgroup = 'fu_item_subgroup_c', - order = 'a-b', + subgroup = 'el_item_subgroup_c', + order = 'a-a', }, }) @@ -56,8 +56,8 @@ data:extend({ height = 2, base_level = -1, production_type = 'input', - --pipe_picture = assembler2pipepictures(), pipe_covers = pipecoverspictures(), + pipe_picture = south_basic_pipe_picture, pipe_connections = { {type = "input", position = {2, 0}}, --{type = "output", position = {-2, 0}}, @@ -68,8 +68,8 @@ data:extend({ height = 2, base_level = 1, production_type = 'output', - --pipe_picture = assembler2pipepictures(), pipe_covers = pipecoverspictures(), + pipe_picture = south_basic_pipe_picture, pipe_connections = { {type = "output", position = {-2, 0}}, --{type = "output", position = {-2, 0}}, @@ -84,7 +84,7 @@ data:extend({ line_length = 1, frame_count = 1, animation_speed = 0.5, - shift = {0,-0.4} + shift = {0,-0.5} }, map_color = {r=0, g=0, b=1, a=1}, working_sound = diff --git a/scripts/electronic/el_burner.lua b/scripts/electronic/el_burner.lua new file mode 100644 index 0000000..f093d9f --- /dev/null +++ b/scripts/electronic/el_burner.lua @@ -0,0 +1,41 @@ +function make_burner_recipe(item) + local blank = { + name = 'fu_burn_oxygen_recipe', + type = 'recipe', + category = 'fu_burner_category', + icon = '__248k__/ressources/elements/fu_oxygen.png', + icon_size = 64, + enabled = true, + hidden = true, + ingredients = { + {type="item", name="blank", amount=1}, + }, + results = {}, + result_count = 1, + energy_required = 0.1, + always_show_made_in = true, + subgroup = 'fu_item_subgroup_f', + } + blank["name"] = "fu_burn_"..item.."_recipe" + blank["ingredients"] = { + {item,1} + } + if data.raw.item[item].icon then + blank["icon"] = data.raw.item[item].icon + blank["icon_size"] = data.raw.item[item].icon_size + end + --table.insert(data.raw.recipe, base) + data:extend({blank}) +end + +function burner_recipe_generator() + local items = data.raw.item + for i,v in pairs(items) do + if not data.raw.item[i].name == "fi_materials_waste" then + make_burner_recipe(data.raw.item[i].name) + end + end +end + + +burner_recipe_generator() \ No newline at end of file