From 7600d54c169c93b7785341c30fc7021155d106ea Mon Sep 17 00:00:00 2001 From: Adamo Date: Tue, 19 Dec 2023 23:38:13 -0500 Subject: [PATCH] Major changes to machines and some recipe updates. --- data-final-fixes.lua | 49 ++++++------ data-updates.lua | 6 +- data.lua | 26 ++++--- machines.lua | 179 ++++++------------------------------------- 4 files changed, 65 insertions(+), 195 deletions(-) diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 1803424..b23ed3b 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -66,8 +66,10 @@ catalyst_names = { } function manufacturing_needed_for(ingredient) - if type(ingredient) ~= "table" then return false end - local itemname = ingredient.name or ingredient[1] + local itemname = ingredient + if type(itemname) == "table" then + itemname = ingredient.name or ingredient[1] + end for _,matchname in pairs(manufacturing_names) do if itemname:match(matchname) or itemname == matchname then @@ -320,8 +322,9 @@ fluoride_battery_recipe.name = "adamo-chemical-fluoride-battery" fluoride_battery_recipe.normal.result_count = 1 fluoride_battery_recipe.normal.ingredients = {{ - name = "copper-plate", type = "item", - amount = 1, catalyst_amount = 0 + "copper-plate",1 + },{ + "iron-plate", 1 },{ "adamo-chemical-calcite",1 },{ @@ -333,8 +336,9 @@ fluoride_battery_recipe.normal.ingredients = {{ }} fluoride_battery_recipe.expensive.result_count = 1 fluoride_battery_recipe.expensive.ingredients = {{ - name = "copper-plate", type = "item", - amount = 2, catalyst_amount = 0 + "copper-plate",2 + },{ + "iron-plate", 2 },{ "adamo-chemical-calcite",2 },{ @@ -374,11 +378,11 @@ data:extend({ fluoride_battery_recipe, fluorite_science_pack }) -add_recipe_to_tech( +adamo.tech.add.recipe( "advanced-electronics-2", processing_unit_from_hf_recipe.name ) -add_recipes_to_tech( +adamo.tech.add.recipes( "adamo-chemical-fluorine-processing", { fluoride_battery_recipe.name, @@ -386,7 +390,7 @@ add_recipes_to_tech( } ) -set_productivity_recipes({ +adamo.recipes.set.productivity({ fluoride_battery_recipe.name, processing_unit_from_hf_recipe.name, fluorite_science_pack.name @@ -412,18 +416,16 @@ for _,recipe in pairs(data.raw.recipe) do and has_ingredients(recipe) and has_results(recipe) then local calcined_recipe = calcinate_recipe(recipe) if calcined_recipe then - mirror_recipe_in_techs( - recipe, - calcined_recipe - ) - if is_productivity_recipe(recipe) then - set_productivity_recipe(calcined_recipe) + adamo.recipe.mirror.techs(recipe,calcined_recipe) + if adamo.recipe.test.productivity(recipe) then + adamo.recipe.set.productivity(calcined_recipe) end data:extend({calcined_recipe}) end end if is_chem_category(category) and has_ingredients(recipe) and has_results(recipe) then + local plate_count = 0 for k,ingredient in pairs( recipe.ingredients @@ -435,7 +437,7 @@ for _,recipe in pairs(data.raw.recipe) do uses_manufacturing = true end if is_plate(ingredient) then - uses_plates = true + plate_count = plate_count + 1 end if is_catalyst(ingredient) then catalyst_inputs = catalyst_inputs + 1 @@ -452,6 +454,7 @@ for _,recipe in pairs(data.raw.recipe) do fluid_input_count = fluid_input_count + 1 end end + if plate_count > 1 then uses_manufacturing = true end if type(recipe.results) == "table" or ( recipe.expensive @@ -488,7 +491,7 @@ for _,recipe in pairs(data.raw.recipe) do -- Assign new recipe type. if uses_manufacturing then new_category = "adamo-chemical-manufacturing" - elseif 2*catalyst_inputs + elseif 2*catalyst_inputs > (fluid_input_count + solid_input_count) then new_category = "adamo-chemical-manufacturing" else @@ -546,10 +549,10 @@ for _,recipe in pairs(data.raw.recipe) do end new_recipe.localised_name = string.gsub(new_category,"adamo%-chemical%-","Chemical ") data:extend({new_recipe}) - if is_productivity_recipe(recipe) then - set_productivity_recipe(new_recipe) + if adamo.recipe.test.productivity(recipe) then + adamo.recipe.set.productivity(new_recipe) end - mirror_recipe_in_techs(recipe,new_recipe) + adamo.recipe.mirror.techs(recipe,new_recipe) end end end @@ -587,9 +590,9 @@ if data.raw["recipe-category"]["screening"] then end end data:extend({screen_recipe}) - mirror_recipe_in_techs(recipe,screen_recipe) - if is_productivity_recipe(recipe) then - set_productivity_recipe(screen_recipe) + adamo.recipe.mirror.techs(recipe,screen_recipe) + if adamo.recipe.test.productivity(recipe) then + adamo.recipe.set.productivity(screen_recipe) end end end diff --git a/data-updates.lua b/data-updates.lua index 1ca4898..3652aa1 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -33,7 +33,7 @@ table.insert( "adamo-chemical-manufacturing" ) -data.raw["assembling-machine"].centrifuge.fluid_boxes = centrifuge_fluid_boxes() +adamo.apply.centrifuge() add_string_to_table( data.raw["assembling-machine"].centrifuge.crafting_categories, "adamo-chemical-separation" @@ -95,5 +95,5 @@ if data.raw["assembling-machine"][kiln_name] then ) end -move_recipe_to_tech("advanced-material-processing-2","centrifuge") -add_prereq_to_tech("uranium-processing","advanced-material-processing-2") +adamo.tech.add.recipe("advanced-material-processing-2","centrifuge") +adamo.tech.add.prereq("uranium-processing","advanced-material-processing-2") diff --git a/data.lua b/data.lua index fd12911..c2dd4d3 100644 --- a/data.lua +++ b/data.lua @@ -143,6 +143,8 @@ data:extend({ fluorine_processing_tech, }) +adamo.tech.add.prereq("advanced-material-processing-2","adamo-chemical-fluorine-processing") + local calcite_item = { type = "item", name = "adamo-chemical-calcite", @@ -234,8 +236,8 @@ local hydrofluoric_acid_fluid = { order = "a[fluid]-g1[adamo-chemical-hydrofluoric-acid]", icon = "__adamo-chemical__/graphics/icons/hydrofluoride.png", icon_size = 32, - base_color = colors.hf_base, - flow_color = colors.hf_flow, + base_color = adamo.colors.hf_base, + flow_color = adamo.colors.hf_flow, default_temperature = 25, max_temperature = 100, heat_capacity = "0.1KJ", @@ -276,9 +278,9 @@ local calcite_recipe = { }}, --crafting_machine_tint = { -- primary = data.raw.fluid["sulfuric-acid"].base_color, - -- secondary = colors.highgrey, + -- secondary = adamo.colors.highgrey, -- tertiary = data.raw.fluid.water.flow_color, - -- quaternary = colors.midgrey + -- quaternary = adamo.colors.midgrey --}, } adamo.recipe.tint.apply(calcite_recipe) @@ -309,7 +311,7 @@ local gypsum_recipe = { amount = 5 }}, --crafting_machine_tint = { - -- primary = colors.midgrey, + -- primary = adamo.colors.midgrey, -- secondary = data.raw.fluid["sulfuric-acid"].base_color, -- tertiary = data.raw.fluid["sulfuric-acid"].flow_color, -- quaternary = data.raw.fluid.water.flow_color @@ -350,8 +352,8 @@ local hydrofluoric_acid_recipe = { main_product = "adamo-chemical-hydrofluoric-acid", requester_paste_multiplier = 4, --crafting_machine_tint = { - -- primary = colors.hf_base, - -- secondary = colors.midgrey, + -- primary = adamo.colors.hf_base, + -- secondary = adamo.colors.midgrey, -- tertiary = data.raw.fluid["sulfuric-acid"].flow_color, -- quaternary = data.raw.fluid.water.flow_color, --}, @@ -513,10 +515,10 @@ local basic_froth_flotation_recipe = { amount = water_input_count }}, crafting_machine_tint = { - primary = colors.softgreen, + primary = adamo.colors.softgreen, secondary = data.raw.fluid.water.base_color, tertiary = data.raw.fluid.water.flow_color, - quaternary = colors.highbrown, + quaternary = adamo.colors.highbrown, }, } local advanced_froth_flotation_recipe = { @@ -542,10 +544,10 @@ local advanced_froth_flotation_recipe = { amount = water_input_count }}, crafting_machine_tint = { - primary = colors.softgreen, + primary = adamo.colors.softgreen, secondary = data.raw.fluid.water.base_color, tertiary = data.raw.fluid.water.flow_color, - quaternary = colors.highbrown, + quaternary = adamo.colors.highbrown, }, } if found_sisiquartz then @@ -732,7 +734,7 @@ add_recipes_to_tech( } ) -set_productivity_recipes({ +adamo.recipes.set.productivity({ "adamo-chemical-clinker", "adamo-chemical-clinker-with-fluorite", "adamo-chemical-limestone-brick", diff --git a/machines.lua b/machines.lua index 479aabe..6f7892c 100644 --- a/machines.lua +++ b/machines.lua @@ -1,140 +1,12 @@ -local vesselpipecovers = function() - return { - east = { - filename = "__adamo-chemical__/graphics/connections/pipe-cover-east-medium.png", - priority = "extra-high", - width = 128, - height = 128, - scale = 0.5 - }, - west = { - filename = "__adamo-chemical__/graphics/connections/pipe-cover-west-medium.png", - priority = "extra-high", - width = 128, - height = 128, - scale = 0.5 - }, - north = { - filename = "__adamo-chemical__/graphics/connections/pipe-cover-north-medium.png", - priority = "extra-high", - width = 128, - height = 128, - scale = 0.5, - }, - south = { - filename = "__adamo-chemical__/graphics/connections/pipe-cover-south-medium.png", - priority = "extra-high", - width = 128, - height = 128, - scale = 0.5, - }, - } -end - -local vessel_layers = function() - return {{ - filename = "__adamo-chemical__/graphics/entity/process-vessel.png", - width = 160, - height = 220, - frame_count = 1, - shift = util.by_pixel(0, -23) - },{ - filename = "__adamo-chemical__/graphics/entity/process-vessel-shadow.png", - width = 274, - height = 220, - frame_count = 1, - draw_as_shadow = true, - shift = util.by_pixel(58, -26) - }} -end - -local vessel_escaping_pressure_layer = function () - return { - north_position = util.by_pixel(16, 11), - west_position = util.by_pixel(16, 11), - south_position = util.by_pixel(16, 11), - east_position = util.by_pixel(16, 11), - constant_speed = true, - animation = { - filename = "__adamo-chemical__/graphics/entity/process-vessel-anim.png", - frame_count = 40, - line_length = 10, - width = 128, - height = 96, - animation_speed = 0.8 - } - } -end - -local blast_furnace_layers = function(size,speed) - local size = number_or_one(size) - local speed = number_or_one(speed) - return {{ - filename = "__adamo-chemical__/graphics/entity/hr-blast-furnace.png", - priority = "extra-high", - width = 200, - height = 221, - scale = 0.5*size, - shift = util.by_pixel( - size*0, - size*0 - ), - },{ - filename = "__base__/graphics/entity/stone-furnace/hr-stone-furnace-shadow.png", - priority = "extra-high", - line_length = 8, - width = 164, - height = 74, - scale = 0.5*size, - frame_count = 1, - shift = util.by_pixel( - size*42, - size*16 - ), - draw_as_shadow = true, - },{ - filename = "__base__/graphics/entity/boiler/hr-boiler-N-shadow.png", - priority = "extra-high", - width = 274, - height = 164, - scale = 0.3*size, - shift = util.by_pixel( - size*26, - size*6 - ), - draw_as_shadow = true - }} -end - -local blast_furnace_fire = function(size,speed) - local size = number_or_one(size) - local speed = number_or_one(speed) - local depth_scale = 0.85 - return { - filename = "__base__/graphics/entity/stone-furnace/hr-stone-furnace-fire.png", - priority = "extra-high", - animation_speed = speed, - scale = 0.5*depth_scale*size, - line_length = 8, - width = 41, - height = 100, - frame_count = 48, - axially_symmetrical = false, - direction_count = 1, - shift = util.by_pixel( - 0/size, - -10/size - ), - } -end +require("animations") local furnace_recipe = { type = "recipe", name = "adamo-blast-furnace", - energy_required = 2, + energy_required = 3, enabled = false, ingredients = { {"stone-furnace", 1}, - {"steel-plate", 3}, + {"steel-plate", 4}, {"pipe", 1}, }, results = { @@ -162,11 +34,12 @@ local furnace_entity = { flags = {"placeable-neutral", "player-creation"}, minable = { hardness = 0.2, - mining_time = 1, + mining_time = 0.2, result = "adamo-blast-furnace" }, + fast_replaceable_group = "furnace", module_specification = { - module_slots = 3 + module_slots = 2 }, allowed_effects = { "consumption", @@ -230,15 +103,14 @@ add_recipe_to_tech( local process_vessel_recipe = { type = "recipe", name = "adamo-chemical-process-vessel", - energy_required = 5, + energy_required = 8, enabled = false, ingredients = { - {"concrete", 50}, - {"pump",10}, - {"electronic-circuit",20}, - {"advanced-circuit",20}, - {"pipe", 20}, - {"steel-plate", 50} + {"refined-concrete", 200}, + {"steel-plate", 200}, + {"advanced-circuit",100}, + {"pipe", 100}, + {"pump",10} }, results = {{"adamo-chemical-process-vessel", 1}}, } @@ -264,18 +136,16 @@ local process_vessel_entity = { icon_size = 32, flags = {"placeable-neutral", "player-creation"}, minable = { - mining_time = 3, + mining_time = 0.5, result = "adamo-chemical-process-vessel" }, - fast_replaceable_group = "assembling-machine", + fast_replaceable_group = "process-vessel", max_health = chemplant.max_health*2.5, - corpse = "medium-remnants", - dying_explosion = "big-explosion", + corpse = "big-scorchmark", + dying_explosion = "massive-explosion", collision_box = {{-2.4, -2.4}, {2.4, 2.4}}, selection_box = {{-2.5, -2.5}, {2.5, 2.5}}, - module_specification = { - module_slots = 5 - }, + module_specification = {module_slots = 5}, allowed_effects = { "consumption", "speed", @@ -292,21 +162,16 @@ local process_vessel_entity = { "adamo-chemical-activation", "adamo-chemical-disassociation" }, - result_inventory_size = 0, crafting_speed = chemplant.crafting_speed*3, energy_source = { type = "electric", usage_priority = "secondary-input", - emissions_per_minute = chemplant.energy_source.emissions_per_minute*2, + emissions_per_minute = chemplant.energy_source.emissions_per_minute*3, }, - energy_usage = energy_mult(chemplant.energy_usage,3.5), + energy_usage = energy_mult(chemplant.energy_usage,4), ingredient_count = 4, - animation = { - layers = vessel_layers() - }, - working_visualisations = { - vessel_escaping_pressure_layer() - }, + animation = {layers = vessel_layers()}, + working_visualisations = {vessel_escaping_pressure_layer()}, fluid_boxes = {{ production_type = "input", base_level = -1, @@ -407,7 +272,7 @@ if data.raw.technology["advanced-material-processing-3"] then ) else add_recipe_to_tech( - "logistics-3", + "automation-3", "adamo-chemical-process-vessel" ) end