From 8eca5c0952638b1a3661b1c2197a3ad7309ca7b0 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 24 Mar 2025 01:12:30 +0100 Subject: [PATCH] Add compatibility for "Crushing Industry" --- lignumis/info.json | 1 + lignumis/locale/en/strings.cfg | 3 + .../compatibility/crushing-industry.lua | 109 ++++++++++++++++++ lignumis/prototypes/compatibility/data.lua | 3 +- 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 lignumis/prototypes/compatibility/crushing-industry.lua diff --git a/lignumis/info.json b/lignumis/info.json index 1d5ecc2..48fd5d4 100644 --- a/lignumis/info.json +++ b/lignumis/info.json @@ -31,6 +31,7 @@ "?atan-nuclear-science", "?lane-splitters", "?wood-industry", + "?crushing-industry", "!planet-picker", "!any-planet-start", "!apm_power_ldinc", diff --git a/lignumis/locale/en/strings.cfg b/lignumis/locale/en/strings.cfg index 37064fc..f7d241e 100644 --- a/lignumis/locale/en/strings.cfg +++ b/lignumis/locale/en/strings.cfg @@ -80,6 +80,7 @@ gold-quality-catalyst=Gold quality catalyst wood-armor=Wood armor wood-darts-magazine=Wood darts magazine basic-circuit-board=Basic circuit board +crushed-gold-ore=Crushed gold ore [item-description] wooden-wall=Use wooden walls to protect your base from the locals and to reduce noise levels. @@ -104,6 +105,7 @@ rocket-fuel-from-wood-pulp-and-peat=Bio-rocket-fuel nutrients-from-wood-pulp=Nutrients from wood pulp active-noise-cancelling=Active noise cancelling casting-gold=Casting gold +gold-ore-crushing=Gold ore crushing [recipe-description] moist-stromatolite-remnant-desiccation-without-steam=Used for balancing the production of steam. @@ -134,6 +136,7 @@ basic-radar=Basic radar active-noise-cancelling=Active noise cancelling quality-assembler=Quality assembler aai-wood-loader=Wood loader +basic-ore-crushing=Basic ore crushing [technology-description] wood-science-pack=Allows research of basic technologies based on wood products. diff --git a/lignumis/prototypes/compatibility/crushing-industry.lua b/lignumis/prototypes/compatibility/crushing-industry.lua new file mode 100644 index 0000000..d1b5bc3 --- /dev/null +++ b/lignumis/prototypes/compatibility/crushing-industry.lua @@ -0,0 +1,109 @@ +local item_sounds = require("__base__.prototypes.item_sounds") +local Technology = require("__cf-lib__/data/Technology") +local Recipe = require("__cf-lib__/data/Recipe") + +if not mods["crushing-industry"] then return end +if not settings.startup["crushing-industry-ore"].value then return end + +data:extend({ + { + type = "item", + name = "crushed-gold-ore", + icon = Lignumis.graphics .. "icons/crushed-gold-ore.png", + pictures = { + { size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore.png", scale = 0.5, mipmap_count = 4 }, + { size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore-1.png", scale = 0.5, mipmap_count = 4 }, + { size = 64, filename = Lignumis.graphics .. "icons/crushed-gold-ore-2.png", scale = 0.5, mipmap_count = 4 }, + }, + subgroup = "raw-resource", + color_hint = { text = "C" }, + order = "f[gold-ore]-c[crushed]", + inventory_move_sound = item_sounds.resource_inventory_move, + pick_sound = item_sounds.resource_inventory_pickup, + drop_sound = item_sounds.resource_inventory_move, + stack_size = 100, + weight = 2 * kg + }, + { + type = "recipe", + name = "crushed-gold-ore", + localised_name = { "recipe-name.gold-ore-crushing" }, + icons = CrushingIndustry.make_crushing_icons("gold-ore"), + category = "basic-crushing", + enabled = false, + allow_productivity = true, + auto_recycle = false, + energy_required = 1.2, + ingredients = { { type = "item", name = "gold-ore", amount = 1 } }, + results = { { type = "item", name = "crushed-gold-ore", amount = 1, extra_count_fraction = 0.5 } }, + main_product = "crushed-gold-ore" + }, + { + type = "recipe", + name = "crushed-gold-smelting", + localised_name = { "recipe-name.crushed-smelting", { "item-name.gold-plate" } }, + icons = { + { icon = Lignumis.graphics .. "icons/crushed-gold-ore.png", shift = { -12, -12 }, scale = 0.4 }, + { icon = Lignumis.graphics .. "icons/gold-plate.png", draw_background = true } + }, + category = "smelting", + order = "a[smelting]-b[gold-plate]-c[crushed]", + enabled = false, + allow_productivity = true, + auto_recycle = false, + hide_from_player_crafting = settings.startup["crushing-industry-hide-player-crafting"].value, + energy_required = 3.2, + ingredients = { { type = "item", name = "crushed-gold-ore", amount = 1 } }, + results = { { type = "item", name = "gold-plate", amount = 1 } }, + main_product = "gold-plate", + }, + { + type = "technology", + name = "basic-ore-crushing", + icon = Lignumis.graphics .. "technology/basic-ore-crushing.png", + icon_size = 256, + effects = { + { type = "unlock-recipe", recipe = "burner-crusher" }, + { type = "unlock-recipe", recipe = "crushed-gold-ore" }, + { type = "unlock-recipe", recipe = "crushed-gold-smelting" } + }, + prerequisites = { "steam-science-pack" }, + unit = { + count = 100, + ingredients = { + { "wood-science-pack", 1 }, + { "steam-science-pack", 1 } + }, + time = 15 + } + } +}) + +if settings.startup["crushing-industry-byproducts"].value then + table.insert(data.raw["recipe"]["crushed-gold-ore"].results, { type = "item", name = "gold-ore", amount = 1, probability = 0.05 }) + table.insert(data.raw["recipe"]["crushed-gold-ore"].results, { type = "item", name = "sand", amount = 1, probability = 0.02 }) +end + +if mods["aai-industry"] then + Technology:new("burner-mechanics"):removeRecipe("burner-crusher") +else + Technology:new("steam-power"):removeRecipe("burner-crusher") +end + + + +local gold_recipe = Recipe:new("burner-crusher") + :replaceIngredient("iron-gear-wheel", "wooden-gear-wheel") + :replaceIngredient("iron-plate", "gold-plate") + +gold_recipe:clone("burner-crusher-copper") + :replaceIngredient("gold-plate", "copper-plate") + :assign({ + localised_name = { "entity-name.burner-crushe" }, + icons = { + { icon = data.raw.item["burner-crusher"].icon }, + { icon = "__base__/graphics/icons/copper-plate.png", scale = 0.25, shift = { 8, 8 } } + } + }) + :unlockedByTechnology("copper-processing") + :apply() \ No newline at end of file diff --git a/lignumis/prototypes/compatibility/data.lua b/lignumis/prototypes/compatibility/data.lua index 8f4bb5b..6d649e2 100644 --- a/lignumis/prototypes/compatibility/data.lua +++ b/lignumis/prototypes/compatibility/data.lua @@ -5,4 +5,5 @@ require("alien-biomes") require("aai-loaders") require("nuclear-science") require("lane-splitters") -require("wood-industry") \ No newline at end of file +require("wood-industry") +require("crushing-industry") \ No newline at end of file