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
*.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
Date: 10.10.2025
Features:

View file

@ -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
@ -342,16 +348,17 @@ end
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,13 +452,16 @@ 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)

View file

@ -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."
}

View file

@ -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,
},
})

View file

@ -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 =
{

View file

@ -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,

View file

@ -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,

View file

@ -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"

View file

@ -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