diff --git a/.gitignore b/.gitignore index 85e49ae..723ef36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -.idea -*.zip \ No newline at end of file +.idea \ No newline at end of file diff --git a/Chromium2/changelog.txt b/Chromium2/changelog.txt index 306383c..54c5d30 100644 --- a/Chromium2/changelog.txt +++ b/Chromium2/changelog.txt @@ -1,14 +1,4 @@ --------------------------------------------------------------------------------------------------- -Version: 2.0.2 -Date: 11.10.2025 - Bug Fixes: - - Increase mod compatibility ---------------------------------------------------------------------------------------------------- -Version: 2.0.1 -Date: 11.10.2025 - Bug Fixes: - - Increase mod compatibility ---------------------------------------------------------------------------------------------------- Version: 2.0.0 Date: 10.10.2025 Features: diff --git a/Chromium2/data-util.lua b/Chromium2/data-util.lua index 81def01..debafa9 100644 --- a/Chromium2/data-util.lua +++ b/Chromium2/data-util.lua @@ -56,16 +56,16 @@ function util.se_matter(params) energy_required = params.energy_required, enabled = false, ingredients = { - {type = "item", name = sedata, amount=1}, + {sedata, 1}, {type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-space-coolant-supercooled", amount=25}, }, results = { {type = "item", name = params.ore, amount = params.quant_out}, {type="item", name="se-contaminated-scrap", amount=1}, - {type="item", name=sedata, amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity = 25, ignored_by_stats = 25}, + {type=item, name=sedata, amount=1, probability=.99}, + {type=item, name=sejunk, amount=1, probability=.01}, + {type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25}, } } }) @@ -100,9 +100,9 @@ function util.se_matter(params) {type="fluid", name="se-particle-stream", amount=50}, }, results = { - {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity = 50, ignored_by_stats = 50}, + {type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99}, + {type=item, name=sejunk, amount=1, probability=.01}, + {type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50}, } } }) @@ -129,7 +129,7 @@ function util.se_matter(params) {"se-astronomic-science-pack-4", 1}, {"se-energy-science-pack-4", 1}, {"se-material-science-pack-4", 1}, - {"kr-matter-tech-card", 1}, + {"matter-tech-card", 1}, {"se-deep-space-science-pack-1", 1}, } }, @@ -309,7 +309,10 @@ end function add_ingredient_raw(recipe, ingredient) if recipe ~= nil and recipe.ingredients ~= nil then for i, existing in pairs(recipe.ingredients) do - if (existing.name and existing.name == ingredient.name) then + if ( + (existing[1] and (existing[1] == ingredient[1] or existing[1] == ingredient.name)) or + (existing.name and (existing.name == ingredient[1] or existing.name == ingredient.name)) + ) then return end end @@ -327,7 +330,10 @@ end function set_ingredient(recipe, ingredient, quantity) if recipe ~= nil and recipe.ingredients ~= nil then for i, existing in pairs(recipe.ingredients) do - if existing.name == ingredient then + if existing[1] == ingredient then + existing[2] = quantity + return + elseif existing.name == ingredient then existing.amount = quantity existing.amount_min = nil existing.amount_max = nil @@ -337,21 +343,22 @@ function set_ingredient(recipe, ingredient, quantity) table.insert(recipe.ingredients, {ingredient, quantity}) end end --- Add a given quantity of product to a given recipe. +-- Add a given quantity of product to a given recipe. -- Only works for recipes with multiple products function util.add_product(recipe_name, product) if data.raw.recipe[recipe_name] and (data.raw.item[product.name] or data.raw.fluid[product.name]) then - add_product(data.raw.recipe[recipe_name], product) + local is_fluid = data.raw.fluid[product.name] + add_product(data.raw.recipe[recipe_name], product, is_fluid) end end -function add_product(recipe, product) +function add_product(recipe, product, is_fluid) if recipe ~= nil then if recipe.results == nil then recipe.results = {} end - table.insert(recipe.results, product) + table.insert(recipe.results, {type = is_fluid and "fluid" or "item", name = product.result, amount = product.result_count and product.result_count or 1}) end end @@ -388,7 +395,7 @@ end -- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true. function util.replace_ingredient(recipe_name, old, new, amount, multiply) if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then - replace_ingredient(data.raw.recipe[recipe_name], old, new, amount or 1, multiply) + replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply) end end @@ -445,20 +452,23 @@ end function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid) if recipe ~= nil and recipe.ingredients ~= nil then for i, existing in pairs(recipe.ingredients) do - if existing.name == new then + if existing[1] == new or existing.name == new then return end end for i, ingredient in pairs(recipe.ingredients) do if ingredient.name == old then ingredient.amount = math.max(1, ingredient.amount - old_amount) + end + if ingredient[1] == old then + ingredient[2] = math.max(1, ingredient[2] - old_amount) end end add_ingredient(recipe, new, new_amount, is_fluid) end end --- set the amount of a product. +-- set the amount of a product. function util.set_product_amount(recipe_name, product, amount) if data.raw.recipe[recipe_name] then set_product_amount(data.raw.recipe[recipe_name], product, amount) @@ -902,7 +912,7 @@ function util.add_unlock_force(technology_name, recipe) util.add_unlock(technology_name, recipe) end --- sum the products of a recipe +-- sum the products of a recipe function util.sum_products(recipe_name) -- this is going to end up approximate in some cases, integer division is probs fine if data.raw.recipe[recipe_name] then diff --git a/Chromium2/info.json b/Chromium2/info.json index 52cbc76..e08a10b 100644 --- a/Chromium2/info.json +++ b/Chromium2/info.json @@ -1,6 +1,6 @@ { "name": "Chromium2", - "version": "2.0.2", + "version": "2.0.0", "factorio_version": "2.0", "title": "Chromium", "author": "Timeken, cackling fiend", @@ -16,12 +16,12 @@ "? bzgas", "? bzsilicon", "? IfNickel-Updated", - "? Indium2", + "? Indium", "? Krastorio2", "? RampantArsenal", "? space-exploration", - "? Tantalite2", + "? Tantalite", "? ThemTharHills-Updated" ], - "description": "Chromium is a mod adding the element chromium.\n\nThis mod is inspired by Brevven's BZ mods." + "description": "Chromium is a mod adding the element chromium.\n\nThis mod is inspired by Brevven's BZ mods. \n\n Most if not all art is placeholder." } \ No newline at end of file diff --git a/Chromium2/prototypes/chromite-ore.lua b/Chromium2/prototypes/chromite-ore.lua index 49adb16..a30dfcf 100644 --- a/Chromium2/prototypes/chromite-ore.lua +++ b/Chromium2/prototypes/chromite-ore.lua @@ -68,6 +68,6 @@ data:extend({ weight = 20*kg, inventory_move_sound = item_sounds.resource_inventory_move, pick_sound = item_sounds.resource_inventory_pickup, - drop_sound = item_sounds.resource_inventory_move + drop_sound = item_sounds.resource_inventory_move, }, }) diff --git a/Chromium2/prototypes/chromium-enriched.lua b/Chromium2/prototypes/chromium-enriched.lua index 70eb22b..1294a18 100644 --- a/Chromium2/prototypes/chromium-enriched.lua +++ b/Chromium2/prototypes/chromium-enriched.lua @@ -36,7 +36,7 @@ data:extend( { {type = "item", name = "enriched-chromium", amount = 6}, {type = "item", name = "iron-ore", amount = 1}, - {type = "fluid", name = "kr-dirty-water", amount = 25, catalyst_amount = 25} + {type = "fluid", name = "dirty-water", amount = 25, catalyst_amount = 25} }, crafting_machine_tint = { @@ -67,12 +67,12 @@ data:extend( { type = "recipe", name = "dirty-water-filtration-chromium", - category = "kr-fluid-filtration", + category = "fluid-filtration", icons = { { - icon = data.raw.fluid["kr-dirty-water"].icon, - icon_size = data.raw.fluid["kr-dirty-water"].icon_size + icon = data.raw.fluid["dirty-water"].icon, + icon_size = data.raw.fluid["dirty-water"].icon_size }, { icon = data.raw.item["chromite-ore"].icon, @@ -81,7 +81,7 @@ data:extend( shift = {0, 4} } }, - icon_size = data.raw.fluid["kr-dirty-water"].icon_size, + icon_size = data.raw.fluid["dirty-water"].icon_size, energy_required = 2, enabled = false, allow_as_intermediate = false, @@ -89,7 +89,7 @@ data:extend( always_show_products = true, ingredients = { - {type = "fluid", name = "kr-dirty-water", amount = 100, catalyst_amount = 100}, + {type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100}, }, results = { diff --git a/Chromium2/prototypes/chromium-matter.lua b/Chromium2/prototypes/chromium-matter.lua index 24bedc5..6414399 100644 --- a/Chromium2/prototypes/chromium-matter.lua +++ b/Chromium2/prototypes/chromium-matter.lua @@ -27,14 +27,14 @@ if mods["Krastorio2"] then { { "production-science-pack", 1 }, { "utility-science-pack", 1 }, - { "kr-matter-tech-card", 1 } + { "matter-tech-card", 1 } }, time = 45 } }, }) - matter.make_recipes({ + matter.createMatterRecipe({ material = { type = "item", name = "chromite-ore", amount = 10 }, matter_count = 5, energy_required = 1, @@ -42,7 +42,7 @@ if mods["Krastorio2"] then unlocked_by_technology = "chromium-matter-processing" }) - matter.make_recipes({ + matter.createMatterRecipe({ material = { type = "item", name = "chromium-plate", amount = 10 }, matter_count = 10, energy_required = 3, diff --git a/Chromium2/prototypes/chromium-recipe-se.lua b/Chromium2/prototypes/chromium-recipe-se.lua index c586807..84fa73e 100644 --- a/Chromium2/prototypes/chromium-recipe-se.lua +++ b/Chromium2/prototypes/chromium-recipe-se.lua @@ -50,7 +50,7 @@ if mods["space-exploration"] then }, energy_required = 45, ingredients = { - {type = "item", name = mods["Krastorio2"] and "enriched-chromium" or "chromite-ore", amount = 24}, + {name = mods["Krastorio2"] and "enriched-chromium" or "chromite-ore", amount = 24}, {type = "fluid", name = "se-pyroflux", amount = 10}, }, enabled = false, @@ -81,11 +81,11 @@ if mods["space-exploration"] then {icon = "__Chromium2__/graphics/icons/chromium-ingot.png", icon_size = 32, scale = 0.125, shift = {-8, -8}}, }, results = { - {type="item", name = "chromium-plate", amount = 10}, + {name = "chromium-plate", amount = 10}, }, energy_required = 3.75, ingredients = { - {type="item", name = "chromium-ingot", amount = 1} + {name = "chromium-ingot", amount = 1} }, enabled = false, always_show_made_in = true, diff --git a/Chromium2/prototypes/chromium-recipe.lua b/Chromium2/prototypes/chromium-recipe.lua index 83620b5..4ed7a2d 100644 --- a/Chromium2/prototypes/chromium-recipe.lua +++ b/Chromium2/prototypes/chromium-recipe.lua @@ -56,14 +56,14 @@ if mods["Krastorio2"] then { icon = "__Chromium2__/graphics/icons/chromium-plate.png", icon_size = 64}, { icon = "__Chromium2__/graphics/icons/chromite-ore.png", icon_size = 64, scale=0.125, shift= {-8, -8}} }, - category = "kr-electrolysis", + category = "electrolysis", order = "a[chromium-plate]", energy_required = 25, enabled = false, always_show_made_in = true, ingredients = { {type = "fluid", name = "sulfuric-acid", amount = 25}, - {type = "fluid", name = "kr-ammonia", amount = 50}, + {type = "fluid", name = "ammonia", amount = 50}, {type = "item", name = "chromite-ore", amount = 20} }, results = { @@ -214,12 +214,9 @@ data:extend({ } }) -local inconel_ingredients = {{type="item", name="steel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}} +local inconel_ingredients = {{type="item", name="steel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}, mods["Tantalite"] and {type="item", name="niobium-plate", amount=1}} if mods["IfNickel-Updated"] then - inconel_ingredients = {{type="item", name="nickel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}} -end -if mods["Tantalite2"] then - table.insert(inconel_ingredients, {type="item", name="niobium-plate", amount=1}) + inconel_ingredients = {{type="item", name="nickel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}, mods["Tantalite"] and {type="item", name="niobium-plate", amount=1}} end local inconel_category = "crafting" local inconel_subgroup = "intermediate-product" diff --git a/Chromium2/recipe-modify.lua b/Chromium2/recipe-modify.lua index 21a2983..36e7407 100644 --- a/Chromium2/recipe-modify.lua +++ b/Chromium2/recipe-modify.lua @@ -38,7 +38,7 @@ if mods["space-exploration"] then util.replace_ingredient("se-thruster-suit", "low-density-structure", "chromel-r-fabric") end -if mods["Indium2"] then +if mods["Indium"] then util.replace_ingredient("cryogenic-seal", "steel-plate", "stainless-steel-plate") end