This commit is contained in:
Brevven 2025-04-07 20:10:30 -07:00
parent bce801f48b
commit 7f46bdeb25
10 changed files with 83 additions and 63 deletions

View file

@ -1,4 +1,5 @@
local util = require("data-util"); local util = require("data-util");
local item_sounds = require('__base__.prototypes.item_sounds')
local graphite_category = "crafting" local graphite_category = "crafting"
if mods["space-exploration"] then if mods["space-exploration"] then
@ -26,6 +27,9 @@ data:extend({
{filename="__bzcarbon__/graphics/icons/graphite-1.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/graphite-1.png", size=128, scale=0.25},
{filename="__bzcarbon__/graphics/icons/graphite-2.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/graphite-2.png", size=128, scale=0.25},
}, },
inventory_move_sound = item_sounds.sulfur_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.sulfur_inventory_move,
subgroup = "raw-material", subgroup = "raw-material",
order = "g[graphite]", order = "g[graphite]",
weight = 1*kg, weight = 1*kg,
@ -171,6 +175,9 @@ data:extend({
type = "item", type = "item",
name = "diamond", name = "diamond",
icon = "__bzcarbon__/graphics/icons/diamond.png", icon = "__bzcarbon__/graphics/icons/diamond.png",
inventory_move_sound = item_sounds.brick_inventory_move,
pick_sound = item_sounds.brick_inventory_pickup,
drop_sound = item_sounds.brick_inventory_move,
icon_size = 128, icon_size = 128,
subgroup = "raw-material", subgroup = "raw-material",
order = "g[diamond]", order = "g[diamond]",
@ -277,6 +284,9 @@ data:extend({
name = "graphene", name = "graphene",
icon = "__bzcarbon__/graphics/icons/graphene.png", icon = "__bzcarbon__/graphics/icons/graphene.png",
icon_size = 128, icon_size = 128,
inventory_move_sound = item_sounds.plastic_inventory_move,
pick_sound = item_sounds.plastic_inventory_pickup,
drop_sound = item_sounds.plastic_inventory_move,
subgroup = "intermediate-product", subgroup = "intermediate-product",
order = "g[graphite]", order = "g[graphite]",
weight = 2*kg, weight = 2*kg,
@ -353,6 +363,9 @@ data:extend({
name = "fullerenes", name = "fullerenes",
icon = "__bzcarbon__/graphics/icons/Fullerene.png", icon = "__bzcarbon__/graphics/icons/Fullerene.png",
icon_size = 128, icon_size = 128,
inventory_move_sound = item_sounds.plastic_inventory_move,
pick_sound = item_sounds.plastic_inventory_pickup,
drop_sound = item_sounds.plastic_inventory_move,
subgroup = "intermediate-product", subgroup = "intermediate-product",
order = "g[graphite-fullerenes]", order = "g[graphite-fullerenes]",
weight = 2*kg, weight = 2*kg,
@ -407,6 +420,9 @@ data:extend({
name = "nanotubes", name = "nanotubes",
icon = "__bzcarbon__/graphics/icons/nanotube.png", icon = "__bzcarbon__/graphics/icons/nanotube.png",
icon_size = 128, icon_size = 128,
inventory_move_sound = item_sounds.plastic_inventory_move,
pick_sound = item_sounds.plastic_inventory_pickup,
drop_sound = item_sounds.plastic_inventory_move,
subgroup = "intermediate-product", subgroup = "intermediate-product",
order = "g[graphite-nanotubes]", order = "g[graphite-nanotubes]",
weight = 2*kg, weight = 2*kg,
@ -483,7 +499,10 @@ data:extend({
type = "item", type = "item",
name = "carbon-black", name = "carbon-black",
icon = "__bzcarbon__/graphics/icons/carbon-black.png", icon = "__bzcarbon__/graphics/icons/carbon-black.png",
icon_size = 64, icon_mipmaps = 3, icon_size = 64,
inventory_move_sound = item_sounds.sulfur_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.sulfur_inventory_move,
subgroup = "intermediate-product", subgroup = "intermediate-product",
order = "g[graphite-carbon-black]", order = "g[graphite-carbon-black]",
weight = 1*kg, weight = 1*kg,
@ -532,6 +551,9 @@ data:extend({
type = "item", type = "item",
name = "crucible", name = "crucible",
icon = "__bzcarbon__/graphics/icons/crucible.png", icon_size = 128, icon = "__bzcarbon__/graphics/icons/crucible.png", icon_size = 128,
inventory_move_sound = item_sounds.brick_inventory_move,
pick_sound = item_sounds.brick_inventory_pickup,
drop_sound = item_sounds.brick_inventory_move,
subgroup = "intermediate-product", subgroup = "intermediate-product",
order = "g[crucible]", order = "g[crucible]",
weight = 4*kg, weight = 4*kg,

View file

@ -19,10 +19,16 @@ function cutil.nanotube_recipe(recipe_name, item_name, tech)
} }
else else
new_recipe.localised_name = {"item-name."..item_name} new_recipe.localised_name = {"item-name."..item_name}
new_recipe.icons = { if new_recipe.icons and #new_recipe.icons > 1 then
{ icon = data.raw.item[item_name].icon, icon_size = data.raw.item[item_name].icon_size}, table.insert(new_recipe.icons,
{ icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, { icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}}
} )
else
new_recipe.icons = {
{ icon = data.raw.item[item_name].icon, icon_size = data.raw.item[item_name].icon_size},
{ icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}},
}
end
end end
new_recipe.icon = nil new_recipe.icon = nil
new_recipe.icon_size = nil new_recipe.icon_size = nil

View file

@ -1,4 +1,18 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 2.0.14
Date: 2025-03-23
Changes:
- none
---------------------------------------------------------------------------------------------------
Version: 2.0.13
Date: 2025-03-22
Changes:
- Set inventory sounds for some items
- Muluna: Nanotube recipe for alternate LDS
Fixes:
- Loads with Crafting Efficiency
- Improved compatibility with Muluna
---------------------------------------------------------------------------------------------------
Version: 2.0.12 Version: 2.0.12
Date: 2025-03-22 Date: 2025-03-22
Fixes: Fixes:

View file

@ -1,47 +0,0 @@
local util = require("data-util");
if mods["crafting-efficiency-2"] then
local recipes = util.me.recipes
local eff_data = {
["synthetic-diamond"] = {
max = 15,
icon = data.raw.item["diamond"].icon,
crafting = { efficiency = 10 },
research = { level = 6 },
},
["diamond-processing"] = {
max = 15,
icon = data.raw.item["diamond"].icon,
crafting = { efficiency = 10 },
research = { level = 6 },
},
}
for i, recipe in pairs(recipes) do
-- add remaining recipes with direct items to find the icons
if data.raw.recipe[recipe] and data.raw.item[recipe] and not eff_data[recipe] then
local research_level = 1
if not data.raw.recipe[recipe].enabled then
for tech, tbl in pairs(data.raw.technology) do
for _, effect in pairs(tbl.effects or {}) do
if effect.type == "unlock-recipe" and effect.recipe == recipe then
research_level = math.min(#tbl.unit.ingredients, 6)
end
end
end
end
eff_data[recipe] = {
max = 15,
icon = data.raw.item[recipe].icon,
crafting = { efficiency = 10 },
research = { level = research_level },
}
end
end
for recipe, d in pairs(eff_data) do
log("Adding "..recipe.." crafting efficiency")
d.name = recipe:gsub("^%l", string.upper).." efficiency"
CE_Add_Recipe(d, recipe)
end
end

View file

@ -28,6 +28,5 @@ util.redo_recycling()
util.add_shiftite_recipe("graphite", {"alpha"}, 1) util.add_shiftite_recipe("graphite", {"alpha"}, 1)
util.add_shiftite_recipe("diamond", {"beta", "epsilon"}, 1) util.add_shiftite_recipe("diamond", {"beta", "epsilon"}, 1)
require("compatibility/crafting-efficiency")
-- Must be last -- Must be last
util.create_list() util.create_list()

View file

@ -12,6 +12,30 @@ util.get_setting = util.me.get_setting
util.titanium_plate = "" util.titanium_plate = ""
util.titanium_processing = "" util.titanium_processing = ""
local item_sounds_helper = [[
local item_sounds = require('__base__.prototypes.item_sounds')
inventory_move_sound = item_sounds.wire_inventory_move,
pick_sound = item_sounds.wire_inventory_pickup,
drop_sound = item_sounds.wire_inventory_move,
inventory_move_sound = item_sounds.metal_small_inventory_move,
pick_sound = item_sounds.metal_small_inventory_pickup,
drop_sound = item_sounds.metal_small_inventory_move,
inventory_move_sound = item_sounds.resource_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.resource_inventory_move,
inventory_move_sound = item_sounds.brick_inventory_move,
pick_sound = item_sounds.brick_inventory_pickup,
drop_sound = item_sounds.brick_inventory_move,
inventory_move_sound = item_sounds.sulfur_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.sulfur_inventory_move,
]]
util.A = {{"automation-science-pack", 1}} util.A = {{"automation-science-pack", 1}}
util.AL = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}} util.AL = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}
util.ALC = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}, {"chemical-science-pack", 1}} util.ALC = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}, {"chemical-science-pack", 1}}
@ -1839,11 +1863,7 @@ end
-- Save recycling metadata that is later removed by quality mod. Call near end of data.lua -- Save recycling metadata that is later removed by quality mod. Call near end of data.lua
function util.prepare_recycling_helper() function util.prepare_recycling_helper()
if mods.quality then -- DEPRECATED
for _, recipe in pairs(data.raw.recipe) do
recipe.auto_recycle_helper = recipe.auto_recycle
end
end
end end
-- Recalculate recycling recipes, call near end of data-updates.lua, after calling -- Recalculate recycling recipes, call near end of data-updates.lua, after calling
@ -1852,7 +1872,6 @@ function util.redo_recycling()
if mods.quality then if mods.quality then
local recycling = require("__quality__.prototypes.recycling") local recycling = require("__quality__.prototypes.recycling")
for _, recipe in pairs(data.raw.recipe) do for _, recipe in pairs(data.raw.recipe) do
recipe.auto_recycle = recipe.auto_recycle_helper -- keeping this outside conditional to improve fidelity across multiple mods
if recipe.redo_recycling then if recipe.redo_recycling then
recycling.generate_recycling_recipe(recipe) recycling.generate_recycling_recipe(recipe)
end end

View file

@ -1,13 +1,13 @@
{ {
"name": "bzcarbon", "name": "bzcarbon",
"version": "2.0.12", "version": "2.0.13",
"factorio_version": "2.0", "factorio_version": "2.0",
"title": "Graphite & Diamonds", "title": "Graphite & Diamonds",
"author": "Brevven", "author": "Brevven",
"contact": "", "contact": "",
"homepage": "", "homepage": "",
"dependencies": [ "dependencies": [
"base >= 1.1.0", "base >= 2.0.42",
"? space-age", "? space-age",
"? bztitanium", "? bztitanium",
"? bzsilicon", "? bzsilicon",

View file

@ -5,4 +5,5 @@ if util.me.use_fullerenes() then
cutil.nanotube_recipe("low-density-structure") cutil.nanotube_recipe("low-density-structure")
cutil.nanotube_recipe("casting-low-density-structure", "low-density-structure") cutil.nanotube_recipe("casting-low-density-structure", "low-density-structure")
cutil.nanotube_recipe("space-platform-foundation") cutil.nanotube_recipe("space-platform-foundation")
cutil.nanotube_recipe("low-density-structure-from-aluminum", "low-density-structure")
end end

View file

@ -1,5 +1,5 @@
local resource_autoplace = require('resource-autoplace'); local resource_autoplace = require('resource-autoplace');
local item_sounds = require('__base__.prototypes.item_sounds')
local util = require("data-util"); local util = require("data-util");
if util.me.use_rough_diamond() then if util.me.use_rough_diamond() then
@ -77,6 +77,9 @@ data:extend({
{filename="__bzcarbon__/graphics/icons/rough-diamond-3.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/rough-diamond-3.png", size=128, scale=0.25},
{filename="__bzcarbon__/graphics/icons/rough-diamond-4.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/rough-diamond-4.png", size=128, scale=0.25},
}, },
inventory_move_sound = item_sounds.resource_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.resource_inventory_move,
subgroup = "raw-resource", subgroup = "raw-resource",
order = "t-c-a", order = "t-c-a",
stack_size = util.get_stack_size(50) stack_size = util.get_stack_size(50)

View file

@ -1,5 +1,5 @@
local resource_autoplace = require('resource-autoplace'); local resource_autoplace = require('resource-autoplace');
local item_sounds = require('__base__.prototypes.item_sounds')
local util = require("data-util"); local util = require("data-util");
if util.me.use_flake_graphite() then if util.me.use_flake_graphite() then
@ -80,6 +80,9 @@ data:extend({
{filename="__bzcarbon__/graphics/icons/flake-graphite-3.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/flake-graphite-3.png", size=128, scale=0.25},
{filename="__bzcarbon__/graphics/icons/flake-graphite-4.png", size=128, scale=0.25}, {filename="__bzcarbon__/graphics/icons/flake-graphite-4.png", size=128, scale=0.25},
}, },
inventory_move_sound = item_sounds.resource_inventory_move,
pick_sound = item_sounds.resource_inventory_pickup,
drop_sound = item_sounds.resource_inventory_move,
subgroup = "raw-resource", subgroup = "raw-resource",
order = "t-c-a", order = "t-c-a",
stack_size = util.get_stack_size(50) stack_size = util.get_stack_size(50)