Compare commits

...

6 commits
2.0.2 ... main

Author SHA1 Message Date
Simon Brodtmann
9df5d0fcc3 2.0.3 2025-12-10 19:42:33 +01:00
Simon Brodtmann
ceb4dfe657 Fix autoplace of rich-copper-ore 2025-12-10 19:29:59 +01:00
Simon Brodtmann
4627a45cdb Cleanup 2025-12-10 19:25:46 +01:00
Simon Brodtmann
e11da23987 Fix recipe name of blank-tech-card-silver 2025-11-16 11:53:34 +01:00
pla
1a411368c5
Fix tech coal-liquefaction has no prereq with catalysis off 2025-11-07 11:41:01 +01:00
Simon Brodtmann
99cab50b68 Forgot thanks 2025-11-01 23:00:22 +01:00
6 changed files with 203 additions and 198 deletions

View file

@ -1,8 +1,15 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 2.0.3
Date: 10.12.2025
Bug Fixes:
- Fix tech coal-liquefaction has no prereq with catalysis off
- Fix recipe name of blank-tech-card-silver
- Fix autoplace of rich-copper-ore
---------------------------------------------------------------------------------------------------
Version: 2.0.2 Version: 2.0.2
Date: 01.11.2025 Date: 01.11.2025
Bug Fixes: Bug Fixes:
- Fix K2 matter integration - Fix K2 matter integration (thanks pla)
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 2.0.1 Version: 2.0.1
Date: 21.10.2025 Date: 21.10.2025

View file

@ -21,8 +21,5 @@ require("compatibility/248k")
local util = require("data-util"); local util = require("data-util");
if util.se6() then
end
-- Must be last -- Must be last
util.create_list() util.create_list()

View file

