fix when flake graphite is off
This commit is contained in:
parent
6272ffadba
commit
b1173d6080
7 changed files with 45 additions and 23 deletions
|
|
@ -90,7 +90,7 @@ if not util.me.use_flake_graphite() then
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "graphite",
|
name = "graphite",
|
||||||
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
||||||
category = mods.bzfoundry and "founding" or "advanced-crafting",
|
category = mods.bzfoundry and "founding" or "crafting",
|
||||||
order = "d[graphite]",
|
order = "d[graphite]",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
energy_required = 0.5,
|
energy_required = 0.5,
|
||||||
|
|
@ -104,7 +104,7 @@ if not util.me.use_flake_graphite() then
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "graphite",
|
name = "graphite",
|
||||||
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size=128,
|
||||||
category = mods.bzfoundry and "founding" or "advanced-crafting",
|
category = mods.bzfoundry and "founding" or "crafting",
|
||||||
subgroup = data.raw.item.graphite.subgroup,
|
subgroup = data.raw.item.graphite.subgroup,
|
||||||
order = "d[graphite]",
|
order = "d[graphite]",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
|
|
@ -117,9 +117,7 @@ if not util.me.use_flake_graphite() then
|
||||||
util.add_prerequisite("graphite-processing", "foundry")
|
util.add_prerequisite("graphite-processing", "foundry")
|
||||||
|
|
||||||
-- Increase richness of coal a bit
|
-- Increase richness of coal a bit
|
||||||
local noise = require('noise');
|
data.raw.resource["coal"].autoplace.richness_expression = data.raw.resource["coal"].autoplace.richness_expression.." * 1.5"
|
||||||
data.raw.resource["coal"].autoplace.richness_expression =
|
|
||||||
data.raw.resource["coal"].autoplace.richness_expression * noise.to_noise_expression(1.5)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -573,7 +571,11 @@ if mods["space-exploration"] and string.sub(mods["space-exploration"], 1, 3) ==
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set early tech tree
|
-- Set early tech tree
|
||||||
|
if util.me.use_flake_graphite() then
|
||||||
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "graphite"})
|
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "graphite"})
|
||||||
|
else
|
||||||
|
util.set_tech_trigger("graphite-processing", {type = "mine-entity", entity = "coal"})
|
||||||
|
end
|
||||||
util.add_prerequisite("graphite-processing", "steam-power")
|
util.add_prerequisite("graphite-processing", "steam-power")
|
||||||
|
|
||||||
if mods["space-age"] then
|
if mods["space-age"] then
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 2.0.6
|
||||||
|
Date: 2025-02-05
|
||||||
|
Fixes:
|
||||||
|
- Fix issues when flake graphite is disabled
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 2.0.5
|
Version: 2.0.5
|
||||||
Date: 2025-02-05
|
Date: 2025-02-05
|
||||||
Changes:
|
Changes:
|
||||||
|
|
|
||||||
|
|
@ -928,7 +928,12 @@ function add_product(recipe, product)
|
||||||
if recipe ~= nil then
|
if recipe ~= nil then
|
||||||
if product.name and data.raw[product.type][product.name] then
|
if product.name and data.raw[product.type][product.name] then
|
||||||
if recipe.results == nil then
|
if recipe.results == nil then
|
||||||
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
|
recipe.results = {}
|
||||||
|
end
|
||||||
|
for _, old in pairs(recipe.results) do
|
||||||
|
if old.name == product.name then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
recipe.result = nil
|
recipe.result = nil
|
||||||
recipe.result_count = nil
|
recipe.result_count = nil
|
||||||
|
|
|
||||||
5
data.lua
5
data.lua
|
|
@ -19,6 +19,8 @@ if mods["aai-vehicles-miner"] then
|
||||||
end
|
end
|
||||||
|
|
||||||
util.add_fluid_mining()
|
util.add_fluid_mining()
|
||||||
|
|
||||||
|
if util.me.use_flake_graphite() then
|
||||||
util.set_tech_trigger("fluid-mining", {type="craft-fluid", fluid="steam", amount=500})
|
util.set_tech_trigger("fluid-mining", {type="craft-fluid", fluid="steam", amount=500})
|
||||||
util.set_prerequisite("fluid-mining", {"steam-power"})
|
util.set_prerequisite("fluid-mining", {"steam-power"})
|
||||||
util.add_unlock("steam-power", "copper-cable")
|
util.add_unlock("steam-power", "copper-cable")
|
||||||
|
|
@ -26,6 +28,9 @@ util.add_unlock("steam-power", "small-electric-pole")
|
||||||
util.set_prerequisite("electric-mining-drill", {"steam-power"})
|
util.set_prerequisite("electric-mining-drill", {"steam-power"})
|
||||||
util.set_tech_trigger("electric-mining-drill", {type="craft-item", item="small-electric-pole", count=10})
|
util.set_tech_trigger("electric-mining-drill", {type="craft-item", item="small-electric-pole", count=10})
|
||||||
util.set_prerequisite("graphite-processing", {"fluid-mining", "electric-mining-drill"})
|
util.set_prerequisite("graphite-processing", {"fluid-mining", "electric-mining-drill"})
|
||||||
|
else
|
||||||
|
util.set_prerequisite("graphite-processing", {})
|
||||||
|
end
|
||||||
util.add_prerequisite("uranium-processing", "sulfur-processing")
|
util.add_prerequisite("uranium-processing", "sulfur-processing")
|
||||||
|
|
||||||
util.add_unlock("graphite-processing", "basic-crusher")
|
util.add_unlock("graphite-processing", "basic-crusher")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bzcarbon",
|
"name": "bzcarbon",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"factorio_version": "2.0",
|
"factorio_version": "2.0",
|
||||||
"title": "Graphite & Diamonds",
|
"title": "Graphite & Diamonds",
|
||||||
"author": "Brevven",
|
"author": "Brevven",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,16 @@
|
||||||
local util = require("data-util");
|
local util = require("data-util");
|
||||||
|
|
||||||
if mods["space-age"] then
|
if mods["space-age"] then
|
||||||
|
local results = {
|
||||||
|
{type = "item", name = "carbonic-asteroid-chunk", amount = 1, probability = 0.1},
|
||||||
|
{type = "item", name = "rough-diamond", amount = 1, probability=0.5},
|
||||||
|
}
|
||||||
|
if util.me.use_flake_graphite() then
|
||||||
|
table.insert(results, {type = "item", name = "flake-graphite", amount = 10})
|
||||||
|
else
|
||||||
|
table.insert(results, {type = "item", name = "graphite", amount = 10})
|
||||||
|
end
|
||||||
|
|
||||||
data:extend({
|
data:extend({
|
||||||
{
|
{
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
|
|
@ -21,12 +31,7 @@ if mods["space-age"] then
|
||||||
{type = "item", name = "carbonic-asteroid-chunk", amount = 1}
|
{type = "item", name = "carbonic-asteroid-chunk", amount = 1}
|
||||||
},
|
},
|
||||||
energy_required = 5,
|
energy_required = 5,
|
||||||
results =
|
results = results,
|
||||||
{
|
|
||||||
{type = "item", name = "flake-graphite", amount = 10},
|
|
||||||
{type = "item", name = "rough-diamond", amount = 1, probability=0.5},
|
|
||||||
{type = "item", name = "carbonic-asteroid-chunk", amount = 1, probability = 0.1}
|
|
||||||
},
|
|
||||||
allow_productivity = true,
|
allow_productivity = true,
|
||||||
allow_decomposition = false
|
allow_decomposition = false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ local resource_autoplace = require('resource-autoplace');
|
||||||
|
|
||||||
local util = require("data-util");
|
local util = require("data-util");
|
||||||
|
|
||||||
|
if util.me.use_flake_graphite() then
|
||||||
|
|
||||||
resource_autoplace.initialize_patch_set("graphite", true)
|
resource_autoplace.initialize_patch_set("graphite", true)
|
||||||
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["graphite"] = {}
|
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["graphite"] = {}
|
||||||
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
||||||
|
|
@ -10,8 +12,6 @@ if mods.tenebris then
|
||||||
data.raw.planet.tenebris.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
data.raw.planet.tenebris.map_gen_settings.autoplace_settings.entity.settings["graphite"] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if util.me.use_flake_graphite() then
|
|
||||||
data:extend({
|
data:extend({
|
||||||
{
|
{
|
||||||
type = "autoplace-control",
|
type = "autoplace-control",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue