Skip to content

Commit 01328bd

Browse files
authored
Merge pull request #351 from modded-factorio/pr/349
2.0 naming changes
2 parents 8d811d2 + 71e93bb commit 01328bd

62 files changed

Lines changed: 1670 additions & 1586 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SeaBlock/changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
---------------------------------------------------------------------------------------------------
2+
Version: 0.6.0
3+
Date: ??.??.??
4+
Changes:
5+
- Factorio 2.0 update
6+
- Added "angels-" prefix to all AngelsMods related prototypes
7+
- Added "bob-" prefix to all BobsMods related prototypes
8+
---------------------------------------------------------------------------------------------------
29
Version: 0.5.17
310
Date: ??.??.??
411
Changes:

SeaBlock/control.lua

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ end
1212
function seablock.create_rock_chest(surface, pos)
1313
local has_items = false
1414

15-
if global.starting_items and (not game.is_multiplayer()) then
16-
for item, quantity in pairs(global.starting_items) do
15+
if storage.starting_items and (not game.is_multiplayer()) then
16+
for item, quantity in pairs(storage.starting_items) do
1717
if quantity > 0 then
1818
has_items = true
1919
break
@@ -22,8 +22,13 @@ function seablock.create_rock_chest(surface, pos)
2222
end
2323

2424
if has_items then
25-
local chest = surface.create_entity({ name = "rock-chest", position = pos, force = game.forces.neutral })
26-
for item, quantity in pairs(global.starting_items) do
25+
local chest = surface.create_entity({
26+
name = "sb-rock-chest",
27+
position = pos,
28+
force = game.forces.neutral,
29+
move_stuck_players = true,
30+
})
31+
for item, quantity in pairs(storage.starting_items) do
2732
if quantity > 0 then
2833
chest.insert({ name = item, count = quantity })
2934
end
@@ -32,9 +37,9 @@ function seablock.create_rock_chest(surface, pos)
3237
end
3338

3439
function seablock.have_item(player, itemname, crafted)
35-
local unlock = global.unlocks[itemname]
40+
local unlock = storage.unlocks[itemname]
3641
-- Special case for basic-circuit because it is part of starting equipment
37-
if unlock and (itemname ~= "basic-circuit-board" or crafted) then
42+
if unlock and (itemname ~= "bob-basic-circuit-board" or crafted) then
3843
for _, v in ipairs(unlock) do
3944
if player.force.technologies[v] then
4045
player.force.technologies[v].researched = true
@@ -51,20 +56,20 @@ end
5156