@ -1,6 +1,6 @@
{ {
"name": "bzgold2", "name": "bzgold2",
"version": "2.0.2", "version": "2.0.3",
"factorio_version": "2.0", "factorio_version": "2.0",
"title": "Noble Metals", "title": "Noble Metals",
"description": "Adds silver, gold, platinum, palladium and more to the base game. Reworks processing units.", "description": "Adds silver, gold, platinum, palladium and more to the base game. Reworks processing units.",

View file

@ -72,6 +72,7 @@ end
if mods.Krastorio2 and util.me.silver() then if mods.Krastorio2 and util.me.silver() then
local tc = futil.table.deepcopy(data.raw.recipe["kr-blank-tech-card"]) local tc = futil.table.deepcopy(data.raw.recipe["kr-blank-tech-card"])
tc.name = "blank-tech-card-silver" tc.name = "blank-tech-card-silver"
tc.localised_name = { "item-name.blank-tech-card" }
data:extend({tc}) data:extend({tc})
util.replace_ingredient("blank-tech-card-silver", "copper-cable", "silver-wire") util.replace_ingredient("blank-tech-card-silver", "copper-cable", "silver-wire")
local amt = util.get_amount("kr-blank-tech-card") local amt = util.get_amount("kr-blank-tech-card")

View file

@ -4,15 +4,15 @@ local futil = require("util");
local util = require("data-util"); local util = require("data-util");
if util.me.platinum() or util.me.palladium() then if util.me.platinum() or util.me.palladium() then
if mods.Krastorio2 then if mods.Krastorio2 then
-- no rich copper -- no rich copper
local rm = futil.table.deepcopy(data.raw.recipe["kr-rare-metals"]) local rm = futil.table.deepcopy(data.raw.recipe["kr-rare-metals"])
rm.name = "rare-metals-1" rm.name = "rare-metals-1"
data:extend({rm}) data:extend({ rm })
util.add_unlock("platinum-processing", "rare-metals-1") util.add_unlock("platinum-processing", "rare-metals-1")
util.add_unlock("palladium-processing", "rare-metals-1") util.add_unlock("palladium-processing", "rare-metals-1")
util.add_icon("rare-metals-1", {icon = "__bzgold2__/graphics/icons/platinum-powder.png", util.add_icon("rare-metals-1", { icon = "__bzgold2__/graphics/icons/platinum-powder.png",
icon_size = 64, scale = 0.25, shift = {-8,8}}) icon_size = 64, scale = 0.25, shift = { -8, 8 } })
util.multiply_recipe("kr-rare-metals", 2) util.multiply_recipe("kr-rare-metals", 2)
util.multiply_recipe("rare-metals-1", 2) util.multiply_recipe("rare-metals-1", 2)
@ -23,73 +23,71 @@ if mods.Krastorio2 then
util.set_main_product("rare-metals-1", "kr-rare-metals") util.set_main_product("rare-metals-1", "kr-rare-metals")
util.set_main_product("rare-metals-2", "kr-rare-metals") util.set_main_product("rare-metals-2", "kr-rare-metals")
if util.me.platinum() and util.me.palladium() then if util.me.platinum() and util.me.palladium() then
util.replace_some_product("rare-metals-1", "kr-rare-metals", 2, "platinum-powder", 2, {force=true}) util.replace_some_product("rare-metals-1", "kr-rare-metals", 2, "platinum-powder", 2, { force = true })
util.replace_some_product("rare-metals-1", "kr-rare-metals", 2, "palladium-powder", 2, {force=true}) util.replace_some_product("rare-metals-1", "kr-rare-metals", 2, "palladium-powder", 2, { force = true })
util.replace_some_product("rare-metals-2", "kr-rare-metals", 3, "platinum-powder", 3, {force=true}) util.replace_some_product("rare-metals-2", "kr-rare-metals", 3, "platinum-powder", 3, { force = true })
util.replace_some_product("rare-metals-2", "kr-rare-metals", 3, "palladium-powder", 3, {force=true}) util.replace_some_product("rare-metals-2", "kr-rare-metals", 3, "palladium-powder", 3, { force = true })
elseif util.me.platinum() then elseif util.me.platinum() then
util.replace_some_product("rare-metals-1", "kr-rare-metals", 3, "platinum-powder", 4, {force=true}) util.replace_some_product("rare-metals-1", "kr-rare-metals", 3, "platinum-powder", 4, { force = true })
util.replace_some_product("rare-metals-2", "kr-rare-metals", 6, "platinum-powder", 6, {force=true}) util.replace_some_product("rare-metals-2", "kr-rare-metals", 6, "platinum-powder", 6, { force = true })
elseif util.me.palladium() then elseif util.me.palladium() then
util.replace_some_product("rare-metals-1", "kr-rare-metals", 3, "palladium-powder", 4, {force=true}) util.replace_some_product("rare-metals-1", "kr-rare-metals", 3, "palladium-powder", 4, { force = true })
util.replace_some_product("rare-metals-2", "kr-rare-metals", 6, "palladium-powder", 6, {force=true}) util.replace_some_product("rare-metals-2", "kr-rare-metals", 6, "palladium-powder", 6, { force = true })
end end
else else
local results = {} local results = {}
if util.me.silver() and util.me.platinum() and util.me.palladium() then if util.me.silver() and util.me.platinum() and util.me.palladium() then
results = { results = {
{type="item", name="copper-plate", amount=1}, { type = "item", name = "copper-plate", amount = 1 },
{type="item", name="silver-ore", amount=1, probability=0.5}, { type = "item", name = "silver-ore", amount = 1, probability = 0.5 },
{type="item", name="platinum-powder", amount=1, probability=0.25}, { type = "item", name = "platinum-powder", amount = 1, probability = 0.25 },
{type="item", name="palladium-powder", amount=1, probability=0.25}, { type = "item", name = "palladium-powder", amount = 1, probability = 0.25 },
} }
elseif util.me.silver() and util.me.platinum() then elseif util.me.silver() and util.me.platinum() then
results = { results = {
{type="item", name="copper-plate", amount=1}, { type = "item", name = "copper-plate", amount = 1 },
{type="item", name="silver-ore", amount=1, probability=0.67}, { type = "item", name = "silver-ore", amount = 1, probability = 0.67 },
{type="item", name="platinum-powder", amount=1, probability=0.33}, { type = "item", name = "platinum-powder", amount = 1, probability = 0.33 },
} }
elseif util.me.silver() and util.me.palladium() then elseif util.me.silver() and util.me.palladium() then
results = { results = {
{type="item", name="copper-plate", amount=1}, { type = "item", name = "copper-plate", amount = 1 },
{type="item", name="silver-ore", amount=1, probability=0.67}, { type = "item", name = "silver-ore", amount = 1, probability = 0.67 },
{type="item", name="palladium-powder", amount=1, probability=0.33}, { type = "item", name = "palladium-powder", amount = 1, probability = 0.33 },
} }
elseif util.me.platinum() and util.me.palladium() then elseif util.me.platinum() and util.me.palladium() then
results = { results = {
{type="item", name="copper-plate", amount=1}, { type = "item", name = "copper-plate", amount = 1 },
{type="item", name="platinum-powder", amount=1, probability=0.5}, { type = "item", name = "platinum-powder", amount = 1, probability = 0.5 },
{type="item", name="palladium-powder", amount=1, probability=0.5}, { type = "item", name = "palladium-powder", amount = 1, probability = 0.5 },
} }
elseif util.me.platinum() then elseif util.me.platinum() then
results = { results = {
{type="item", name="copper-plate", amount=2, probability = 0.75}, { type = "item", name = "copper-plate", amount = 2, probability = 0.75 },
{type="item", name="platinum-powder", amount=1, probability=0.5}, { type = "item", name = "platinum-powder", amount = 1, probability = 0.5 },
} }
elseif util.me.palladium() then elseif util.me.palladium() then
results = { results = {
{type="item", name="copper-plate", amount=2, probability = 0.75}, { type = "item", name = "copper-plate", amount = 2, probability = 0.75 },
{type="item", name="palladium-powder", amount=1, probability=0.5}, { type = "item", name = "palladium-powder", amount = 1, probability = 0.5 },
} }
else -- should never happen else
-- should never happen
results = { results = {
{type="item", name="copper-plate", amount=2}, { type = "item", name = "copper-plate", amount = 2 },
} }
end end
if data.raw.resource["copper-ore"] then
if data.raw.resource["copper-ore"] then
if mods["space-exploration"] then if mods["space-exploration"] then
-- decrease richness of copper a bit (ok if it stacks with aluminum) -- decrease richness of copper a bit (ok if it stacks with aluminum)
data.raw.resource["copper-ore"].autoplace.richness_expression = data.raw.resource["copper-ore"].autoplace.richness_expression = data.raw.resource["copper-ore"].autoplace.richness_expression .. "*(3/4)"
data.raw.resource["copper-ore"].autoplace.richness_expression .. "*(3/4)"
else else
log("Replacing vanilla copper-ore autoplace") log("Replacing vanilla copper-ore autoplace")
local resource_autoplace = require('resource-autoplace'); local resource_autoplace = require('resource-autoplace');
data.raw.resource["copper-ore"].autoplace = resource_autoplace.resource_autoplace_settings{ data.raw.resource["copper-ore"].autoplace = resource_autoplace.resource_autoplace_settings {
name = "copper-ore", name = "copper-ore",
order = "b", order = "b",
base_density = mods.bzaluminum2 and 3 or 4, base_density = mods.bzaluminum2 and 3 or 4,
@ -99,9 +97,10 @@ if data.raw.resource["copper-ore"] then
candidate_spot_count = 22, candidate_spot_count = 22,
} }
end end
end end
if util.se6() then if util.se6() then
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["rich-copper-ore"] = {}
data:extend({ data:extend({
{ {
type = "autoplace-control", type = "autoplace-control",
@ -111,21 +110,23 @@ if util.se6() then
order = "zzzzzzzzzzz" order = "zzzzzzzzzzz"
}, },
}) })
end end
data:extend({ data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["rich-copper-ore"] = {}
resource_autoplace.initialize_patch_set("rich-copper-ore", true)
data:extend({
{ {
type = "resource", type = "resource",
name = "rich-copper-ore", name = "rich-copper-ore",
icon = "__bzgold2__/graphics/icons/rich-copper-ore.png", icon = "__bzgold2__/graphics/icons/rich-copper-ore.png",
icon_size = 64, icon_mipmaps = 4, icon_size = 64, icon_mipmaps = 4,
flags = {"placeable-neutral"}, flags = { "placeable-neutral" },
order="a-b-a", order = "a-b-a",
map_color = {r=0.9, g=0.5, b=0.4}, map_color = { r = 0.9, g = 0.5, b = 0.4 },
tree_removal_probability = 0.7, tree_removal_probability = 0.7,
tree_removal_max_distance = 32 * 32, tree_removal_max_distance = 32 * 32,
minable = minable = {
{
hardness = 1, hardness = 1,
mining_particle = "copper-ore-particle", mining_particle = "copper-ore-particle",
mining_time = 1, mining_time = 1,
@ -133,10 +134,10 @@ data:extend({
required_fluid = "water", required_fluid = "water",
result = "rich-copper-ore" result = "rich-copper-ore"
}, },
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}}, collision_box = { { -0.1, -0.1 }, { 0.1, 0.1 } },
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}}, selection_box = { { -0.5, -0.5 }, { 0.5, 0.5 } },
autoplace = resource_autoplace.resource_autoplace_settings{ autoplace = resource_autoplace.resource_autoplace_settings {
name = "rich-copper-ore", name = "rich-copper-ore",
autoplace_control_name = util.se6() and "rich-copper-ore" or "copper-ore", autoplace_control_name = util.se6() and "rich-copper-ore" or "copper-ore",
order = "b-z", order = "b-z",
@ -147,11 +148,9 @@ data:extend({
starting_rq_factor_multiplier = 1, starting_rq_factor_multiplier = 1,
}, },
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80}, stage_counts = { 15000, 9500, 5500, 2900, 1300, 400, 150, 80 },
stages = stages = {
{ sheet = {
sheet =
{
filename = "__bzgold2__/graphics/entity/ores/hr-rich-copper-ore.png", filename = "__bzgold2__/graphics/entity/ores/hr-rich-copper-ore.png",
priority = "extra-high", priority = "extra-high",
size = 128, size = 128,
@ -164,52 +163,51 @@ data:extend({
{ {
type = "item", type = "item",
name = "rich-copper-ore", name = "rich-copper-ore",
icon_size = 64, icon_mipmaps=4, icon_size = 64, icon_mipmaps = 4,
icon = "__bzgold2__/graphics/icons/rich-copper-ore.png", icon = "__bzgold2__/graphics/icons/rich-copper-ore.png",
pictures = { pictures = {
{filename="__bzgold2__/graphics/icons/rich-copper-ore.png", size=64, scale=0.5}, { filename = "__bzgold2__/graphics/icons/rich-copper-ore.png", size = 64, scale = 0.5 },
{filename="__bzgold2__/graphics/icons/rich-copper-ore-1.png", size=64, scale=0.5}, { filename = "__bzgold2__/graphics/icons/rich-copper-ore-1.png", size = 64, scale = 0.5 },
{filename="__bzgold2__/graphics/icons/rich-copper-ore-2.png", size=64, scale=0.5}, { filename = "__bzgold2__/graphics/icons/rich-copper-ore-2.png", size = 64, scale = 0.5 },
{filename="__bzgold2__/graphics/icons/rich-copper-ore-3.png", size=64, scale=0.5}, { filename = "__bzgold2__/graphics/icons/rich-copper-ore-3.png", size = 64, scale = 0.5 },
}, },
subgroup = "raw-resource", subgroup = "raw-resource",
order = "t-c-a", order = "t-c-a",
stack_size = 50 stack_size = 50
}, },
}) })
data:extend({
data:extend({
{ {
type = "recipe", type = "recipe",
name = "rich-copper", name = "rich-copper",
localised_name = {"item-name.copper-plate"}, localised_name = { "item-name.copper-plate" },
category = "smelting", category = "smelting",
main_product = "copper-plate", main_product = "copper-plate",
order = "d[copper-plate]", order = "d[copper-plate]",
enabled = false, enabled = false,
icons = { icons = {
{icon = "__base__/graphics/icons/copper-plate.png", icon_size = 64, icon_mipmaps=4}, { icon = "__base__/graphics/icons/copper-plate.png", icon_size = 64, icon_mipmaps = 4 },
{icon = "__bzgold2__/graphics/icons/rich-copper-ore.png", icon_size = 64, scale=0.25, shift = {-8,8}}, { icon = "__bzgold2__/graphics/icons/rich-copper-ore.png", icon_size = 64, scale = 0.25, shift = { -8, 8 } },
-- {icon = "__bzgold__/graphics/icons/silver-ore.png", icon_size = 128, scale=0.125, shift = {8,8}}, -- {icon = "__bzgold__/graphics/icons/silver-ore.png", icon_size = 128, scale=0.125, shift = {8,8}},
-- {icon = "__bzgold__/graphics/icons/platinum-powder.png", icon_size = 64, scale=0.25, shift = {8,-8}}, -- {icon = "__bzgold__/graphics/icons/platinum-powder.png", icon_size = 64, scale=0.25, shift = {8,-8}},
-- {icon = "__bzgold__/graphics/icons/palladium-powder.png", icon_size = 64, scale=0.25, shift = {-8,-8}}, -- {icon = "__bzgold__/graphics/icons/palladium-powder.png", icon_size = 64, scale=0.25, shift = {-8,-8}},
}, },
energy_required = 6.4, energy_required = 6.4,
ingredients = {{type="item", name="rich-copper-ore", amount=2}}, ingredients = { { type = "item", name = "rich-copper-ore", amount = 2 } },
results = results, results = results,
}, },
}) })
util.add_unlock("platinum-processing", "rich-copper") util.add_unlock("platinum-processing", "rich-copper")
util.add_unlock("palladium-processing", "rich-copper") util.add_unlock("palladium-processing", "rich-copper")
if util.se6() then if util.se6() then
se_resources["rich-copper-ore"] = { se_resources["rich-copper-ore"] = {
order = "b-z-c", order = "b-z-c",
has_starting_area_placement = false, has_starting_area_placement = false,
base_density = 4, base_density = 4,
base_spots_per_km2 = 1, base_spots_per_km2 = 1,
} }
end end
end end
end end

View file

@ -21,6 +21,8 @@ end
util.add_unlock("processing-unit", "cpu") util.add_unlock("processing-unit", "cpu")
util.add_unlock("processing-unit", "mainboard") util.add_unlock("processing-unit", "mainboard")
util.add_prerequisite("coal-liquefaction", "catalysis") if settings.startup["bzgold-catalysis"].value == true then
util.remove_prerequisite("coal-liquefaction", "production-science-pack") util.add_prerequisite("coal-liquefaction", "catalysis")
util.remove_prerequisite("coal-liquefaction", "advanced-oil-processing") util.remove_prerequisite("coal-liquefaction", "production-science-pack")
util.remove_prerequisite("coal-liquefaction", "advanced-oil-processing")
end