prep for tin

This commit is contained in:
Brevven 2022-07-04 05:48:08 -07:00
parent beb52c8ec6
commit e7ca6e45cf
9 changed files with 35 additions and 4 deletions

View file

@ -1,4 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.1
Date: 2022-07-05
Changes:
- Support for Tin
- Add basic founding recipe category. Pre-founding-tech recipes in this category can be crafted
by hand.
- Minor restructure of refractory recipes (should have no effect)
---------------------------------------------------------------------------------------------------
Version: 0.2.0
Date: 2022-07-01
Changes:

View file

@ -1,4 +1,5 @@
local util = require("data-util")
require("refractory-updates")
-- Prevent production deadlock
if mods.Bio_Industries then

View file

@ -1,2 +1 @@
require("foundry-updates")
require("refractory-updates")

View file

@ -551,7 +551,7 @@ end
-- Set recipe category
function util.set_category(recipe_name, category)
if me.bypass[recipe_name] then return end
if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name] and data.raw["recipe-category"][category] then
me.add_modified(recipe_name)
data.raw.recipe[recipe_name].category = category
end
@ -566,6 +566,14 @@ function util.set_subgroup(recipe_name, subgroup)
end
end
-- Set item subgroup
function util.set_item_subgroup(item, subgroup)
if me.bypass[item] then return end
if data.raw.item[item] and data.raw["item-subgroup"][subgroup] then
data.raw.item[item].subgroup = subgroup
end
end
-- Set recipe icons
function util.set_icons(recipe_name, icons)
if me.bypass[recipe_name] then return end
@ -593,7 +601,7 @@ end
-- Add crafting category to an entity
function util.add_crafting_category(entity_type, entity, category)
if data.raw[entity_type][entity] then
if data.raw[entity_type][entity] and data.raw["recipe-category"][category] then
for i, existing in pairs(data.raw[entity_type][entity].crafting_categories) do
if existing == category then
log(entity.." not adding "..category.." -- duplicate")

View file

@ -15,6 +15,8 @@ if util.me.enable() then
util.set_to_founding("cermet") -- from zirconium
util.set_to_founding("crucible") -- from graphite
util.set_category("solder", "basic-founding")
else
-- If we're not using Foundry buildings, add founding recipes to assemblers in vanilla, or furnaces in K2
local sought = mods.Krastorio2 and "smelting" or "crafting"

View file

@ -1,6 +1,6 @@
{
"name": "bzfoundry",
"version": "0.2.0",
"version": "0.2.1",
"factorio_version": "1.1",
"title": "Foundry",
"author": "Brevven",

View file

@ -3,3 +3,12 @@ data:extend({
{ type = "item-subgroup", name = "founding-machines", group = "production"},
{ type = "item-subgroup", name = "foundry-intermediate", group = "intermediate-products"},
})
if mods.bztin or mods.bzaluminum then
data:extend({
{ type = "recipe-category", name = "basic-founding"},
})
for i, character in pairs(data.raw.character) do
table.insert(character.crafting_categories, "basic-founding")
end
end

View file

@ -158,3 +158,5 @@ data:extend({
},
})
futil.add_crafting_category("assembling-machine", "electric-foundry", "basic-founding")

View file

@ -114,3 +114,5 @@ data:extend({
},
})
futil.add_crafting_category("assembling-machine", "foundry", "basic-founding")