Skip to content

Commit

Permalink
Bobelectronics2.0 (#225)
Browse files Browse the repository at this point in the history
* Technology name change

* New migration for version 1.3

Changes tech advanced-electronics-3 to advanced-processing-unit.

* Add new localizations, change electronics techs to match item names from this mod

* Add new bob-electronics tech

Because vanilla electronics has been moved to the very top of the tech tree, this new tech fixes issues with circular tech prereqs and places the full yellow electronics board at a more appropriate stage on the tech tree

* basic-circuit-board enabled = false

This recipe is now unlocked by the vanilla electronics tech, which doesn't need any science packs

* Remove reference to rocket control unit

* Update technology-updates.lua

advanced-electronics-3 -> advanced-processing-unit. Add bob-electronics to prereqs where needed.

* Update technology-updates.lua

* Add new item sounds

* Add new item sounds

* Fix item sounds added to recipe instead of item

* Minor locale fixes

- Avoid repeating translations
- Define recipe name in prototype rather than locale file

* Fixing missing recipe names

---------

Co-authored-by: KiwiHawk <[email protected]>
  • Loading branch information
Qatavin and KiwiHawk authored Nov 26, 2024
1 parent 40835d2 commit c0ebbae
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 52 deletions.
1 change: 0 additions & 1 deletion bobelectronics/data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ require("prototypes.recipe-updates")
require("prototypes.technology-updates")

data.raw.recipe["copper-cable"].category = "electronics"
data.raw.recipe["rocket-control-unit"].category = "electronics"

if data.raw["recipe-category"]["chemical-furnace"] then
if data.raw.recipe["carbon"] then
Expand Down
7 changes: 6 additions & 1 deletion bobelectronics/locale/en/bobelectronics.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ multi-layer-circuit-board=Multi-layer circuit board
electronic-circuit=Basic electronic board
advanced-circuit=Electronic circuit board
processing-unit=Electronic logic board
advanced-processing-unit=Electronic Processing board
advanced-processing-unit=Electronic processing board


[fluid-name]
Expand All @@ -51,4 +51,9 @@ bob-fluid-products=Bob's Fluids
bobmods-colorupdate=Color updates
[technology-name]
advanced-circuit=__ITEM__advanced-circuit__
advanced-processing-unit=__ITEM__advanced-processing-unit__
bob-electronics=Electronics
bob-wood-processing=Wood processing
electronics=Basic electronics
processing-unit=__ITEM__processing-unit__
3 changes: 3 additions & 0 deletions bobelectronics/locale/ru/bobelectronics.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ bob-fluid-products=Жидкости Боба
bobmods-colorupdate=Обновлённые цвета

[technology-name]
advanced-circuit=__ITEM__advanced-circuit__
advanced-processing-unit=__ITEM__advanced-processing-unit__
bob-wood-processing=Обработка древесины
processing-unit=__ITEM__processing-unit__
2 changes: 1 addition & 1 deletion bobelectronics/migrations/bobelectronics_0.15.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ for index, force in pairs(game.forces) do
force.recipes["processing-unit"].enabled = true
end

if force.technologies["advanced-electronics-3"].researched then
if force.technologies["advanced-processing-unit"].researched then
if force.recipes["gilded-copper-cable"] then
force.recipes["gilded-copper-cable"].enabled = true
end
Expand Down
6 changes: 6 additions & 0 deletions bobelectronics/migrations/bobelectronics_1.3.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"technology":
[
["advanced-electronics-3", "advanced-processing-unit"]
]
}
1 change: 0 additions & 1 deletion bobelectronics/prototypes/chemicals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ data:extend({
results = {
{ type = "fluid", name = "heavy-oil", amount = 12 },
},
main_product = "", -- Causes it to use the recipe name.
crafting_machine_tint = {
primary = { r = 0.0, g = 0.34, b = 0.5, a = 0.000 },
secondary = { r = 0.1, g = 0.1, b = 0.1, a = 0.000 },
Expand Down
140 changes: 140 additions & 0 deletions bobelectronics/prototypes/electronics.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
local electronic_part_drop_move = {
filename = "__base__/sound/item/wire-inventory-move.ogg",
volume = 0.8
}
local electronic_part_pick = {
filename = "__base__/sound/item/wire-inventory-pickup.ogg",
volume = 0.6
}

local electronic_board_drop_move = {
filename = "__base__/sound/item/electric-small-inventory-move.ogg",
volume = 1
}
local electronic_board_pick = {
filename = "__base__/sound/item/electric-small-inventory-pickup.ogg",
volume = 0.7
}

if data.raw.item["tin-plate"] then

data:extend({
{
type = "item",
Expand All @@ -8,6 +27,9 @@ if data.raw.item["tin-plate"] then
subgroup = "bob-electronic-components",
order = "0-a1[tinned-copper-cable]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -35,6 +57,9 @@ data:extend({
subgroup = "bob-electronic-components",
order = "0-a2[insulated-cable]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -62,6 +87,9 @@ if data.raw.item["gold-plate"] then
subgroup = "bob-electronic-components",
order = "0-a3[gilded-copper-cable]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -90,6 +118,9 @@ if data.raw.item["solder-alloy"] then
subgroup = "bob-electronic-components",
order = "0-a4[solder]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -118,6 +149,9 @@ data:extend({
subgroup = "bob-electronic-components",
order = "0-b1[basic-electronic-components]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand All @@ -144,6 +178,9 @@ data:extend({
subgroup = "bob-electronic-components",
order = "0-b2[electronic-components]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -171,6 +208,9 @@ data:extend({
subgroup = "bob-electronic-components",
order = "0-b3[integrated-electronics]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -199,6 +239,9 @@ data:extend({
subgroup = "bob-electronic-components",
order = "0-b4[cpu]",
stack_size = 200,
drop_sound = electronic_part_drop_move,
inventory_move_sound = electronic_part_drop_move,
pick_sound = electronic_part_pick,
},

{
Expand Down Expand Up @@ -227,6 +270,18 @@ data:extend({
subgroup = "bob-boards",
order = "c-a1[wooden-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/wood-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/wood-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/wood-inventory-pickup.ogg",
volume = 0.8
},
},

{
Expand All @@ -250,6 +305,18 @@ data:extend({
subgroup = "bob-boards",
order = "c-a2[phenolic-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-pickup.ogg",
volume = 0.7
},
},

{
Expand All @@ -275,6 +342,18 @@ data:extend({
subgroup = "bob-boards",
order = "c-a3[fibreglass-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/solid-fuel-inventory-pickup.ogg",
volume = 0.7
},
},

{
Expand All @@ -299,12 +378,25 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-b1[basic-circuit-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/wood-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/wood-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/wood-inventory-pickup.ogg",
volume = 0.8
},
},

{
type = "recipe",
name = "basic-circuit-board",
category = "electronics",
enabled = false,
energy_required = 1,
ingredients = {
{ type = "item", name = "wooden-board", amount = 1 },
Expand All @@ -325,6 +417,18 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-b2[circuit-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/planner-inventory-pickup.ogg",
volume = 0.7
},
},

{
Expand Down Expand Up @@ -353,6 +457,18 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-b3[superior-circuit-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/planner-inventory-pickup.ogg",
volume = 0.7
},
},

{
Expand Down Expand Up @@ -381,6 +497,18 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-b4[multi-layer-circuit-board]",
stack_size = 200,
drop_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
inventory_move_sound = {
filename = "__base__/sound/item/planner-inventory-move.ogg",
volume = 0.7
},
pick_sound = {
filename = "__base__/sound/item/planner-inventory-pickup.ogg",
volume = 0.7
},
},

{
Expand Down Expand Up @@ -409,6 +537,9 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-c1[basic-electronic-circuit-board]",
stack_size = 200,
drop_sound = electronic_board_drop_move,
inventory_move_sound = electronic_board_drop_move,
pick_sound = electronic_board_pick,
},

{
Expand All @@ -435,6 +566,9 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-c2[electronic-circuit-board]",
stack_size = 200,
drop_sound = electronic_board_drop_move,
inventory_move_sound = electronic_board_drop_move,
pick_sound = electronic_board_pick,
},

{
Expand Down Expand Up @@ -462,6 +596,9 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-c3[electronic-logic-board]",
stack_size = 200,
drop_sound = electronic_board_drop_move,
inventory_move_sound = electronic_board_drop_move,
pick_sound = electronic_board_pick,
},

{
Expand Down Expand Up @@ -490,6 +627,9 @@ data:extend({
subgroup = "bob-electronic-boards",
order = "c-c4[electronic-processing-board]",
stack_size = 200,
drop_sound = electronic_board_drop_move,
inventory_move_sound = electronic_board_drop_move,
pick_sound = electronic_board_pick,
},

{
Expand Down
Loading

0 comments on commit c0ebbae

Please sign in to comment.