forked from cacklingfiend/lignumis
		
	Add compatibility for "Crushing Industry"
This commit is contained in:
		
							parent
							
								
									07afca839c
								
							
						
					
					
						commit
						8eca5c0952
					
				
					 4 changed files with 115 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -31,6 +31,7 @@
 | 
			
		|||
        "?atan-nuclear-science",
 | 
			
		||||
        "?lane-splitters",
 | 
			
		||||
        "?wood-industry",
 | 
			
		||||
        "?crushing-industry",
 | 
			
		||||
        "!planet-picker",
 | 
			
		||||
        "!any-planet-start",
 | 
			
		||||
        "!apm_power_ldinc",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										109
									
								
								lignumis/prototypes/compatibility/crushing-industry.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								lignumis/prototypes/compatibility/crushing-industry.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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()
 | 
			
		||||
| 
						 | 
				
			
			@ -6,3 +6,4 @@ require("aai-loaders")
 | 
			
		|||
require("nuclear-science")
 | 
			
		||||
require("lane-splitters")
 | 
			
		||||
require("wood-industry")
 | 
			
		||||
require("crushing-industry")
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue