Skip to content

Commit

Permalink
Make unit tests pass with Bob's Mining
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed Dec 3, 2024
1 parent d4fc4f6 commit 3e60d98
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 40 deletions.
4 changes: 3 additions & 1 deletion bobgreenhouse/prototypes/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ data:extend({
name = "bob-greenhouse",
icon = "__bobgreenhouse__/graphics/icons/technology/greenhouse.png",
icon_size = 128,
prerequisites = {},
prerequisites = {
"steam-power",
},
effects = {
{
type = "unlock-recipe",
Expand Down
1 change: 1 addition & 0 deletions boblogistics/prototypes/entity/inserter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ data.raw.inserter["steam-inserter"].energy_source = {
},
},
}
bobmods.lib.tech.add_recipe_unlock("steam-power", "steam-inserter")

data:extend({
util.merge({
Expand Down
3 changes: 2 additions & 1 deletion bobmining/prototypes/areadrills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ if settings.startup["bobmods-mining-areadrills"].value == true then
order = "d-a-b-1",
prerequisites = {
"steel-processing",
"electronics",
"electric-mining-drill",
},
unit = {
count = 50,
Expand Down Expand Up @@ -294,6 +294,7 @@ if settings.startup["bobmods-mining-areadrills"].value == true then
order = "d-a-b-4",
prerequisites = {
"bob-area-drills-3",
"production-science-pack",
},
unit = {
count = 150,
Expand Down
3 changes: 2 additions & 1 deletion bobmining/prototypes/drills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if settings.startup["bobmods-mining-miningdrills"].value == true then
order = "d-a-a-1",
prerequisites = {
"steel-processing",
"electronics",
"electric-mining-drill",
},
unit = {
count = 50,
Expand Down Expand Up @@ -292,6 +292,7 @@ if settings.startup["bobmods-mining-miningdrills"].value == true then
order = "d-a-a-4",
prerequisites = {
"bob-drills-3",
"production-science-pack",
},
unit = {
count = 150,
Expand Down
1 change: 1 addition & 0 deletions bobmining/prototypes/pumpjacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ if settings.startup["bobmods-mining-pumpjacks"].value == true then
order = "d-a-c-4",
prerequisites = {
"bob-pumpjacks-3",
"production-science-pack",
},
unit = {
count = 150,
Expand Down
3 changes: 2 additions & 1 deletion bobmining/prototypes/steam-drills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if settings.startup["bobmods-mining-steamminingdrills"].value == true then
{
type = "recipe",
name = "steam-mining-drill",
enabled = false,
energy_required = 1,
ingredients = {
{ type = "item", name = "burner-mining-drill", amount = 1 },
Expand All @@ -47,7 +48,7 @@ if settings.startup["bobmods-mining-steamminingdrills"].value == true then
},
}),
})

bobmods.lib.tech.add_recipe_unlock("steam-power", "steam-mining-drill")
data.raw["mining-drill"]["steam-mining-drill"].resource_searching_radius = 1.99
data.raw["mining-drill"]["steam-mining-drill"].radius_visualisation_picture = {
filename = "__base__/graphics/entity/electric-mining-drill/electric-mining-drill-radius-visualization.png",
Expand Down
8 changes: 6 additions & 2 deletions bobplates/prototypes/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ data:extend({
name = "electrolysis-1",
icon = "__bobplates__/graphics/icons/technology/electrolysis.png",
icon_size = 128,
prerequisites = {},
prerequisites = {
"steam-power"
},
effects = {
{
type = "unlock-recipe",
Expand Down Expand Up @@ -68,7 +70,9 @@ data:extend({
name = "chemical-processing-1",
icon = "__bobplates__/graphics/icons/technology/chemical-processing.png",
icon_size = 128,
prerequisites = {},
prerequisites = {
"steam-power",
},
effects = {
{
type = "unlock-recipe",
Expand Down
14 changes: 0 additions & 14 deletions bobtech/prototypes/technology/technology-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,12 @@ if settings.startup["bobmods-burnerphase"].value == true then
if data.raw.technology["electrolysis-1"] then
bobmods.lib.tech.add_prerequisite("electrolysis-1", "automation-science-pack")
bobmods.lib.tech.add_prerequisite("electrolysis-1", "electricity")
bobmods.lib.tech.add_prerequisite("electrolysis-1", "steam-power")
end
if data.raw.technology["alloy-processing"] then
bobmods.lib.tech.add_prerequisite("alloy-processing", "automation-science-pack")
end
if data.raw.technology["chemical-processing-1"] then
bobmods.lib.tech.add_prerequisite("chemical-processing-1", "automation-science-pack")
bobmods.lib.tech.add_prerequisite("chemical-processing-1", "steam-power")
end
if data.raw.technology["air-compressor-1"] then
bobmods.lib.tech.add_prerequisite("air-compressor-1", "automation-science-pack")
Expand All @@ -235,24 +233,12 @@ if settings.startup["bobmods-burnerphase"].value == true then
if data.raw.technology["bob-greenhouse"] then
bobmods.lib.tech.add_prerequisite("bob-greenhouse", "automation-science-pack")
bobmods.lib.tech.add_prerequisite("bob-greenhouse", "electricity")
bobmods.lib.tech.add_prerequisite("bob-greenhouse", "steam-power")
end
if data.raw.technology["water-miner-1"] then
bobmods.lib.tech.add_prerequisite("water-miner-1", "automation-science-pack")
bobmods.lib.tech.add_prerequisite("water-miner-1", "electricity")
end

bobmods.lib.tech.add_recipe_unlock("steam-power", "boiler")
bobmods.lib.tech.add_recipe_unlock("steam-power", "offshore-pump")
if data.raw.recipe["steam-mining-drill"] then
data.raw.recipe["steam-mining-drill"].enabled = false
bobmods.lib.tech.add_recipe_unlock("steam-power", "steam-mining-drill")
end
if data.raw.recipe["steam-inserter"] then
data.raw.recipe["steam-inserter"].enabled = false
bobmods.lib.tech.add_recipe_unlock("steam-power", "steam-inserter")
end

if data.raw.technology["basic-automation"] then
bobmods.lib.tech.add_prerequisite("automation", "basic-automation")
bobmods.lib.tech.replace_science_pack("basic-automation", "automation-science-pack", "steam-science-pack")
Expand Down
20 changes: 0 additions & 20 deletions bobtech/prototypes/technology/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,6 @@ if settings.startup["bobmods-burnerphase"].value == true then
},
})

data:extend({
{
type = "technology",
name = "steam-power",
icon = "__base__/graphics/icons/fluid/steam.png",
icon_size = 64,
prerequisites = {},
effects = {},
unit = {
count = 10,
ingredients = {
{ "steam-science-pack", 1 },
},
time = 10,
},
ignore_tech_cost_multiplier = true,
order = "c-a",
},
})

bobmods.lib.recipe.enabled("automation-science-pack", false)
bobmods.lib.recipe.enabled("boiler", false)
bobmods.lib.recipe.enabled("steam-engine", false)
Expand Down

0 comments on commit 3e60d98

Please sign in to comment.