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 item_sounds = require('__base__.prototypes.item_sounds')
local graphite_category = "crafting"
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-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",
order = "g[graphite]",
weight = 1*kg,
@ -171,6 +175,9 @@ data:extend({
type = "item",
name = "diamond",
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,
subgroup = "raw-material",
order = "g[diamond]",
@ -277,6 +284,9 @@ data:extend({
name = "graphene",
icon = "__bzcarbon__/graphics/icons/graphene.png",
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",
order = "g[graphite]",
weight = 2*kg,
@ -353,6 +363,9 @@ data:extend({
name = "fullerenes",
icon = "__bzcarbon__/graphics/icons/Fullerene.png",
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",
order = "g[graphite-fullerenes]",
weight = 2*kg,
@ -407,6 +420,9 @@ data:extend({
name = "nanotubes",
icon = "__bzcarbon__/graphics/icons/nanotube.png",
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",
order = "g[graphite-nanotubes]",
weight = 2*kg,
@ -483,7 +499,10 @@ data:extend({
type = "item",
name = "carbon-black",
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",
order = "g[graphite-carbon-black]",
weight = 1*kg,
@ -532,6 +551,9 @@ data:extend({
type = "item",
name = "crucible",
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",
order = "g[crucible]",
weight = 4*kg,

View file

@ -19,10 +19,16 @@ function cutil.nanotube_recipe(recipe_name, item_name, tech)
}
else
new_recipe.localised_name = {"item-name."..item_name}
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}},
}
if new_recipe.icons and #new_recipe.icons > 1 then
table.insert(new_recipe.icons,
{ 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
new_recipe.icon = 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
Date: 2025-03-22
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("diamond", {"beta", "epsilon"}, 1)
require("compatibility/crafting-efficiency")
-- Must be last
util.create_list()

View file

@ -12,6 +12,30 @@ util.get_setting = util.me.get_setting
util.titanium_plate = ""
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.AL = {{"automation-science-pack", 1}, {"logistic-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
function util.prepare_recycling_helper()
if mods.quality then
for _, recipe in pairs(data.raw.recipe) do
recipe.auto_recycle_helper = recipe.auto_recycle
end
end
-- DEPRECATED
end
-- Recalculate recycling recipes, call near end of data-updates.lua, after calling
@ -1852,7 +1872,6 @@ function util.redo_recycling()
if mods.quality then
local recycling = require("__quality__.prototypes.recycling")
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
recycling.generate_recycling_recipe(recipe)
end

View file

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

View file

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

View file

@ -1,5 +1,5 @@
local resource_autoplace = require('resource-autoplace');
local item_sounds = require('__base__.prototypes.item_sounds')
local util = require("data-util");
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-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",
order = "t-c-a",
stack_size = util.get_stack_size(50)

View file

@ -1,5 +1,5 @@
local resource_autoplace = require('resource-autoplace');
local item_sounds = require('__base__.prototypes.item_sounds')
local util = require("data-util");
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-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",
order = "t-c-a",
stack_size = util.get_stack_size(50)