Compare commits

..

No commits in common. "main" and "2.0.0" have entirely different histories.
main ... 2.0.0

10 changed files with 51 additions and 55 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
.idea .idea
*.zip

View file

@ -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 Version: 2.0.0
Date: 10.10.2025 Date: 10.10.2025
Features: Features:

View file

@ -56,16 +56,16 @@ function util.se_matter(params)
energy_required = params.energy_required, energy_required = params.energy_required,
enabled = false, enabled = false,
ingredients = { ingredients = {
{type = "item", name = sedata, amount=1}, {sedata, 1},
{type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-particle-stream", amount=50},
{type="fluid", name="se-space-coolant-supercooled", amount=25}, {type="fluid", name="se-space-coolant-supercooled", amount=25},
}, },
results = { results = {
{type = "item", name = params.ore, amount = params.quant_out}, {type = "item", name = params.ore, amount = params.quant_out},
{type="item", name="se-contaminated-scrap", amount=1}, {type="item", name="se-contaminated-scrap", amount=1},
{type="item", name=sedata, amount=1, probability=.99}, {type=item, name=sedata, amount=1, probability=.99},
{type="item", name=sejunk, amount=1, probability=.01}, {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="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}, {type="fluid", name="se-particle-stream", amount=50},
}, },
results = { results = {
{type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, {type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99},
{type="item", name=sejunk, amount=1, probability=.01}, {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="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-astronomic-science-pack-4", 1},
{"se-energy-science-pack-4", 1}, {"se-energy-science-pack-4", 1},
{"se-material-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}, {"se-deep-space-science-pack-1", 1},
} }
}, },
@ -309,7 +309,10 @@ end
function add_ingredient_raw(recipe, ingredient) function add_ingredient_raw(recipe, ingredient)
if recipe ~= nil and recipe.ingredients ~= nil then if recipe ~= nil and recipe.ingredients ~= nil then
for i, existing in pairs(recipe.ingredients) do 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 return
end end
end end
@ -327,7 +330,10 @@ end
function set_ingredient(recipe, ingredient, quantity) function set_ingredient(recipe, ingredient, quantity)
if recipe ~= nil and recipe.ingredients ~= nil then if recipe ~= nil and recipe.ingredients ~= nil then
for i, existing in pairs(recipe.ingredients) do 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 = quantity
existing.amount_min = nil existing.amount_min = nil
existing.amount_max = nil existing.amount_max = nil
@ -342,16 +348,17 @@ end
function util.add_product(recipe_name, product) function util.add_product(recipe_name, product)
if data.raw.recipe[recipe_name] and if data.raw.recipe[recipe_name] and
(data.raw.item[product.name] or data.raw.fluid[product.name]) then (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
end end
function add_product(recipe, product) function add_product(recipe, product, is_fluid)
if recipe ~= nil then if recipe ~= nil then
if recipe.results == nil then if recipe.results == nil then
recipe.results = {} recipe.results = {}
end 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
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. -- 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) 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 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
end end
@ -445,13 +452,16 @@ end
function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid) function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid)
if recipe ~= nil and recipe.ingredients ~= nil then if recipe ~= nil and recipe.ingredients ~= nil then
for i, existing in pairs(recipe.ingredients) do for i, existing in pairs(recipe.ingredients) do
if existing.name == new then if existing[1] == new or existing.name == new then
return return
end end
end end
for i, ingredient in pairs(recipe.ingredients) do for i, ingredient in pairs(recipe.ingredients) do
if ingredient.name == old then if ingredient.name == old then
ingredient.amount = math.max(1, ingredient.amount - old_amount) 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
end end
add_ingredient(recipe, new, new_amount, is_fluid) add_ingredient(recipe, new, new_amount, is_fluid)

View file

@ -1,6 +1,6 @@
{ {
"name": "Chromium2", "name": "Chromium2",
"version": "2.0.2", "version": "2.0.0",
"factorio_version": "2.0", "factorio_version": "2.0",
"title": "Chromium", "title": "Chromium",
"author": "Timeken, cackling fiend", "author": "Timeken, cackling fiend",
@ -16,12 +16,12 @@
"? bzgas", "? bzgas",
"? bzsilicon", "? bzsilicon",
"? IfNickel-Updated", "? IfNickel-Updated",
"? Indium2", "? Indium",
"? Krastorio2", "? Krastorio2",
"? RampantArsenal", "? RampantArsenal",
"? space-exploration", "? space-exploration",
"? Tantalite2", "? Tantalite",
"? ThemTharHills-Updated" "? 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."
} }

View file

@ -68,6 +68,6 @@ data:extend({
weight = 20*kg, weight = 20*kg,
inventory_move_sound = item_sounds.resource_inventory_move, inventory_move_sound = item_sounds.resource_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup, pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.resource_inventory_move drop_sound = item_sounds.resource_inventory_move,
}, },
}) })

