Update to 2.0

This commit is contained in:
Simon Brodtmann 2025-10-04 21:42:12 +02:00
parent 98ea14df52
commit c2b65301fb
21 changed files with 349 additions and 665 deletions

3
.editorconfig Normal file
View file

@ -0,0 +1,3 @@
[*]
indent_style = space
indent_size = 2

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea

View file

@ -15,6 +15,7 @@ See changelog.txt
## Thanks to ## Thanks to
- [Sakuro](https://github.com/sakuro) (expand options, icon tweaks) - [Sakuro](https://github.com/sakuro) (expand options, icon tweaks)
- [Benjah-bmm27](https://commons.wikimedia.org/wiki/User:Benjah-bmm27) ([Formaldehyde icon](https://commons.wikimedia.org/wiki/File:Formaldehyde-3D-vdW.png), public domain) - [Benjah-bmm27](https://commons.wikimedia.org/wiki/User:Benjah-bmm27) ([Formaldehyde icon](https://commons.wikimedia.org/wiki/File:Formaldehyde-3D-vdW.png), public domain)
- [cackling fiend](https://mods.factorio.com/user/cackling.fiend) (Update to 2.0)
### Compatibility ### Compatibility
- [nihilistzsche](https://github.com/nihilistzsche) - [nihilistzsche](https://github.com/nihilistzsche)

View file

@ -1,17 +1,17 @@
local util = require("data-util"); local util = require("data-util");
if mods["248k"] then if mods["248k-Redux"] then
data:extend({ data:extend({
{ {
type = "recipe", type = "recipe",
name = "acid-gas-breakdown", name = "acid-gas-breakdown",
icons = { icons = {
{icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128}, {icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128},
{icon = "__248k__/ressources/fluids/fi_acid_gas.png", icon_size = 64, scale=0.25, shift={-8,-8}}, {icon = "__248k-Redux-graphics__/ressources/fluids/fi_acid_gas.png", icon_size = 64, scale=0.25, shift={-8,-8}},
}, },
category = "chemistry", category = "chemistry",
subgroup = "fi_item_subgroup_f", subgroup = "fi_item_subgroup_f",
enabled = "false", enabled = false,
energy_required = 3, energy_required = 3,
ingredients = { ingredients = {
{type="fluid", name="fi_acid_gas", amount=10}, {type="fluid", name="fi_acid_gas", amount=10},

View file

@ -35,7 +35,7 @@ end
script.on_event(defines.events.on_console_chat, on_console_chat) script.on_event(defines.events.on_console_chat, on_console_chat)
function on_init() function on_init()
if global.starting_spawn then return end if storage.starting_spawn then return end
if settings.global["bzgas-force-spawn"].value then if settings.global["bzgas-force-spawn"].value then
local gas = game.surfaces["nauvis"].find_entities_filtered({area = {{-100, -100}, {100, 100}}, name="gas"}) local gas = game.surfaces["nauvis"].find_entities_filtered({area = {{-100, -100}, {100, 100}}, name="gas"})
if #gas == 0 then if #gas == 0 then
@ -45,7 +45,7 @@ function on_init()
end end
end end
end end
global.starting_spawn = true storage.starting_spawn = true
end end
script.on_init(on_init) script.on_init(on_init)

View file

@ -1,6 +1,5 @@
require("stacking") require("stacking")
require("modules") require("modules")
-- require("tin-recipe-final-5d")
require("compatibility/ir2") require("compatibility/ir2")
local util = require("data-util"); local util = require("data-util");
@ -13,7 +12,7 @@ if mods.Krastorio2 and
data.raw["assembling-machine"]["basic-chemical-plant"] and data.raw["assembling-machine"]["basic-chemical-plant"] and
data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and
data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories then data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories then
table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "vehicle-fuel") table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "kr-vehicle-fuel")
end end
-- Vanilla burner phase tweaks -- green circuits after electronics -- Vanilla burner phase tweaks -- green circuits after electronics

View file

@ -64,16 +64,6 @@ function util.fe_plus(sub)
end end
end end
function util.get_stack_size(default)
if mods.Krastorio2 then
local size = get_setting("kr-stack-size")
if size and tonumber(size) then
return tonumber(size)
end
end
return default
end
function util.k2assets() function util.k2assets()
if mods["Krastorio2Assets"] then if mods["Krastorio2Assets"] then
return "__Krastorio2Assets__" return "__Krastorio2Assets__"
@ -111,8 +101,8 @@ function util.se_landfill(params)
category = "hard-recycling", category = "hard-recycling",
order = "z-b-"..params.ore, order = "z-b-"..params.ore,
subgroup = "terrain", subgroup = "terrain",
result = "landfill", results = {{type="item", name="landfill", amount=1}},
ingredients = {{params.ore, 50}}, ingredients = {{type="item", name=params.ore, amount=50}},
} }
}) })
util.add_unlock("se-recycling-facility", lname) util.add_unlock("se-recycling-facility", lname)
@ -123,7 +113,7 @@ end
-- k2 matter -- k2 matter
-- params: {k2matter}, k2baseicon , {icon} -- params: {k2matter}, k2baseicon , {icon}
function util.k2matter(params) function util.k2matter(params)
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") local matter = require("__Krastorio2__/prototypes/libraries/matter")
if mods["space-exploration"] then if mods["space-exploration"] then
params.k2matter.need_stabilizer = true params.k2matter.need_stabilizer = true
end end
@ -169,15 +159,15 @@ function util.k2matter(params)
{ {
{"production-science-pack", 1}, {"production-science-pack", 1},
{"utility-science-pack", 1}, {"utility-science-pack", 1},
{"matter-tech-card", 1} {"kr-matter-tech-card", 1}
}, },
time = 45, time = 45,
}, },
-- (ignore for now) localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
}, },
}) })
end end
matter.createMatterRecipe(params.k2matter) matter.make_recipes(params.k2matter)
end end
@ -211,16 +201,16 @@ function util.se_matter(params)
energy_required = params.energy_required, energy_required = params.energy_required,
enabled = false, enabled = false,
ingredients = { ingredients = {
{sedata, 1}, {type="item", name=sedata, amount=1},
{type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-particle-stream", amount=50},
{type="fluid", name="se-space-coolant-supercooled", amount=25}, {type="fluid", name="se-space-coolant-supercooled", amount=25},
}, },
results = { results = {
{params.ore, params.quant_out}, {type="item", name=params.ore, amount=params.quant_out},
{"se-contaminated-scrap", 1}, {type="item", name="se-contaminated-scrap", amount=1},
{type=item, name=sedata, amount=1, probability=.99}, {type="item", name=sedata, amount=1, probability=.99},
{type=item, name=sejunk, amount=1, probability=.01}, {type="item", name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25}, {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity=25},
} }
} }
}) })
@ -250,14 +240,14 @@ function util.se_matter(params)
energy_required = 30, energy_required = 30,
enabled = false, enabled = false,
ingredients = { ingredients = {
{"se-kr-matter-liberation-data", 1}, {type="item", name="se-kr-matter-liberation-data", amount=1},
{params.ore, params.quant_in}, {type="item", name=params.ore, amount=params.quant_in},
{type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-particle-stream", amount=50},
}, },
results = { results = {
{type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99}, {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99},
{type=item, name=sejunk, amount=1, probability=.01}, {type="item", name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50}, {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity=50},
} }
} }
}) })
@ -284,7 +274,7 @@ function util.se_matter(params)
{"se-astronomic-science-pack-4", 1}, {"se-astronomic-science-pack-4", 1},
{"se-energy-science-pack-4", 1}, {"se-energy-science-pack-4", 1},
{"se-material-science-pack-4", 1}, {"se-material-science-pack-4", 1},
{"matter-tech-card", 1}, {"kr-matter-tech-card", 1},
{"se-deep-space-science-pack-1", 1}, {"se-deep-space-science-pack-1", 1},
} }
@ -298,18 +288,6 @@ function util.se_matter(params)
end end
end end
-- Get the normal prototype for a recipe -- either .normal or the recipe itself
function util.get_normal(recipe_name)
if data.raw.recipe[recipe_name] then
recipe = data.raw.recipe[recipe_name]
if recipe.normal and recipe.normal.ingredients then
return recipe.normal
elseif recipe.ingredients then
return recipe
end
end
end
-- Set/override a technology's prerequisites -- Set/override a technology's prerequisites
function util.set_prerequisite(technology_name, prerequisites) function util.set_prerequisite(technology_name, prerequisites)
local technology = data.raw.technology[technology_name] local technology = data.raw.technology[technology_name]
@ -376,7 +354,7 @@ function util.add_unlock(technology_name, recipe)
end end
-- Check if a tech unlocks a recipe -- Check if a tech unlocks a recipe
function util.check_unlock(technology_name, recipe_name) function util.check_unlock(technology_name, recipe)
local technology = data.raw.technology[technology_name] local technology = data.raw.technology[technology_name]
if technology and technology.effects then if technology and technology.effects then
for i, effect in pairs(technology.effects) do for i, effect in pairs(technology.effects) do
@ -421,17 +399,13 @@ end
function util.set_enabled(recipe_name, enabled) function util.set_enabled(recipe_name, enabled)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.enabled = enabled end data.raw.recipe[recipe_name].enabled = enabled
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.enabled = enabled end
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].enabled = enabled end
end end
end end
function util.set_hidden(recipe_name) function util.set_hidden(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.hidden = true end data.raw.recipe[recipe_name].hidden = true
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.hidden = true end
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].hidden = true end
end end
end end
@ -441,8 +415,6 @@ function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity, option
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
me.add_modified(recipe_name) me.add_modified(recipe_name)
add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
add_or_add_to_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
add_or_add_to_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
end end
end end
@ -465,8 +437,6 @@ function util.add_ingredient(recipe_name, ingredient, quantity, options)
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then
me.add_modified(recipe_name) me.add_modified(recipe_name)
add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid) add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid)
add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity, is_fluid)
add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity, is_fluid)
end end
end end
@ -480,7 +450,7 @@ function add_ingredient(recipe, ingredient, quantity, is_fluid)
if is_fluid then if is_fluid then
table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity}) table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity})
else else
table.insert(recipe.ingredients, {ingredient, quantity}) table.insert(recipe.ingredients, {type="item", name=ingredient, amount=quantity})
end end
end end
end end
@ -491,8 +461,6 @@ function util.add_ingredient_raw(recipe_name, ingredient, options)
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then
me.add_modified(recipe_name) me.add_modified(recipe_name)
add_ingredient_raw(data.raw.recipe[recipe_name], ingredient) add_ingredient_raw(data.raw.recipe[recipe_name], ingredient)
add_ingredient_raw(data.raw.recipe[recipe_name].normal, ingredient)
add_ingredient_raw(data.raw.recipe[recipe_name].expensive, ingredient)
end end
end end
@ -516,8 +484,6 @@ function util.set_ingredient(recipe_name, ingredient, quantity, options)
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
me.add_modified(recipe_name) me.add_modified(recipe_name)
set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
set_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
set_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
end end
end end
@ -542,28 +508,17 @@ end
function util.add_product(recipe_name, product, options) function util.add_product(recipe_name, product, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] and if data.raw.recipe[recipe_name] and
(data.raw.item[product[1]] or data.raw.item[product.name] or (data.raw.item[product.name] or data.raw.fluid[product.name]) then
data.raw.fluid[product[1]] or data.raw.fluid[product.name]
) then
add_product(data.raw.recipe[recipe_name], product) add_product(data.raw.recipe[recipe_name], product)
add_product(data.raw.recipe[recipe_name].normal, product)
add_product(data.raw.recipe[recipe_name].expensive, product)
end end
end end
function add_product(recipe, product) function add_product(recipe, product)
if recipe ~= nil then if recipe ~= nil then
if (product[1] and data.raw.item[product[1]]) or if recipe.results == nil then
(product.name and data.raw[product.type][product.name]) then recipe.results = {}
if not recipe.normal then
if recipe.results == nil then
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
end
recipe.result = nil
recipe.result_count = nil
table.insert(recipe.results, product)
end end
end table.insert(recipe.results, product)
end end
end end
@ -571,18 +526,13 @@ end
function util.get_ingredient_amount(recipe_name, ingredient_name) function util.get_ingredient_amount(recipe_name, ingredient_name)
local recipe = data.raw.recipe[recipe_name] local recipe = data.raw.recipe[recipe_name]
if recipe then if recipe then
if recipe.normal and recipe.normal.ingredients then if recipe.ingredients then
for i, ingredient in pairs(recipe.normal.ingredients) do
if ingredient[1] == ingredient_name then return ingredient[2] end
if ingredient.name == ingredient_name then return ingredient.amount end
end
elseif recipe.ingredients then
for i, ingredient in pairs(recipe.ingredients) do for i, ingredient in pairs(recipe.ingredients) do
if ingredient[1] == ingredient_name then return ingredient[2] end if ingredient[1] == ingredient_name then return ingredient[2] end
if ingredient.name == ingredient_name then return ingredient.amount end if ingredient.name == ingredient_name then return ingredient.amount end
end end
end end
return 0 return 1
end end
return 0 return 0
end end
@ -592,14 +542,7 @@ function util.get_amount(recipe_name, product)
if not product then product = recipe_name end if not product then product = recipe_name end
local recipe = data.raw.recipe[recipe_name] local recipe = data.raw.recipe[recipe_name]
if recipe then if recipe then
if recipe.normal and recipe.normal.results then if recipe.results then
for i, result in pairs(recipe.normal.results) do
if result[1] == product then return result[2] end
if result.name == product then return result.amount end
end
elseif recipe.normal and recipe.normal.result_count then
return recipe.normal.result_count
elseif recipe.results then
for i, result in pairs(recipe.results) do for i, result in pairs(recipe.results) do
if result[1] == product then return result[2] end if result[1] == product then return result[2] end
if result.name == product then return result.amount end if result.name == product then return result.amount end
@ -617,9 +560,7 @@ function util.get_result_count(recipe_name, product)
if not product then product = recipe_name end if not product then product = recipe_name end
local recipe = data.raw.recipe[recipe_name] local recipe = data.raw.recipe[recipe_name]
if recipe then if recipe then
if recipe.normal and recipe.normal.results then if recipe.results then
return #(recipe.normal.results)
elseif recipe.results then
return #(recipe.results) return #(recipe.results)
end end
return 1 return 1
@ -634,8 +575,6 @@ function util.replace_ingredient(recipe_name, old, new, amount, multiply, option
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
me.add_modified(recipe_name) me.add_modified(recipe_name)
replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply) replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply)
replace_ingredient(data.raw.recipe[recipe_name].normal, old, new, amount, multiply)
replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new, amount, multiply)
end end
end end
@ -677,8 +616,6 @@ function util.remove_ingredient(recipe_name, old, options)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name) me.add_modified(recipe_name)
remove_ingredient(data.raw.recipe[recipe_name], old) remove_ingredient(data.raw.recipe[recipe_name], old)
remove_ingredient(data.raw.recipe[recipe_name].normal, old)
remove_ingredient(data.raw.recipe[recipe_name].expensive, old)
end end
end end
@ -704,28 +641,23 @@ function util.replace_some_product(recipe_name, old, old_amount, new, new_amount
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
me.add_modified(recipe_name) me.add_modified(recipe_name)
replace_some_product(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) replace_some_product(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
replace_some_product(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
replace_some_product(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
end end
end end
function replace_some_product(recipe, old, old_amount, new, new_amount) function replace_some_product(recipe, old, old_amount, new, new_amount, is_fluid)
if recipe ~= nil then if recipe ~= nil then
if recipe.result == new then return end if recipe.result == new then return end
if recipe.results then if recipe.results then
for i, existing in pairs(recipe.results) do for i, existing in pairs(recipe.results) do
if existing[1] == new or existing.name == new then if existing.name == new then
return return
end end
end end
end end
add_product(recipe, {new, new_amount}) add_product(recipe, {type=is_fluid and "fluid" or "item", name=new, amount=new_amount})
for i, product in pairs(recipe.results) do for i, product in pairs(recipe.results) do
if product.name == old then if product.name == old then
product.amount = math.max(1, product.amount - old_amount) product.amount = math.max(1, product.amount - old_amount)
end
if product[1] == old then
product[2] = math.max(1, product[2] - old_amount)
end end
end end
end end
@ -738,8 +670,6 @@ function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amo
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
me.add_modified(recipe_name) me.add_modified(recipe_name)
replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
end end
end end
@ -768,8 +698,6 @@ function util.set_product_amount(recipe_name, product, amount, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
set_product_amount(data.raw.recipe[recipe_name], product, amount) set_product_amount(data.raw.recipe[recipe_name], product, amount)
set_product_amount(data.raw.recipe[recipe_name].normal, product, amount)
set_product_amount(data.raw.recipe[recipe_name].expensive, product, amount)
end end
end end
@ -808,8 +736,6 @@ function util.multiply_recipe(recipe_name, multiple, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
multiply_recipe(data.raw.recipe[recipe_name], multiple) multiply_recipe(data.raw.recipe[recipe_name], multiple)
multiply_recipe(data.raw.recipe[recipe_name].normal, multiple)
multiply_recipe(data.raw.recipe[recipe_name].expensive, multiple)
end end
end end
@ -817,8 +743,6 @@ function multiply_recipe(recipe, multiple)
if recipe then if recipe then
if recipe.energy_required then if recipe.energy_required then
recipe.energy_required = recipe.energy_required * multiple recipe.energy_required = recipe.energy_required * multiple
else
recipe.energy_required = 0.5 * multiple -- 0.5 is factorio default
end end
if recipe.result_count then if recipe.result_count then
recipe.result_count = recipe.result_count * multiple recipe.result_count = recipe.result_count * multiple
@ -833,8 +757,8 @@ function multiply_recipe(recipe, multiple)
result.amount_min = result.amount_min * multiple result.amount_min = result.amount_min * multiple
result.amount_max = result.amount_max * multiple result.amount_max = result.amount_max * multiple
end end
if result.catalyst_amount then if result.ignored_by_productivity then
result.catalyst_amount = result.catalyst_amount * multiple result.ignored_by_productivity = result.ignored_by_productivity * multiple
end end
end end
if result[1] then if result[1] then
@ -861,9 +785,8 @@ end
-- Returns true if a recipe has an ingredient -- Returns true if a recipe has an ingredient
function util.has_ingredient(recipe_name, ingredient) function util.has_ingredient(recipe_name, ingredient)
return data.raw.recipe[recipe_name] and ( return data.raw.recipe[recipe_name] and
has_ingredient(data.raw.recipe[recipe_name], ingredient) or has_ingredient(data.raw.recipe[recipe_name], ingredient)
has_ingredient(data.raw.recipe[recipe_name].normal, ingredient))
end end
function has_ingredient(recipe, ingredient) function has_ingredient(recipe, ingredient)
@ -883,8 +806,6 @@ function util.remove_product(recipe_name, old, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
remove_product(data.raw.recipe[recipe_name], old) remove_product(data.raw.recipe[recipe_name], old)
remove_product(data.raw.recipe[recipe_name].normal, old)
remove_product(data.raw.recipe[recipe_name].expensive, old)
end end
end end
@ -907,8 +828,6 @@ function util.set_main_product(recipe_name, product, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
set_main_product(data.raw.recipe[recipe_name], product) set_main_product(data.raw.recipe[recipe_name], product)
set_main_product(data.raw.recipe[recipe_name].normal, product)
set_main_product(data.raw.recipe[recipe_name].expensive, product)
end end
end end
@ -922,13 +841,11 @@ end
function util.replace_product(recipe_name, old, new, options) function util.replace_product(recipe_name, old, new, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
replace_product(data.raw.recipe[recipe_name], old, new, options) replace_product(data.raw.recipe[recipe_name], old, new)
replace_product(data.raw.recipe[recipe_name].normal, old, new, options)
replace_product(data.raw.recipe[recipe_name].expensive, old, new, options)
end end
end end
function replace_product(recipe, old, new, options) function replace_product(recipe, old, new)
if recipe then if recipe then
if recipe.main_product == old then if recipe.main_product == old then
recipe.main_product = new recipe.main_product = new
@ -968,8 +885,6 @@ function util.set_recipe_time(recipe_name, time, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
set_recipe_time(data.raw.recipe[recipe_name], time) set_recipe_time(data.raw.recipe[recipe_name], time)
set_recipe_time(data.raw.recipe[recipe_name].normal, time)
set_recipe_time(data.raw.recipe[recipe_name].expensive, time)
end end
end end
@ -987,8 +902,6 @@ function util.multiply_time(recipe_name, factor, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
multiply_time(data.raw.recipe[recipe_name], factor) multiply_time(data.raw.recipe[recipe_name], factor)
multiply_time(data.raw.recipe[recipe_name].normal, factor)
multiply_time(data.raw.recipe[recipe_name].expensive, factor)
end end
end end
@ -1006,8 +919,6 @@ function util.add_time(recipe_name, amount, options)
me.add_modified(recipe_name) me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
add_time(data.raw.recipe[recipe_name], amount) add_time(data.raw.recipe[recipe_name], amount)
add_time(data.raw.recipe[recipe_name].normal, amount)
add_time(data.raw.recipe[recipe_name].expensive, amount)
end end
end end
@ -1031,7 +942,7 @@ end
-- Set recipe subgroup -- Set recipe subgroup
function util.set_subgroup(recipe_name, subgroup, options) function util.set_subgroup(recipe_name, subgroup, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] and data.raw["item-subgroup"][subgroup] then if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name) me.add_modified(recipe_name)
data.raw.recipe[recipe_name].subgroup = subgroup data.raw.recipe[recipe_name].subgroup = subgroup
end end
@ -1050,34 +961,16 @@ function util.add_icon(recipe_name, icon, options)
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name) me.add_modified(recipe_name)
if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then
if data.raw.recipe[recipe_name].icon then data.raw.recipe[recipe_name].icons = {}
data.raw.recipe[recipe_name].icons = {{ if data.raw.recipe[recipe_name].icon then
icon=data.raw.recipe[recipe_name].icon, data.raw.recipe[recipe_name].icons = {{
icon_size=data.raw.recipe[recipe_name].icon_size, icon=data.raw.recipe[recipe_name].icon,
icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps, icon_size=data.raw.recipe[recipe_name].icon_size,
}} icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps,
elseif data.raw.item[data.raw.recipe[recipe_name].main_product] then }}
data.raw.recipe[recipe_name].icons = {{ data.raw.recipe[recipe_name].icon = nil
icon=data.raw.item[data.raw.recipe[recipe_name].main_product].icon, data.raw.recipe[recipe_name].icon_size = nil
icon_size=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_size, end
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_mipmaps,
}}
elseif data.raw.item[data.raw.recipe[recipe_name].result] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].result].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
}}
elseif data.raw.recipe[recipe_name].normal and
data.raw.item[data.raw.recipe[recipe_name].normal.result] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps,
}}
end
data.raw.recipe[recipe_name].icon = nil
data.raw.recipe[recipe_name].icon_size = nil
end end
table.insert(data.raw.recipe[recipe_name].icons, icon) table.insert(data.raw.recipe[recipe_name].icons, icon)
end end
@ -1137,8 +1030,6 @@ function util.add_to_ingredient(recipe, ingredient, amount, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe] then if data.raw.recipe[recipe] then
add_to_ingredient(data.raw.recipe[recipe], ingredient, amount) add_to_ingredient(data.raw.recipe[recipe], ingredient, amount)
add_to_ingredient(data.raw.recipe[recipe].normal, ingredient, amount)
add_to_ingredient(data.raw.recipe[recipe].expensive, ingredient, amount)
end end
end end
@ -1161,8 +1052,6 @@ function util.add_to_product(recipe_name, product, amount, options)
if not should_force(options) and bypass(recipe_name) then return end if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then if data.raw.recipe[recipe_name] then
add_to_product(data.raw.recipe[recipe_name], product, amount) add_to_product(data.raw.recipe[recipe_name], product, amount)
add_to_product(data.raw.recipe[recipe_name].normal, product, amount)
add_to_product(data.raw.recipe[recipe_name].expensive, product, amount)
end end
end end
@ -1285,10 +1174,8 @@ function remove_prior_unlocks(tech, recipe)
util.remove_recipe_effect(tech, recipe) util.remove_recipe_effect(tech, recipe)
if technology.prerequisites then if technology.prerequisites then
for i, prerequisite in pairs(technology.prerequisites) do for i, prerequisite in pairs(technology.prerequisites) do
if string.sub(prerequisite, 1, 3) ~= 'ei_' then -- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
-- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| remove_prior_unlocks(prerequisite, recipe)
remove_prior_unlocks(prerequisite, recipe)
end
end end
end end
end end
@ -1330,9 +1217,7 @@ function replace_ingredients_prior_to(tech, old, new, multiplier)
if technology.prerequisites then if technology.prerequisites then
for i, prerequisite in pairs(technology.prerequisites) do for i, prerequisite in pairs(technology.prerequisites) do
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :| -- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
if string.sub(prerequisite, 1, 3) ~= 'ei_' then replace_ingredients_prior_to(prerequisite, old, new, multiplier)
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
end
end end
end end
end end

View file

@ -15,82 +15,48 @@ gf_boiler_entity.fast_replaceable_group = "boiler"
gf_boiler_entity.energy_source = { gf_boiler_entity.energy_source = {
type = "fluid", type = "fluid",
fluid_box = { fluid_box = {
base_area = 1, volume = 100,
height = 1,
base_level = -1,
pipe_covers = pipecoverspictures(), pipe_covers = pipecoverspictures(),
pipe_picture = { pipe_picture = {
north = { north = {
filename = gd.."/graphics/entity/" filename = gd.."/graphics/entity/"
.."assembling-machine-1-pipe-N.png", .."hr-assembling-machine-1-pipe-N.png",
priority = "extra-high", priority = "extra-high",
width = 35, width = 71,
height = 18, height = 38,
shift = util.by_pixel(2.5, 14), shift = util.by_pixel(2.25, 13.5),
hr_version = { scale = 0.5
filename = gd.."/graphics/entity/"
.."hr-assembling-machine-1-pipe-N.png",
priority = "extra-high",
width = 71,
height = 38,
shift = util.by_pixel(2.25, 13.5),
scale = 0.5
}
}, },
east = { east = {
filename = gd.."/graphics/entity/" filename = gd.."/graphics/entity/"
.."assembling-machine-1-pipe-E.png", .."hr-assembling-machine-1-pipe-E.png",
priority = "extra-high", priority = "extra-high",
width = 20, width = 42,
height = 38, height = 76,
shift = util.by_pixel(-25, 1), shift = util.by_pixel(-24.5, 1),
hr_version = { scale = 0.5
filename = gd.."/graphics/entity/"
.."hr-assembling-machine-1-pipe-E.png",
priority = "extra-high",
width = 42,
height = 76,
shift = util.by_pixel(-24.5, 1),
scale = 0.5
}
}, },
south = { south = {
filename = gd.."/graphics/entity/" filename = gd.."/graphics/entity/"
.."assembling-machine-1-pipe-S.png", .."hr-assembling-machine-1-pipe-S.png",
priority = "extra-high", priority = "extra-high",
width = 44, width = 88,
height = 31, height = 61,
shift = util.by_pixel(0, -31.5), shift = util.by_pixel(0, -31.25),
hr_version = { scale = 0.5
filename = gd.."/graphics/entity/"
.."hr-assembling-machine-1-pipe-S.png",
priority = "extra-high",
width = 88,
height = 61,
shift = util.by_pixel(0, -31.25),
scale = 0.5
}
}, },
west = { west = {
filename = gd.."/graphics/entity/" filename = gd.."/graphics/entity/"
.."assembling-machine-1-pipe-W.png", .."hr-assembling-machine-1-pipe-W.png",
priority = "extra-high", priority = "extra-high",
width = 19, width = 39,
height = 37, height = 73,
shift = util.by_pixel(25.5, 1.5), shift = util.by_pixel(25.75, 1.25),
hr_version = { scale = 0.5
filename = gd.."/graphics/entity/"
.."hr-assembling-machine-1-pipe-W.png",
priority = "extra-high",
width = 39,
height = 73,
shift = util.by_pixel(25.75, 1.25),
scale = 0.5
}
} }
}, },
pipe_connections = { pipe_connections = {
{type = "input", position = {0, 1.5}}, {direction = defines.direction.south, flow_direction = "input", position = {0, 0.5}},
}, },
production_type = "input", production_type = "input",
secondary_draw_orders = { secondary_draw_orders = {
@ -102,7 +68,7 @@ gf_boiler_entity.energy_source = {
}, },
burns_fluid = true, burns_fluid = true,
scale_fluid_usage = true, scale_fluid_usage = true,
emissions_per_minute = 30, emissions_per_minute = { pollution = 30 },
smoke = {{ smoke = {{
name = "smoke", name = "smoke",
north_position = util.by_pixel(-38, -47.5), north_position = util.by_pixel(-38, -47.5),
@ -121,43 +87,34 @@ gf_boiler_entity.energy_source = {
} }
gf_boiler_entity.fire_flicker_enabled = false gf_boiler_entity.fire_flicker_enabled = false
gf_boiler_entity.fire_glow_flicker_enabled = false gf_boiler_entity.fire_glow_flicker_enabled = false
gf_boiler_entity.fire = {} gf_boiler_entity.pictures.north.fire = nil
gf_boiler_entity.fire_glow.north.filename = gf_boiler_entity.pictures.south.fire = nil
gd.."/graphics/entity/".. gf_boiler_entity.pictures.east.fire = nil
"gas-boiler-N-light.png" gf_boiler_entity.pictures.west.fire = nil
gf_boiler_entity.fire_glow.south.filename = gf_boiler_entity.pictures.north.fire_glow.filename =
gd.."/graphics/entity/"..
"gas-boiler-S-light.png"
gf_boiler_entity.fire_glow.east.filename =
gd.."/graphics/entity/"..
"gas-boiler-E-light.png"
gf_boiler_entity.fire_glow.west.filename =
gd.."/graphics/entity/"..
"gas-boiler-W-light.png"
gf_boiler_entity.fire_glow.north.hr_version.filename =
gd.."/graphics/entity/".. gd.."/graphics/entity/"..
"hr-gas-boiler-N-light.png" "hr-gas-boiler-N-light.png"
gf_boiler_entity.fire_glow.south.hr_version.filename = gf_boiler_entity.pictures.south.fire_glow.filename =
gd.."/graphics/entity/".. gd.."/graphics/entity/"..
"hr-gas-boiler-S-light.png" "hr-gas-boiler-S-light.png"
gf_boiler_entity.fire_glow.east.hr_version.filename = gf_boiler_entity.pictures.east.fire_glow.filename =
gd.."/graphics/entity/".. gd.."/graphics/entity/"..
"hr-gas-boiler-E-light.png" "hr-gas-boiler-E-light.png"
gf_boiler_entity.fire_glow.west.hr_version.filename = gf_boiler_entity.pictures.west.fire_glow.filename =
gd.."/graphics/entity/".. gd.."/graphics/entity/"..
"hr-gas-boiler-W-light.png" "hr-gas-boiler-W-light.png"
gf_boiler_entity.fire_glow.north.apply_runtime_tint = true gf_boiler_entity.pictures.north.fire_glow.apply_runtime_tint = true
gf_boiler_entity.fire_glow.south.apply_runtime_tint = true gf_boiler_entity.pictures.south.fire_glow.apply_runtime_tint = true
gf_boiler_entity.fire_glow.east.apply_runtime_tint = true gf_boiler_entity.pictures.east.fire_glow.apply_runtime_tint = true
gf_boiler_entity.fire_glow.west.apply_runtime_tint = true gf_boiler_entity.pictures.west.fire_glow.apply_runtime_tint = true
gf_boiler_entity.fire_glow.north.tint={r=1,g=0.6,b=0.6,a=0.4} gf_boiler_entity.pictures.north.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4}
gf_boiler_entity.fire_glow.south.tint={r=1,g=0.6,b=0.6,a=0.4} gf_boiler_entity.pictures.south.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4}
gf_boiler_entity.fire_glow.east.tint={r=1,g=0.6,b=0.6,a=0.4} gf_boiler_entity.pictures.east.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4}
gf_boiler_entity.fire_glow.west.tint={r=1,g=0.6,b=0.6,a=0.4} gf_boiler_entity.pictures.west.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4}
gf_boiler_entity.fire_glow.north.blend_mode = "additive-soft" gf_boiler_entity.pictures.north.fire_glow.blend_mode = "additive-soft"
gf_boiler_entity.fire_glow.south.blend_mode = "additive-soft" gf_boiler_entity.pictures.south.fire_glow.blend_mode = "additive-soft"
gf_boiler_entity.fire_glow.east.blend_mode = "additive-soft" gf_boiler_entity.pictures.east.fire_glow.blend_mode = "additive-soft"
gf_boiler_entity.fire_glow.west.blend_mode = "additive-soft" gf_boiler_entity.pictures.west.fire_glow.blend_mode = "additive-soft"
gf_boiler_item = util.table.deepcopy(data.raw.item.boiler) gf_boiler_item = util.table.deepcopy(data.raw.item.boiler)
@ -171,12 +128,10 @@ gf_boiler_recipe = {
type = "recipe", type = "recipe",
name = "gas-boiler", name = "gas-boiler",
enabled = false, enabled = false,
ingredients = {{ ingredients = {
"boiler",1 { type = "item", name = "boiler", amount = 1 },
},{ { type = "item", name = "pump", amount = 1 }},
"pump",1 results = {{ type = "item", name = "gas-boiler", amount = 1 }}
}},
result = "gas-boiler"
} }
data:extend({ data:extend({

View file

@ -1700,9 +1700,6 @@ end
set_shift = function(shift, tab) set_shift = function(shift, tab)
tab.shift = shift tab.shift = shift
if tab.hr_version then
tab.hr_version.shift = shift
end
return tab return tab
end end
@ -1729,16 +1726,10 @@ end
empty_sprite = function() empty_sprite = function()
return { return {
filename = "__core__/graphics/empty.png", filename = "__core__/graphics/empty.png",
priority = "extra-high", priority = "extra-high",
width = 1, width = 1,
height = 1, height = 1,
hr_version = {
filename = "__core__/graphics/empty.png",
priority = "extra-high",
width = 1,
height = 1,
}
} }
end end
@ -1750,209 +1741,104 @@ centrifuge_idle_layers = function(size,speed)
local size = number_or_one(size) local size = number_or_one(size)
local speed = number_or_one(speed) local speed = number_or_one(speed)
return {{ return {{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-C.png", .."centrifuge/hr-centrifuge-C.png",
priority = "extra-high", priority = "extra-high",
line_length = 8, scale = size*0.5,
width = 119, line_length = 8,
height = 107, width = 237,
scale = size, height = 214,
frame_count = 64, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
-0.5, -0.25,
-26.5 -26.5
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-C.png",
priority = "extra-high",
scale = size*0.5,
line_length = 8,
width = 237,
height = 214,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
-0.25,
-26.5
)
}
},{ },{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-C-shadow.png", .."centrifuge/hr-centrifuge-C-shadow.png",
draw_as_shadow = true, draw_as_shadow = true,
priority = "extra-high", priority = "extra-high",
line_length = 8, scale = size*0.5,
width = 132, line_length = 8,
height = 74, width = 279,
frame_count = 64, height = 152,
scale = size, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
20, 16.75,
-10 -10
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-C-shadow.png",
draw_as_shadow = true,
priority = "extra-high",
scale = size*0.5,
line_length = 8,
width = 279,
height = 152,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
16.75,
-10
)
}
},{ },{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-B.png", .."centrifuge/hr-centrifuge-B.png",
priority = "extra-high", priority = "extra-high",
line_length = 8, scale = size*0.5,
width = 78, line_length = 8,
height = 117, width = 156,
scale = size, height = 234,
frame_count = 64, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
23, 23,
6.5 6.5
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-B.png",
priority = "extra-high",
scale = size*0.5,
line_length = 8,
width = 156,
height = 234,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
23,
6.5
)
}
},{ },{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-B-shadow.png", .."centrifuge/hr-centrifuge-B-shadow.png",
draw_as_shadow = true, draw_as_shadow = true,
priority = "extra-high", priority = "extra-high",
line_length = 8, scale = size*0.5,
width = 124, line_length = 8,
height = 74, width = 251,
frame_count = 64, height = 149,
scale = size, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
63, 63.25,
16 15.25
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-B-shadow.png",
draw_as_shadow = true,
priority = "extra-high",
scale = size*0.5,
line_length = 8,
width = 251,
height = 149,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
63.25,
15.25
)
}
},{ },{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-A.png", .."centrifuge/hr-centrifuge-A.png",
priority = "extra-high", priority = "extra-high",
line_length = 8, scale = size*0.5,
width = 70, line_length = 8,
height = 123, width = 139,
scale = size, height = 246,
frame_count = 64, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
-26, -26.25,
3.5 3.5
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-A.png",
priority = "extra-high",
scale = size*0.5,
line_length = 8,
width = 139,
height = 246,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
-26.25,
3.5
)
}
},{ },{
filename = filename =
"__base__/graphics/entity/" "__base__/graphics/entity/"
.."centrifuge/centrifuge-A-shadow.png", .."centrifuge/hr-centrifuge-A-shadow.png",
priority = "extra-high", priority = "extra-high",
draw_as_shadow = true, draw_as_shadow = true,
line_length = 8, scale = size*0.5,
width = 108, line_length = 8,
height = 54, width = 230,
frame_count = 64, height = 124,
scale = size, frame_count = 64,
animation_speed = speed, animation_speed = speed,
shift = shift =
util.by_pixel( util.by_pixel(
6, 8.5,
27 23.5
), )
hr_version = {
filename =
"__base__/graphics/entity/"
.."centrifuge/hr-centrifuge-A-shadow.png",
priority = "extra-high",
draw_as_shadow = true,
scale = size*0.5,
line_length = 8,
width = 230,
height = 124,
frame_count = 64,
animation_speed = speed,
shift =
util.by_pixel(
8.5,
23.5
)
}
}} }}
end end