5257
local function init()
5358
set_pvp()
54-
global.starting_items = seablock.populate_starting_items(game.item_prototypes)
59+
storage.starting_items = seablock.populate_starting_items(prototypes.item)
5560
if remote.interfaces.freeplay then
5661
if remote.interfaces.freeplay.set_disable_crashsite then
5762
remote.call("freeplay", "set_disable_crashsite", true)
5863
end
5964
end
60-
global.unlocks = {
61-
["angels-ore3-crushed"] = { "sb-startup1", "bio-wood-processing" },
62-
["basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
65+
storage.unlocks = {
66+
["angels-ore3-crushed"] = { "sb-startup1", "angels-bio-wood-processing" },
67+
["bob-basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
6368
}
64-
if game.technology_prototypes["sct-automation-science-pack"] then
65-
global.unlocks["lab"] = { "sct-automation-science-pack" }
69+
if prototypes.technology["sct-automation-science-pack"] then
70+
storage.unlocks["lab"] = { "sct-automation-science-pack" }
6671
else
67-
global.unlocks["lab"] = { "sb-startup4" }
72+
storage.unlocks["lab"] = { "sb-startup4" }
6873
end
6974

7075
if remote.interfaces["freeplay"] then
@@ -130,7 +135,7 @@ script.on_event(defines.events.on_player_main_inventory_changed, function(e)
130135
if not inv then -- Compatibility with BlueprintLab_Bud17
131136
return
132137
end
133-
for k, v in pairs(global.unlocks) do
138+
for k, v in pairs(storage.unlocks) do
134139
for _, v2 in ipairs(v) do
135140
if
136141
player.force.technologies[v2]
@@ -153,13 +158,13 @@ script.on_configuration_changed(function(cfg)
153158
force.reset_recipes()
154159
for tech_name, tech in pairs(force.technologies) do
155160
if tech.researched then
156-
for tech_name, effect in pairs(tech.effects) do
161+
for tech_name, effect in pairs(tech.prototype.effects) do
157162
if effect.type == "unlock-recipe" then
158163
force.recipes[effect.recipe].enabled = true
159164
end
160165
end
161166
end
162-
if game.technology_prototypes[tech_name].enabled then
167+
if prototypes.technology[tech_name].enabled then
163168
force.technologies[tech_name].enabled = true
164169
end
165170
end
@@ -222,9 +227,9 @@ script.on_load(function()
222227
end)
223228

224229
script.on_event(defines.events.on_player_created, function(e)
225-
if global.starting_items and game.is_multiplayer() then
226-
local inv = game.players[e.player_index].get_main_inventory()
227-
for item, quantity in pairs(global.starting_items) do
230+
if storage.starting_items and game.is_multiplayer() then
231+
local inv = game.get_player(e.player_index).get_main_inventory()
232+
for item, quantity in pairs(storage.starting_items) do
228233
if quantity > 0 then
229234
inv.insert({ name = item, count = quantity })
230235
end

SeaBlock/data-final-fixes.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Adjust rubber production amount to how it was in petrochem 0.7.9.
22
-- TODO: Revisit this after Angel adds more liquid rubber recipes
3-
seablock.lib.substresult("liquid-rubber-1", "liquid-rubber", nil, 20)
3+
seablock.lib.substresult("angels-liquid-rubber", "angels-liquid-rubber", nil, 20)
44

55
-- Reduce burner heat source neighbour bonus
66
local reactors = {
@@ -31,12 +31,10 @@ require("data-final-fixes/mapgen")
3131
require("data-final-fixes/SpaceMod")
3232

3333
data.raw.recipe["copper-cable"].allow_decomposition = true
34-
data.raw.recipe["paper-bleaching-1"].allow_decomposition = true
34+
data.raw.recipe["angels-solid-paper"].allow_decomposition = true
3535

3636
for _, v in pairs(data.raw.character) do
3737
if v.crafting_categories then
38-
table.insert(v.crafting_categories, "crafting-handonly")
38+
table.insert(v.crafting_categories, "sb-crafting-handonly")
3939
end
4040
end
41-
42-
bobmods.lib.tech.prerequisite_cleanup()

SeaBlock/data-final-fixes/SpaceMod.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ if data.raw.technology["ftl-theory-D"] then
133133
end
134134

135135
if mods["bobtech"] then
136-
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "advanced-logistic-science-pack", 1)
136+
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "bob-advanced-logistic-science-pack", 1)
137137
bobmods.lib.tech.remove_prerequisite("ftl-theory-D1", "ftl-theory-D")
138138
bobmods.lib.tech.add_prerequisite("ftl-theory-D1", "ftl-theory-C")
139139
bobmods.lib.tech.add_prerequisite("ftl-theory-D2", "ftl-theory-D")
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-- Revert Artisanal Reskins recipe icons
22
if mods["reskins-angels"] then
33
local slag_processing_list = {
4-
"slag-processing-1",
5-
"slag-processing-2",
6-
"slag-processing-3",
7-
"slag-processing-4",
8-
"slag-processing-5",
9-
"slag-processing-6",
4+
"angels-slag-processing-1",
5+
"angels-slag-processing-2",
6+
"angels-slag-processing-3",
7+
"angels-slag-processing-4",
8+
"angels-slag-processing-5",
9+
"angels-slag-processing-6",
1010
}
1111
for _, name in pairs(slag_processing_list) do
1212
seablock.reskins.clear_icon_specification(name, "recipe")
@@ -15,5 +15,5 @@ end
1515

1616
-- Remove I overlay from recipes
1717
seablock.reskins.clear_icon_specification("explosives", "recipe")
18-
seablock.reskins.clear_icon_specification("liquid-rubber-1", "recipe")
19-
seablock.reskins.clear_icon_specification("solid-rubber", "recipe")
18+
seablock.reskins.clear_icon_specification("angels-liquid-rubber", "recipe")
19+
seablock.reskins.clear_icon_specification("angels-solid-rubber", "recipe")

SeaBlock/data-final-fixes/logistics.lua

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ local function set_speed(type, name, speed)
77
end
88
end
99

10-
set_speed("transport-belt", "basic-transport-belt", 7.5)
11-
set_speed("underground-belt", "basic-underground-belt", 7.5)
12-
set_speed("splitter", "basic-splitter", 7.5)
10+
set_speed("transport-belt", "bob-basic-transport-belt", 7.5)
11+
set_speed("underground-belt", "bob-basic-underground-belt", 7.5)
12+
set_speed("splitter", "bob-basic-splitter", 7.5)
1313

1414
set_speed("transport-belt", "transport-belt", 15)
1515
set_speed("underground-belt", "underground-belt", 15)
@@ -23,31 +23,35 @@ set_speed("transport-belt", "express-transport-belt", 45)
2323
set_speed("underground-belt", "express-underground-belt", 45)
2424
set_speed("splitter", "express-splitter", 45)
2525

26-
set_speed("transport-belt", "turbo-transport-belt", 60)
27-
set_speed("underground-belt", "turbo-underground-belt", 60)
28-
set_speed("splitter", "turbo-splitter", 60)
26+
set_speed("transport-belt", "bob-turbo-transport-belt", 60)
27+
set_speed("underground-belt", "bob-turbo-underground-belt", 60)
28+
set_speed("splitter", "bob-turbo-splitter", 60)
2929

30-
set_speed("transport-belt", "ultimate-transport-belt", 75)
31-
set_speed("underground-belt", "ultimate-underground-belt", 75)
32-
set_speed("splitter", "ultimate-splitter", 75)
30+
set_speed("transport-belt", "bob-ultimate-transport-belt", 75)
31+
set_speed("underground-belt", "bob-ultimate-underground-belt", 75)
32+
set_speed("splitter", "bob-ultimate-splitter", 75)
3333

3434
-- Increase energy consumption of bob's extra beacons
3535
-- Also reduce module slots and effectivity
36-
if data.raw.beacon["beacon-2"] then
37-
data.raw.beacon["beacon-2"].energy_usage = "960kW"
38-
data.raw.beacon["beacon-2"].module_specification.module_slots = 2
39-
data.raw.beacon["beacon-2"].distribution_effectivity = 0.5
36+
if data.raw.beacon["bob-beacon-2"] then
37+
data.raw.beacon["bob-beacon-2"].energy_usage = "960kW"
38+
data.raw.beacon["bob-beacon-2"].module_slots = 2
39+
data.raw.beacon["bob-beacon-2"].distribution_effectivity = 1
40+
41+
--TODO this got changed with bobs 2.0 - this replicates 1.1 behavior
42+
data.raw.beacon["bob-beacon-2"].supply_area_distance = 6
4043
end
41-
if data.raw.beacon["beacon-3"] then
42-
data.raw.beacon["beacon-3"].energy_usage = "1920kW"
43-
data.raw.beacon["beacon-3"].module_specification.module_slots = 2
44-
data.raw.beacon["beacon-3"].distribution_effectivity = 0.5
44+
if data.raw.beacon["bob-beacon-3"] then
45+
data.raw.beacon["bob-beacon-3"].energy_usage = "1920kW"
46+
data.raw.beacon["bob-beacon-3"].module_slots = 2
47+
data.raw.beacon["bob-beacon-3"].distribution_effectivity = 1
48+
data.raw.beacon["bob-beacon-3"].supply_area_distance = 9
4549
end
4650

4751
-- Undo boblogistcs changes to logistic system research
4852
bobmods.lib.tech.add_new_science_pack("logistic-system", "production-science-pack", 1)
49-
if data.raw.tool["advanced-logistic-science-pack"] then
50-
bobmods.lib.tech.add_new_science_pack("logistic-system", "advanced-logistic-science-pack", 1)
53+
if data.raw.tool["bob-advanced-logistic-science-pack"] then
54+
bobmods.lib.tech.add_new_science_pack("logistic-system", "bob-advanced-logistic-science-pack", 1)
5155
else
5256
bobmods.lib.tech.add_new_science_pack("logistic-system", "utility-science-pack", 1)
5357
end
@@ -58,40 +62,36 @@ local logisticstechs = {
5862
"logistic-system-2",
5963
"logistic-system-3",
6064
"angels-logistic-warehouses",
61-
"logistic-silos",
65+
"angels-logistic-silos",
6266
}
6367

6468
for _, v in pairs(logisticstechs) do
6569
if data.raw.technology[v] then
6670
bobmods.lib.tech.add_new_science_pack(v, "production-science-pack", 1)
6771
bobmods.lib.tech.add_new_science_pack(v, "utility-science-pack", 1)
6872

69-
if data.raw.tool["advanced-logistic-science-pack"] then
70-
bobmods.lib.tech.add_new_science_pack(v, "advanced-logistic-science-pack", 1)
73+
if data.raw.tool["bob-advanced-logistic-science-pack"] then
74+
bobmods.lib.tech.add_new_science_pack(v, "bob-advanced-logistic-science-pack", 1)
7175
end
7276
end
7377
end
7478

7579
if mods["angelsaddons-storage"] then
76-
bobmods.lib.tech.replace_prerequisite("logistic-silos", "logistic-system", "logistic-system-3")
77-
bobmods.lib.tech.replace_prerequisite("angels-logistic-warehouses", "logistic-system", "logistic-silos")
80+
bobmods.lib.tech.replace_prerequisite("angels-logistic-silos", "logistic-system", "logistic-system-3")
81+
bobmods.lib.tech.replace_prerequisite("angels-logistic-warehouses", "logistic-system", "angels-logistic-silos")
7882
end
7983
bobmods.lib.tech.add_prerequisite("logistic-system-2", "utility-science-pack")
8084

8185
-- No logistics chest at green science level.
8286
local function revertchests(tech)
8387
local neweffects = {
84-
{ type = "unlock-recipe", recipe = "logistic-chest-passive-provider" },
85-
{ type = "unlock-recipe", recipe = "logistic-chest-storage" },
88+
{ type = "unlock-recipe", recipe = "passive-provider-chest" },
89+
{ type = "unlock-recipe", recipe = "storage-chest" },
8690
}
8791
for k, v in pairs(tech.effects) do
8892
if
8993
v.type ~= "unlock-recipe"
90-
or (
91-
v.recipe ~= "logistic-chest-passive-provider"
92-
and v.recipe ~= "logistic-chest-storage"
93-
and v.recipe ~= "logistic-chest-requester"
94-
)
94+
or (v.recipe ~= "passive-provider-chest" and v.recipe ~= "storage-chest" and v.recipe ~= "requester-chest")
9595
then
9696
table.insert(neweffects, v)
9797
end
@@ -102,15 +102,12 @@ revertchests(data.raw.technology["logistic-robotics"])
102102
revertchests(data.raw.technology["construction-robotics"])
103103
local found = false
104104
for k, v in pairs(data.raw.technology["logistic-system"].effects) do
105-
if v.type == "unlock-recipe" and v.recipe == "logistic-chest-requester" then
105+
if v.type == "unlock-recipe" and v.recipe == "requester-chest" then
106106
found = true
107107
end
108108
end
109109
if not found then
110-
table.insert(
111-
data.raw.technology["logistic-system"].effects,
112-
{ type = "unlock-recipe", recipe = "logistic-chest-requester" }
113-
)
110+
table.insert(data.raw.technology["logistic-system"].effects, { type = "unlock-recipe", recipe = "requester-chest" })
114111
end
115112

116113
if mods["angelsindustries"] then

SeaBlock/data-final-fixes/recipe.lua

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,30 @@
11
-- Revert massive buff of insulated wire recipe
2-
bobmods.lib.recipe.set_energy_required("insulated-cable", 2)
3-
seablock.lib.substingredient("insulated-cable", "tinned-copper-cable", nil, 8)
4-
seablock.lib.substingredient("insulated-cable", "rubber", nil, 8)
5-
bobmods.lib.recipe.set_result("insulated-cable", { "insulated-cable", 8 })
2+
bobmods.lib.recipe.set_energy_required("bob-insulated-cable", 2)
3+
seablock.lib.substingredient("bob-insulated-cable", "bob-tinned-copper-cable", nil, 8)
4+
seablock.lib.substingredient("bob-insulated-cable", "bob-rubber", nil, 8)
5+
bobmods.lib.recipe.set_result("bob-insulated-cable", { type = "item", name = "bob-insulated-cable", amount = 8 })
66

77
-- Combine Stone and Crushed Stone
88
local function replace_stone(recipe)
99
if recipe.ingredients then
1010
for _, ingredient in pairs(recipe.ingredients) do
1111
if ingredient.name == "stone" then
1212
ingredient.amount = ingredient.amount * 2
13-
elseif ingredient.name == "stone-crushed" then
13+
elseif ingredient.name == "angels-stone-crushed" then
1414
ingredient.name = "stone"
15-
elseif ingredient[1] == "stone" then
16-
ingredient[2] = ingredient[2] * 2
17-
elseif ingredient[1] == "stone-crushed" then
18-
ingredient[1] = "stone"
1915
end
2016
end
2117
end
22-
if recipe.results then
18+
if recipe.results then --needed for recipes parameter- which have no results
2319
for _, result in pairs(recipe.results) do
2420
if result.name == "stone" then
2521
result.amount = result.amount * 2
26-
elseif result.name == "stone-crushed" then
22+
elseif result.name == "angels-stone-crushed" then
2723
result.name = "stone"
28-
elseif result[1] == "stone" then
29-
result[2] = result[2] * 2
30-
elseif result[1] == "stone-crushed" then
31-
result[1] = "stone"
3224
end
3325
end
3426
end
35-
if recipe.result == "stone" then
36-
recipe.result_count = recipe.result_count or 1 * 2
37-
elseif recipe.result == "stone-crushed" then
38-
recipe.result = "stone"
39-
end
40-
if recipe.main_product == "stone-crushed" then
27+
if recipe.main_product == "angels-stone-crushed" then
4128
recipe.main_product = "stone"
4229
end
4330
end
@@ -52,11 +39,11 @@ for _, recipe in pairs(data.raw.recipe) do
5239
replace_stone(recipe)
5340
end
5441
end
55-
bobmods.lib.recipe.hide("stone-crushed")
56-
seablock.lib.hide("item", "stone-crushed")
42+
bobmods.lib.recipe.hide("angels-stone-from-crushed-stone")
43+
seablock.lib.hide("item", "angels-stone-crushed")
5744

58-
if data.raw.recipe["stone-crushed-dissolution"] then
59-
data.raw.recipe["stone-crushed-dissolution"].icons = angelsmods.functions.create_liquid_recipe_icon(
45+
if data.raw.recipe["angels-stone-crushed-dissolution"] then
46+
data.raw.recipe["angels-stone-crushed-dissolution"].icons = angelsmods.functions.create_liquid_recipe_icon(
6047
nil,
6148
{ { 142, 079, 028 }, { 107, 062, 021 }, { 075, 040, 015 } },
6249
{ "stone" }

0 commit comments

Comments
 (0)