View file

@ -36,7 +36,7 @@ data:extend(
{ {
{type = "item", name = "enriched-chromium", amount = 6}, {type = "item", name = "enriched-chromium", amount = 6},
{type = "item", name = "iron-ore", amount = 1}, {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 = crafting_machine_tint =
{ {
@ -67,12 +67,12 @@ data:extend(
{ {
type = "recipe", type = "recipe",
name = "dirty-water-filtration-chromium", name = "dirty-water-filtration-chromium",
category = "kr-fluid-filtration", category = "fluid-filtration",
icons = icons =
{ {
{ {
icon = data.raw.fluid["kr-dirty-water"].icon, icon = data.raw.fluid["dirty-water"].icon,
icon_size = data.raw.fluid["kr-dirty-water"].icon_size icon_size = data.raw.fluid["dirty-water"].icon_size
}, },
{ {
icon = data.raw.item["chromite-ore"].icon, icon = data.raw.item["chromite-ore"].icon,
@ -81,7 +81,7 @@ data:extend(
shift = {0, 4} 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, energy_required = 2,
enabled = false, enabled = false,
allow_as_intermediate = false, allow_as_intermediate = false,
@ -89,7 +89,7 @@ data:extend(
always_show_products = true, always_show_products = true,
ingredients = ingredients =
{ {
{type = "fluid", name = "kr-dirty-water", amount = 100, catalyst_amount = 100}, {type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100},
}, },
results = results =
{ {

View file

@ -27,14 +27,14 @@ if mods["Krastorio2"] then
{ {
{ "production-science-pack", 1 }, { "production-science-pack", 1 },
{ "utility-science-pack", 1 }, { "utility-science-pack", 1 },
{ "kr-matter-tech-card", 1 } { "matter-tech-card", 1 }
}, },
time = 45 time = 45
} }
}, },
}) })
matter.make_recipes({ matter.createMatterRecipe({
material = { type = "item", name = "chromite-ore", amount = 10 }, material = { type = "item", name = "chromite-ore", amount = 10 },
matter_count = 5, matter_count = 5,
energy_required = 1, energy_required = 1,
@ -42,7 +42,7 @@ if mods["Krastorio2"] then
unlocked_by_technology = "chromium-matter-processing" unlocked_by_technology = "chromium-matter-processing"
}) })
matter.make_recipes({ matter.createMatterRecipe({
material = { type = "item", name = "chromium-plate", amount = 10 }, material = { type = "item", name = "chromium-plate", amount = 10 },
matter_count = 10, matter_count = 10,
energy_required = 3, energy_required = 3,

View file

@ -50,7 +50,7 @@ if mods["space-exploration"] then
}, },
energy_required = 45, energy_required = 45,
ingredients = { 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}, {type = "fluid", name = "se-pyroflux", amount = 10},
}, },
enabled = false, 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}}, {icon = "__Chromium2__/graphics/icons/chromium-ingot.png", icon_size = 32, scale = 0.125, shift = {-8, -8}},
}, },
results = { results = {
{type="item", name = "chromium-plate", amount = 10}, {name = "chromium-plate", amount = 10},
}, },
energy_required = 3.75, energy_required = 3.75,
ingredients = { ingredients = {
{type="item", name = "chromium-ingot", amount = 1} {name = "chromium-ingot", amount = 1}
}, },
enabled = false, enabled = false,
always_show_made_in = true, always_show_made_in = true,

View file

@ -56,14 +56,14 @@ if mods["Krastorio2"] then
{ icon = "__Chromium2__/graphics/icons/chromium-plate.png", icon_size = 64}, { 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}} { 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]", order = "a[chromium-plate]",
energy_required = 25, energy_required = 25,
enabled = false, enabled = false,
always_show_made_in = true, always_show_made_in = true,
ingredients = { ingredients = {
{type = "fluid", name = "sulfuric-acid", amount = 25}, {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} {type = "item", name = "chromite-ore", amount = 20}
}, },
results = { 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 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}} 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
if mods["Tantalite2"] then
table.insert(inconel_ingredients, {type="item", name="niobium-plate", amount=1})
end end
local inconel_category = "crafting" local inconel_category = "crafting"
local inconel_subgroup = "intermediate-product" local inconel_subgroup = "intermediate-product"

View file

@ -38,7 +38,7 @@ if mods["space-exploration"] then
util.replace_ingredient("se-thruster-suit", "low-density-structure", "chromel-r-fabric") util.replace_ingredient("se-thruster-suit", "low-density-structure", "chromel-r-fabric")
end end
if mods["Indium2"] then if mods["Indium"] then
util.replace_ingredient("cryogenic-seal", "steel-plate", "stainless-steel-plate") util.replace_ingredient("cryogenic-seal", "steel-plate", "stainless-steel-plate")
end end