View file

@ -15,8 +15,8 @@ data.raw["utility-constants"]["default"].main_menu_simulations["gas-rig"] = {
[[ [[
local logo = game.surfaces.nauvis.find_entities_filtered{ local logo = game.surfaces.nauvis.find_entities_filtered{
name = "factorio-logo-16tiles", limit = 1}[1] name = "factorio-logo-16tiles", limit = 1}[1]
game.camera_position = {logo.position.x, logo.position.y+14} game.simulation.camera_position = {logo.position.x, logo.position.y+14}
game.camera_zoom = 0.75 game.simulation.camera_zoom = 0.75
game.tick_paused = false game.tick_paused = false
game.surfaces.nauvis.daytime = 0 game.surfaces.nauvis.daytime = 0
]], ]],

View file

@ -1,25 +1,25 @@
{ {
"name": "bzgas", "name": "bzgas",
"version": "0.1.17", "version": "2.0.0",
"factorio_version": "1.1", "factorio_version": "2.0",
"title": "Natural Gas", "title": "Natural Gas",
"author": "Brevven", "author": "Brevven",
"contact": "", "contact": "",
"homepage": "", "homepage": "",
"dependencies": [ "dependencies": [
"base >= 1.1.0", "base >= 2.0.0",
"? bzfoundry >= 0.2.1", "? bzfoundry >= 2.0.0",
"? bztitanium >= 1.2.0", "? bztitanium >= 2.0.26",
"? bzlead >= 1.2.0", "? bzlead >= 2.0.28",
"? bzzirconium >= 0.6.0", "? bzzirconium >= 2.1.13",
"? bztungsten >= 0.6.0", "? bztungsten >= 0.6.0",
"? bzcarbon >= 0.3.0", "? bzcarbon >= 2.0.21",
"? bztin", "? bztin >= 2.1.15",
"? warptorio2_expansion", "? warptorio2_expansion",
"? space-exploration >= 0.5.100", "? space-exploration >= 0.7.34",
"? aai-industry", "? aai-industry >= 0.6.13",
"? Krastorio2", "? Krastorio2 >= 2.0.8",
"? deadlock-beltboxes-loaders", "? deadlock-beltboxes-loaders >= 2.6.0",
"? DeadlockCrating" "? DeadlockCrating"
], ],
"description": "Adds a natural gas resource, along with early game plastic.\nIntegrates ElAdamo's gas-fired boiler.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods." "description": "Adds a natural gas resource, along with early game plastic.\nIntegrates ElAdamo's gas-fired boiler.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods."

View file

@ -1,7 +1,7 @@
-- Matter recipes for Krastorio2 -- Matter recipes for Krastorio2
if mods["Krastorio2"] then if mods["Krastorio2"] then
local util = require("data-util"); local util = require("data-util");
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") local matter = require("__Krastorio2__/prototypes/libraries/matter")
data:extend( data:extend(
{ {
@ -28,7 +28,7 @@ data:extend(
{ {
{"production-science-pack", 1}, {"production-science-pack", 1},
{"utility-science-pack", 1}, {"utility-science-pack", 1},
{"matter-tech-card", 1} {"kr-matter-tech-card", 1}
}, },
time = 45 time = 45
} }
@ -37,12 +37,11 @@ data:extend(
local gas_ore_matter = local gas_ore_matter =
{ {
item_name = "gas", material = { type = "fluid", name = "gas", amount = 100 },
minimum_conversion_quantity = 100, matter_count = 5,
matter_value = 5,
energy_required = 1, energy_required = 1,
need_stabilizer = false, need_stabilizer = false,
unlocked_by_technology = "gas-matter-processing" unlocked_by_technology = "gas-matter-processing"
} }
matter.createMatterRecipe(gas_ore_matter) matter.make_recipes(gas_ore_matter)
end end

View file

@ -2,14 +2,6 @@ local util = require("data-util");
for i, recipe in pairs(util.me.recipes) do for i, recipe in pairs(util.me.recipes) do
if data.raw.recipe[recipe] then if data.raw.recipe[recipe] then
for j, module in pairs(data.raw.module) do data.raw.recipe[recipe].allow_productivity = true
if module.effect then
for effect_name, effect in pairs(module.effect) do
if effect_name == "productivity" and effect.bonus > 0 and module.limitation and #module.limitation > 0 then
table.insert(module.limitation, recipe)
end
end
end
end
end end
end end

View file

@ -13,16 +13,16 @@ data:extend({
icon_size = 128, icon_size = 128,
subgroup = "raw-material", subgroup = "raw-material",
order = "g[bakelite]", order = "g[bakelite]",
stack_size = util.get_stack_size(100), stack_size = 100,
}, },
{ {
type = "recipe", type = "recipe",
name = "bakelite", name = "bakelite",
category = "chemistry", category = "chemistry",
main_product = "bakelite", main_product = "bakelite",
enabled = "false", enabled = false,
ingredients = { ingredients = {
{util.me.use_phenol() and "phenol" or "coal", 1}, {type = "item", name = util.me.use_phenol() and "phenol" or "coal", amount = 1},
{type="fluid", name="formaldehyde", amount=10} {type="fluid", name="formaldehyde", amount=10}
}, },
energy_required = 2, energy_required = 2,

View file

@ -5,13 +5,13 @@ data:extend({
{ {
type = "recipe", type = "recipe",
name = "basic-chemical-plant", name = "basic-chemical-plant",
result = "basic-chemical-plant", results = {{ type = "item", name = "basic-chemical-plant", amount = 1}},
enabled = false, enabled = false,
ingredients = { ingredients = {
{"stone-brick", 5}, {type="item", name="stone-brick", amount=5},
{"iron-plate", 4}, {type="item", name="iron-plate", amount=4},
{"copper-plate", 4}, {type="item", name="copper-plate", amount=4},
{"pipe", 6}, {type="item", name="pipe", amount=6},
}, },
} }
}) })
@ -19,7 +19,7 @@ data:extend({
util.add_ingredient("basic-chemical-plant", "lead-plate", 4) util.add_ingredient("basic-chemical-plant", "lead-plate", 4)
util.replace_ingredient("basic-chemical-plant", "iron-plate", "aluminum-plate") util.replace_ingredient("basic-chemical-plant", "iron-plate", "aluminum-plate")
util.replace_ingredient("basic-chemical-plant", "copper-plate", "tin-plate") util.replace_ingredient("basic-chemical-plant", "copper-plate", "tin-plate")
util.replace_ingredient("basic-chemical-plant", "stone-brick", "sand", 10) util.replace_ingredient("basic-chemical-plant", "stone-brick", mods["Krastorio2"] and "kr-sand" or "sand", 10)
util.replace_ingredient("basic-chemical-plant", "stone-brick", "silica", 10) util.replace_ingredient("basic-chemical-plant", "stone-brick", "silica", 10)
-- item -- item
@ -45,16 +45,12 @@ end
local plant_e = futil.table.deepcopy(data.raw["assembling-machine"]["chemical-plant"]) local plant_e = futil.table.deepcopy(data.raw["assembling-machine"]["chemical-plant"])
plant_e.name = "basic-chemical-plant" plant_e.name = "basic-chemical-plant"
plant_e.minable = {mining_time = 0.5, result = "basic-chemical-plant"} plant_e.minable = {mining_time = 0.5, result = "basic-chemical-plant"}
plant_e.module_specification = {module_slots = 0} plant_e.module_slots = 0
plant_e.working_visualisations = {plant_e.working_visualisations[1], plant_e.working_visualisations[2]} -- no smoke plant_e.graphics_set.working_visualisations = {plant_e.graphics_set.working_visualisations[1], plant_e.graphics_set.working_visualisations[2]} -- no smoke
plant_e.animation.north.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" plant_e.graphics_set.animation.north.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.animation.north.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" plant_e.graphics_set.animation.south.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.animation.south.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" plant_e.graphics_set.animation.east.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.animation.south.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" plant_e.graphics_set.animation.west.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.animation.east.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png"
plant_e.animation.east.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.animation.west.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png"
plant_e.animation.west.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png"
plant_e.next_upgrade="chemical-plant" plant_e.next_upgrade="chemical-plant"
plant_e.icon = nil plant_e.icon = nil
plant_e.icon_size = nil plant_e.icon_size = nil
@ -68,7 +64,7 @@ plant_e.energy_source = {
type = "burner", type = "burner",
fuel_inventory_size = 1, fuel_inventory_size = 1,
effectivity = 1, effectivity = 1,
emissions_per_minute = 5, emissions_per_minute = { pollution = 5 },
fuel_categories = {"chemical"}, fuel_categories = {"chemical"},
smoke = { smoke = {
{ {
@ -83,15 +79,5 @@ plant_e.energy_source = {
}, },
}, },
} }
-- NOTE: Saving alternate tint here in case this is needed.
-- local ptint = {r=.7,g=0.7,b=0.9,a=1}
-- plant_e.animation.north.layers[1].tint = ptint
-- plant_e.animation.north.layers[1].hr_version.tint = ptint
-- plant_e.animation.south.layers[1].tint = ptint
-- plant_e.animation.south.layers[1].hr_version.tint = ptint
-- plant_e.animation.east.layers[1].tint = ptint
-- plant_e.animation.east.layers[1].hr_version.tint = ptint
-- plant_e.animation.west.layers[1].tint = ptint
-- plant_e.animation.west.layers[1].hr_version.tint = ptint
data.raw["assembling-machine"]["basic-chemical-plant"] = plant_e data.raw["assembling-machine"]["basic-chemical-plant"] = plant_e
-- end entity -- end entity

View file

@ -12,8 +12,8 @@ data:extend({
type = "fluid", type = "fluid",
name = "formaldehyde", name = "formaldehyde",
default_temperature = 25, default_temperature = 25,
heat_capacity = "0.1KJ", heat_capacity = "0.1kJ",
fuel_value = "0.5KJ", fuel_value = "0.5kJ",
base_color = {r=0.77, g=0.87, b=0.67}, base_color = {r=0.77, g=0.87, b=0.67},
flow_color = {r=0.77, g=0.87, b=0.77}, flow_color = {r=0.77, g=0.87, b=0.77},
icon = "__bzgas__/graphics/icons/formaldehyde.png", icon = "__bzgas__/graphics/icons/formaldehyde.png",
@ -25,7 +25,7 @@ data:extend({
name = "formaldehyde", name = "formaldehyde",
category = "chemistry", category = "chemistry",
subgroup = "fluid-recipes", subgroup = "fluid-recipes",
enabled = "false", enabled = false,
ingredients = { ingredients = {
{type="fluid", name="gas", amount=10} {type="fluid", name="gas", amount=10}
}, },

View file

@ -2,24 +2,24 @@ local util = require("data-util");
local futil = require("util") local futil = require("util")
local ge_ingredients = { local ge_ingredients = {
{"iron-plate", 10}, {type="item", name="iron-plate", amount=10},
{"pipe", 10}, {type="item", name="pipe", amount=10},
{"stone-brick", 4}, {type="item", name="stone-brick", amount=4},
} }
local ge_prereq = {"automation"} local ge_prereq = {"automation"}
if mods.bzlead then table.insert(ge_ingredients, {"lead-plate", 4}) end if mods.bzlead then table.insert(ge_ingredients, {type="item", name="lead-plate", amount=4}) end
if mods.Krastorio2 then if mods.Krastorio2 then
table.insert(ge_ingredients, {"sand", 10}) table.insert(ge_ingredients, {type="item", name="kr-sand", amount=10})
ge_prereq = {"kr-stone-processing"} ge_prereq = {"kr-stone-processing"}
elseif mods["aai-industry"] then elseif mods["aai-industry"] then
table.insert(ge_ingredients, {"sand", 10}) table.insert(ge_ingredients, {type="item", name="sand", amount=10})
ge_prereq = {"sand-processing"} ge_prereq = {"sand-processing"}
elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then
table.insert(ge_ingredients, {"silica", 20}) table.insert(ge_ingredients, {type="item", name="silica", amount=20})
ge_prereq = {"silica-processing"} ge_prereq = {"silica-processing"}
end end
drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create_vector
( (
universal_connector_template, universal_connector_template,
{ {
@ -45,7 +45,7 @@ data:extend({
{ {
type = "recipe", type = "recipe",
name = "gas-extractor", name = "gas-extractor",
result = "gas-extractor", results = {{ type = "item", name = "gas-extractor", amount = 1}},
enabled = false, -- TODO change enabled = false, -- TODO change
ingredients = ge_ingredients, ingredients = ge_ingredients,
}, },
@ -54,13 +54,13 @@ data:extend({
name = "gas-extraction", name = "gas-extraction",
icon = "__bzgas__/graphics/technology/gas-processing.png", icon = "__bzgas__/graphics/technology/gas-processing.png",
icon_size = 256, icon_size = 256,
prerequisites = ge_prereq, --prerequisites = ge_prereq,
effects = { effects = {
{type = "unlock-recipe", recipe = "gas-extractor"}, {type = "unlock-recipe", recipe = "gas-extractor"},
}, },
unit = { unit = {
count = 10, count = 10,
ingredients = mods.Krastorio2 and {{"basic-tech-card", 1}} or {{"automation-science-pack", 1}}, ingredients = mods.Krastorio2 and {{"kr-basic-tech-card", 1}} or {{"automation-science-pack", 1}},
time = 20, time = 20,
}, },
}, },
@ -82,18 +82,18 @@ data:extend({
energy_source = energy_source =
{ {
type = "electric", type = "electric",
emissions_per_minute = 10, emissions_per_minute = { pollution = 10 },
usage_priority = "secondary-input" usage_priority = "secondary-input"
}, },
output_fluid_box = output_fluid_box =
{ {
base_area = 10, volume = 1000,
base_level = 1,
pipe_covers = pipecoverspictures(), pipe_covers = pipecoverspictures(),
pipe_connections = pipe_connections =
{ {
{ {
positions = { {0, -2}, {2, 0}, {0, 2}, {-2, 0} } direction = defines.direction.north,
positions = { {0, -1}, {1, 0}, {0, 1}, {-1, 0} }
} }
} }
}, },
@ -101,10 +101,7 @@ data:extend({
mining_speed = util.me.finite() and 2 or 1, mining_speed = util.me.finite() and 2 or 1,
resource_searching_radius = 0.49, resource_searching_radius = 0.49,
vector_to_place_result = {0, 0}, vector_to_place_result = {0, 0},
module_specification = module_slots = 2,
{
module_slots = 2
},
radius_visualisation_picture = radius_visualisation_picture =
{ {
filename = "__base__/graphics/entity/pumpjack/pumpjack-radius-visualization.png", filename = "__base__/graphics/entity/pumpjack/pumpjack-radius-visualization.png",
@ -147,34 +144,38 @@ data:extend({
shift = futil.by_pixel(-8, 8), shift = futil.by_pixel(-8, 8),
}, },
}, },
animations = { graphics_set = {
layers = { animation = {
{ north = {
filename = "__bzgas__/graphics/entity/gas-extractor-animated.png", layers = {
priority = "extra-high", {
width = 267, filename = "__bzgas__/graphics/entity/gas-extractor-animated.png",
height = 604, priority = "extra-high",
scale = 0.33, -- just under 1/3, for height ~200. Check why height is 604 and not 600 width = 267,
frame_count = 100, height = 604,
line_length = 8, scale = 0.33, -- just under 1/3, for height ~200. Check why height is 604 and not 600
animation_speed = 0.5, frame_count = 100,
shift = futil.by_pixel(0, -60), line_length = 8,
}, animation_speed = 0.5,
{ shift = futil.by_pixel(0, -60),
stripes = futil.multiplystripes(100, {{ },
filename = "__bzgas__/graphics/entity/gas-extractor-shadow.png", {
width_in_frames = 1, stripes = futil.multiplystripes(100, { {
height_in_frames = 1, filename = "__bzgas__/graphics/entity/gas-extractor-shadow.png",
}}), width_in_frames = 1,
priority = "extra-high", height_in_frames = 1,
width = 331, } }),
height = 64, priority = "extra-high",
draw_as_shadow = true, width = 331,
frame_count = 100, height = 64,
animation_speed = 0.5, draw_as_shadow = true,
shift = futil.by_pixel(119, 8), frame_count = 100,
}, animation_speed = 0.5,
}, shift = futil.by_pixel(119, 8),
},
},
}
}
}, },
vehicle_impact_sound = data.raw["mining-drill"]["pumpjack"].vehicle_impact_sound, vehicle_impact_sound = data.raw["mining-drill"]["pumpjack"].vehicle_impact_sound,
open_sound = data.raw["mining-drill"]["pumpjack"].open_sound, open_sound = data.raw["mining-drill"]["pumpjack"].open_sound,

View file

@ -1,9 +1,12 @@
local resource_autoplace = require('resource-autoplace'); local resource_autoplace = require('resource-autoplace');
local noise = require('noise');
local util = require("data-util"); local util = require("data-util");
local futil = require("util") local futil = require("util")
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["gas"] = {}
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["gas"] = {}
resource_autoplace.initialize_patch_set("gas", true)
data:extend({ {type = "resource-category", name="gas"} }) data:extend({ {type = "resource-category", name="gas"} })
data:extend({ data:extend({
{ {
@ -13,10 +16,6 @@ data:extend({
richness = true, richness = true,
order = "b-ez" order = "b-ez"
}, },
{
type = "noise-layer",
name = "gas"
},
{ {
type = "resource", type = "resource",
name = "gas", name = "gas",
@ -71,53 +70,29 @@ data:extend({
{ {
sheet = sheet =
{ {
filename = "__bzgas__/graphics/entity/ores/gas.png", filename = "__bzgas__/graphics/entity/ores/hr-gas.png",
priority = "extra-high", priority = "extra-high",
width = 64, width = 128,
height = 64, height = 128,
frame_count = 4, frame_count = 4,
variation_count = 1, variation_count = 1,
shift = futil.by_pixel(0, -12), shift = futil.by_pixel(0, -12),
scale = 0.75, scale = 0.5*0.75,
hr_version =
{
filename = "__bzgas__/graphics/entity/ores/hr-gas.png",
priority = "extra-high",
width = 128,
height = 128,
frame_count = 4,
variation_count = 1,
shift = futil.by_pixel(0, -12),
scale = 0.5*0.75,
}
} }
}, },
stages_effect = stages_effect =
{ {
sheet = sheet =
{ {
filename = "__bzgas__/graphics/entity/ores/gas-effect.png", filename = "__bzgas__/graphics/entity/ores/hr-gas-effect.png",
priority = "extra-high", priority = "extra-high",
width = 64, width = 128,
height = 64, height = 128,
frame_count = 4, frame_count = 4,
variation_count = 1, variation_count = 1,
shift = futil.by_pixel(0, -12), shift = futil.by_pixel(0, -17),
scale = 0.75,
blend_mode = "normal", blend_mode = "normal",
hr_version = scale = 0.5*0.75,
{
filename = "__bzgas__/graphics/entity/ores/hr-gas-effect.png",
priority = "extra-high",
width = 128,
height = 128,
frame_count = 4,
variation_count = 1,
shift = futil.by_pixel(0, -17),
scale = 0.5,
blend_mode = "normal",
scale = 0.5*0.75,
}
} }
}, },
effect_animation_period = 3.5, effect_animation_period = 3.5,
@ -130,8 +105,8 @@ data:extend({
type = "fluid", type = "fluid",
name = "gas", name = "gas",
default_temperature = 25, default_temperature = 25,
heat_capacity = "0.1KJ", heat_capacity = "0.1kJ",
fuel_value = "1000KJ", fuel_value = "1000kJ",
emissions_multiplier = util.se6() and 1.1 or 0.75, emissions_multiplier = util.se6() and 1.1 or 0.75,
base_color = {r=0.67, g=0.87, b=0.77}, base_color = {r=0.67, g=0.87, b=0.77},
flow_color = {r=0.67, g=0.87, b=0.87}, flow_color = {r=0.67, g=0.87, b=0.87},

View file

@ -6,9 +6,9 @@ if mods.Krastorio2 then
name = "gas-reforming", name = "gas-reforming",
category = "chemistry", category = "chemistry",
subgroup = "fluid-recipes", subgroup = "fluid-recipes",
main_product = "hydrogen", main_product = "kr-hydrogen",
icons = { icons = {
{icon = kr_fluids_icons_path.."hydrogen.png", icon_size = 64, icon_mipmaps = 4}, {icon = "__Krastorio2Assets__/icons/fluids/hydrogen.png", icon_size = 64, icon_mipmaps = 4},
{icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, scale = 0.125, shift={-8,-8}}, {icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, scale = 0.125, shift={-8,-8}},
}, },
enabled = false, enabled = false,
@ -18,7 +18,7 @@ if mods.Krastorio2 then
}, },
energy_required = 3, energy_required = 3,
results = { results = {
{type="fluid", name="hydrogen", amount = 100}, {type="fluid", name="kr-hydrogen", amount = 100},
}, },
}, },
{ {
@ -29,12 +29,12 @@ if mods.Krastorio2 then
main_product = "formaldehyde", main_product = "formaldehyde",
icons = { icons = {
{icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128, scale = 0.125}, {icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128, scale = 0.125},
{icon = kr_fluids_icons_path.."biomethanol.png", icon_size = 64, scale = 0.125, icon_mipmaps = 4, shift={-5,-5}}, {icon ="__Krastorio2Assets__/icons/fluids/biomethanol.png", icon_size = 64, scale = 0.125, icon_mipmaps = 4, shift={-5,-5}},
}, },
enabled = false, enabled = false,
ingredients = { ingredients = {
{type="fluid", name="biomethanol", amount=50}, {type="fluid", name="kr-biomethanol", amount=50},
{type="fluid", name="oxygen", amount=25}, {type="fluid", name="kr-oxygen", amount=25},
}, },
energy_required = 7, energy_required = 7,
results = { results = {
@ -50,9 +50,9 @@ if mods.Krastorio2 then
name = "methane-reforming", name = "methane-reforming",
category = "chemistry", category = "chemistry",
subgroup = "fluid-recipes", subgroup = "fluid-recipes",
main_product = "hydrogen", main_product = "kr-hydrogen",
icons = { icons = {
{icon = kr_fluids_icons_path.."hydrogen.png", icon_size = 64, icon_mipmaps = 4}, {icon ="__Krastorio2Assets__/icons/fluids/hydrogen.png", icon_size = 64, icon_mipmaps = 4},
{icon = "__space-exploration-graphics__/graphics/icons/fluid/methane-gas.png", icon_size = 64, scale = 0.25, shift={-8,-8}}, {icon = "__space-exploration-graphics__/graphics/icons/fluid/methane-gas.png", icon_size = 64, scale = 0.25, shift={-8,-8}},
}, },
enabled = false, enabled = false,
@ -62,7 +62,7 @@ if mods.Krastorio2 then
}, },
energy_required = 2, energy_required = 2,
results = { results = {
{type="fluid", name="hydrogen", amount = 100}, {type="fluid", name="kr-hydrogen", amount = 100},
}, },
}, },
}) })

View file

@ -8,18 +8,18 @@ data:extend({
name = "phenol", name = "phenol",
icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128,
pictures = { pictures = {
{filename = "__bzgas__/graphics/icons/phenol.png", size = 128, scale = 0.125}, {filename = "__bzgas__/graphics/icons/phenol.png", size = 128, scale = 0.25},
{filename = "__bzgas__/graphics/icons/phenol-2.png", size = 128, scale = 0.125}, {filename = "__bzgas__/graphics/icons/phenol-2.png", size = 128, scale = 0.25},
{filename = "__bzgas__/graphics/icons/phenol-3.png", size = 128, scale = 0.125}, {filename = "__bzgas__/graphics/icons/phenol-3.png", size = 128, scale = 0.25},
{filename = "__bzgas__/graphics/icons/phenol-4.png", size = 128, scale = 0.125}, {filename = "__bzgas__/graphics/icons/phenol-4.png", size = 128, scale = 0.25},
}, },
subgroup = "raw-material", subgroup = "raw-material",
order = "g[phenol]", order = "g[phenol]",
stack_size = util.get_stack_size(100), stack_size = 100,
}, },
}) })
if data.raw.item["coke"] then if data.raw.item[mods["Krastorio2"] and "kr-coke" or "coke"] then
local cat local cat
if mods.Krastorio2 then if mods.Krastorio2 then
cat = "smelting" cat = "smelting"
@ -36,14 +36,14 @@ if data.raw.item["coke"] then
name = "phenol", name = "phenol",
category = cat, category = cat,
main_product = "phenol", main_product = "phenol",
enabled = "false", enabled = false,
icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128,
ingredients = {{"coal", 6}, {"wood", 6}}, ingredients = {{type="item", name="coal", amount=6}, {type="item", name="wood", amount=6}},
energy_required = 16, energy_required = 16,
subgroup = "raw-material", subgroup = "raw-material",
results = { results = {
{type="item", name="phenol", amount = 6}, {type="item", name="phenol", amount = 6},
{type="item", name="coke", amount = 3}, {type="item", name="kr-coke", amount = 3},
}, },
} }
}) })
@ -54,9 +54,9 @@ if data.raw.item["coke"] then
name = "phenol", name = "phenol",
category = cat, category = cat,
main_product = "phenol", main_product = "phenol",
enabled = "false", enabled = false,
icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128,
ingredients = {{"coal", 4}}, ingredients = {{type="item", name="coal", amount=4}},
energy_required = 6.4, energy_required = 6.4,
subgroup = "raw-material", subgroup = "raw-material",
results = { results = {
@ -83,9 +83,10 @@ if data.raw.item["coke"] then
{ {
type = "recipe", type = "recipe",
name = "phenol-from-oil", name = "phenol-from-oil",
localised_name = { "item-name.phenol" },
main_product = "phenol", main_product = "phenol",
category = "chemistry", category = "chemistry",
enabled = "false", enabled = false,
icons = { icons = {
{icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128}, {icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128},
light_oil_icon, light_oil_icon,
@ -107,9 +108,9 @@ else
name = "phenol", name = "phenol",
category = "advanced-crafting", category = "advanced-crafting",
main_product = "phenol", main_product = "phenol",
enabled = "false", enabled = false,
energy_required = 1, energy_required = 1,
ingredients = {{"coal", 1}}, ingredients = {{type="item", name="coal", amount=1}},
results = { results = {
{type="item", name="phenol", amount=1}, {type="item", name="phenol", amount=1},
}, },

View file

@ -49,6 +49,6 @@ if util.se6() then
util.add_unlock("se-space-biochemical-laboratory", "methane-pre-reforming") util.add_unlock("se-space-biochemical-laboratory", "methane-pre-reforming")
util.add_unlock("se-space-biochemical-laboratory", "formaldehyde-methane") util.add_unlock("se-space-biochemical-laboratory", "formaldehyde-methane")
if data.raw.fluid["se-methane-gas"] then if data.raw.fluid["se-methane-gas"] then
data.raw.fluid["se-methane-gas"].fuel_value = "1000KJ" data.raw.fluid["se-methane-gas"].fuel_value = "1000kJ"
end end
end end