Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SeaBlock/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 0.6.0
Date: ??.??.??
Changes:
- Factorio 2.0 update
- Added "angels-" prefix to all AngelsMods related prototypes
- Added "bob-" prefix to all BobsMods related prototypes
---------------------------------------------------------------------------------------------------
Version: 0.5.17
Date: ??.??.??
Changes:
Expand Down
43 changes: 24 additions & 19 deletions SeaBlock/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ end
function seablock.create_rock_chest(surface, pos)
local has_items = false

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

if has_items then
local chest = surface.create_entity({ name = "rock-chest", position = pos, force = game.forces.neutral })
for item, quantity in pairs(global.starting_items) do
local chest = surface.create_entity({
name = "sb-rock-chest",
position = pos,
force = game.forces.neutral,
move_stuck_players = true,
})
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
chest.insert({ name = item, count = quantity })
end
Expand All @@ -32,9 +37,9 @@ function seablock.create_rock_chest(surface, pos)
end

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

local function init()
set_pvp()
global.starting_items = seablock.populate_starting_items(game.item_prototypes)
storage.starting_items = seablock.populate_starting_items(prototypes.item)
if remote.interfaces.freeplay then
if remote.interfaces.freeplay.set_disable_crashsite then
remote.call("freeplay", "set_disable_crashsite", true)
end
end
global.unlocks = {
["angels-ore3-crushed"] = { "sb-startup1", "bio-wood-processing" },
["basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
storage.unlocks = {
["angels-ore3-crushed"] = { "sb-startup1", "angels-bio-wood-processing" },
["bob-basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
}
if game.technology_prototypes["sct-automation-science-pack"] then
global.unlocks["lab"] = { "sct-automation-science-pack" }
if prototypes.technology["sct-automation-science-pack"] then
storage.unlocks["lab"] = { "sct-automation-science-pack" }
else
global.unlocks["lab"] = { "sb-startup4" }
storage.unlocks["lab"] = { "sb-startup4" }
end

if remote.interfaces["freeplay"] then
Expand Down Expand Up @@ -130,7 +135,7 @@ script.on_event(defines.events.on_player_main_inventory_changed, function(e)
if not inv then -- Compatibility with BlueprintLab_Bud17
return
end
for k, v in pairs(global.unlocks) do
for k, v in pairs(storage.unlocks) do
for _, v2 in ipairs(v) do
if
player.force.technologies[v2]
Expand All @@ -153,13 +158,13 @@ script.on_configuration_changed(function(cfg)
force.reset_recipes()
for tech_name, tech in pairs(force.technologies) do
if tech.researched then
for tech_name, effect in pairs(tech.effects) do
for tech_name, effect in pairs(tech.prototype.effects) do
if effect.type == "unlock-recipe" then
force.recipes[effect.recipe].enabled = true
end
end
end
if game.technology_prototypes[tech_name].enabled then
if prototypes.technology[tech_name].enabled then
force.technologies[tech_name].enabled = true
end
end
Expand Down Expand Up @@ -222,9 +227,9 @@ script.on_load(function()
end)

script.on_event(defines.events.on_player_created, function(e)
if global.starting_items and game.is_multiplayer() then
local inv = game.players[e.player_index].get_main_inventory()
for item, quantity in pairs(global.starting_items) do
if storage.starting_items and game.is_multiplayer() then
local inv = game.get_player(e.player_index).get_main_inventory()
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
inv.insert({ name = item, count = quantity })
end
Expand Down
8 changes: 3 additions & 5 deletions SeaBlock/data-final-fixes.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Adjust rubber production amount to how it was in petrochem 0.7.9.
-- TODO: Revisit this after Angel adds more liquid rubber recipes
seablock.lib.substresult("liquid-rubber-1", "liquid-rubber", nil, 20)
seablock.lib.substresult("angels-liquid-rubber", "angels-liquid-rubber", nil, 20)

-- Reduce burner heat source neighbour bonus
local reactors = {
Expand Down Expand Up @@ -31,12 +31,10 @@ require("data-final-fixes/mapgen")
require("data-final-fixes/SpaceMod")

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

for _, v in pairs(data.raw.character) do
if v.crafting_categories then
table.insert(v.crafting_categories, "crafting-handonly")
table.insert(v.crafting_categories, "sb-crafting-handonly")
end
end

bobmods.lib.tech.prerequisite_cleanup()
2 changes: 1 addition & 1 deletion SeaBlock/data-final-fixes/SpaceMod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if data.raw.technology["ftl-theory-D"] then
end

if mods["bobtech"] then
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "advanced-logistic-science-pack", 1)
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "bob-advanced-logistic-science-pack", 1)
bobmods.lib.tech.remove_prerequisite("ftl-theory-D1", "ftl-theory-D")
bobmods.lib.tech.add_prerequisite("ftl-theory-D1", "ftl-theory-C")
bobmods.lib.tech.add_prerequisite("ftl-theory-D2", "ftl-theory-D")
Expand Down
16 changes: 8 additions & 8 deletions SeaBlock/data-final-fixes/icons.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- Revert Artisanal Reskins recipe icons
if mods["reskins-angels"] then
local slag_processing_list = {
"slag-processing-1",
"slag-processing-2",
"slag-processing-3",
"slag-processing-4",
"slag-processing-5",
"slag-processing-6",
"angels-slag-processing-1",
"angels-slag-processing-2",
"angels-slag-processing-3",
"angels-slag-processing-4",
"angels-slag-processing-5",
"angels-slag-processing-6",
}
for _, name in pairs(slag_processing_list) do
seablock.reskins.clear_icon_specification(name, "recipe")
Expand All @@ -15,5 +15,5 @@ end

-- Remove I overlay from recipes
seablock.reskins.clear_icon_specification("explosives", "recipe")
seablock.reskins.clear_icon_specification("liquid-rubber-1", "recipe")
seablock.reskins.clear_icon_specification("solid-rubber", "recipe")
seablock.reskins.clear_icon_specification("angels-liquid-rubber", "recipe")
seablock.reskins.clear_icon_specification("angels-solid-rubber", "recipe")
69 changes: 33 additions & 36 deletions SeaBlock/data-final-fixes/logistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ local function set_speed(type, name, speed)
end
end

set_speed("transport-belt", "basic-transport-belt", 7.5)
set_speed("underground-belt", "basic-underground-belt", 7.5)
set_speed("splitter", "basic-splitter", 7.5)
set_speed("transport-belt", "bob-basic-transport-belt", 7.5)
set_speed("underground-belt", "bob-basic-underground-belt", 7.5)
set_speed("splitter", "bob-basic-splitter", 7.5)

set_speed("transport-belt", "transport-belt", 15)
set_speed("underground-belt", "underground-belt", 15)
Expand All @@ -23,31 +23,35 @@ set_speed("transport-belt", "express-transport-belt", 45)
set_speed("underground-belt", "express-underground-belt", 45)
set_speed("splitter", "express-splitter", 45)

set_speed("transport-belt", "turbo-transport-belt", 60)
set_speed("underground-belt", "turbo-underground-belt", 60)
set_speed("splitter", "turbo-splitter", 60)
set_speed("transport-belt", "bob-turbo-transport-belt", 60)
set_speed("underground-belt", "bob-turbo-underground-belt", 60)
set_speed("splitter", "bob-turbo-splitter", 60)

set_speed("transport-belt", "ultimate-transport-belt", 75)
set_speed("underground-belt", "ultimate-underground-belt", 75)
set_speed("splitter", "ultimate-splitter", 75)
set_speed("transport-belt", "bob-ultimate-transport-belt", 75)
set_speed("underground-belt", "bob-ultimate-underground-belt", 75)
set_speed("splitter", "bob-ultimate-splitter", 75)

-- Increase energy consumption of bob's extra beacons
-- Also reduce module slots and effectivity
if data.raw.beacon["beacon-2"] then
data.raw.beacon["beacon-2"].energy_usage = "960kW"
data.raw.beacon["beacon-2"].module_specification.module_slots = 2
data.raw.beacon["beacon-2"].distribution_effectivity = 0.5
if data.raw.beacon["bob-beacon-2"] then
data.raw.beacon["bob-beacon-2"].energy_usage = "960kW"
data.raw.beacon["bob-beacon-2"].module_slots = 2
data.raw.beacon["bob-beacon-2"].distribution_effectivity = 1

--TODO this got changed with bobs 2.0 - this replicates 1.1 behavior
data.raw.beacon["bob-beacon-2"].supply_area_distance = 6
end
if data.raw.beacon["beacon-3"] then
data.raw.beacon["beacon-3"].energy_usage = "1920kW"
data.raw.beacon["beacon-3"].module_specification.module_slots = 2
data.raw.beacon["beacon-3"].distribution_effectivity = 0.5
if data.raw.beacon["bob-beacon-3"] then
data.raw.beacon["bob-beacon-3"].energy_usage = "1920kW"
data.raw.beacon["bob-beacon-3"].module_slots = 2
data.raw.beacon["bob-beacon-3"].distribution_effectivity = 1
data.raw.beacon["bob-beacon-3"].supply_area_distance = 9
end

-- Undo boblogistcs changes to logistic system research
bobmods.lib.tech.add_new_science_pack("logistic-system", "production-science-pack", 1)
if data.raw.tool["advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack("logistic-system", "advanced-logistic-science-pack", 1)
if data.raw.tool["bob-advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack("logistic-system", "bob-advanced-logistic-science-pack", 1)
else
bobmods.lib.tech.add_new_science_pack("logistic-system", "utility-science-pack", 1)
end
Expand All @@ -58,40 +62,36 @@ local logisticstechs = {
"logistic-system-2",
"logistic-system-3",
"angels-logistic-warehouses",
"logistic-silos",
"angels-logistic-silos",
}

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

if data.raw.tool["advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack(v, "advanced-logistic-science-pack", 1)
if data.raw.tool["bob-advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack(v, "bob-advanced-logistic-science-pack", 1)
end
end
end

if mods["angelsaddons-storage"] then
bobmods.lib.tech.replace_prerequisite("logistic-silos", "logistic-system", "logistic-system-3")
bobmods.lib.tech.replace_prerequisite("angels-logistic-warehouses", "logistic-system", "logistic-silos")
bobmods.lib.tech.replace_prerequisite("angels-logistic-silos", "logistic-system", "logistic-system-3")
bobmods.lib.tech.replace_prerequisite("angels-logistic-warehouses", "logistic-system", "angels-logistic-silos")
end
bobmods.lib.tech.add_prerequisite("logistic-system-2", "utility-science-pack")

-- No logistics chest at green science level.
local function revertchests(tech)
local neweffects = {
{ type = "unlock-recipe", recipe = "logistic-chest-passive-provider" },
{ type = "unlock-recipe", recipe = "logistic-chest-storage" },
{ type = "unlock-recipe", recipe = "passive-provider-chest" },
{ type = "unlock-recipe", recipe = "storage-chest" },
}
for k, v in pairs(tech.effects) do
if
v.type ~= "unlock-recipe"
or (
v.recipe ~= "logistic-chest-passive-provider"
and v.recipe ~= "logistic-chest-storage"
and v.recipe ~= "logistic-chest-requester"
)
or (v.recipe ~= "passive-provider-chest" and v.recipe ~= "storage-chest" and v.recipe ~= "requester-chest")
then
table.insert(neweffects, v)
end
Expand All @@ -102,15 +102,12 @@ revertchests(data.raw.technology["logistic-robotics"])
revertchests(data.raw.technology["construction-robotics"])
local found = false
for k, v in pairs(data.raw.technology["logistic-system"].effects) do
if v.type == "unlock-recipe" and v.recipe == "logistic-chest-requester" then
if v.type == "unlock-recipe" and v.recipe == "requester-chest" then
found = true
end
end
if not found then
table.insert(
data.raw.technology["logistic-system"].effects,
{ type = "unlock-recipe", recipe = "logistic-chest-requester" }
)
table.insert(data.raw.technology["logistic-system"].effects, { type = "unlock-recipe", recipe = "requester-chest" })
end

if mods["angelsindustries"] then
Expand Down
37 changes: 12 additions & 25 deletions SeaBlock/data-final-fixes/recipe.lua
Original file line number Diff line number Diff line change
@@ -1,43 +1,30 @@
-- Revert massive buff of insulated wire recipe
bobmods.lib.recipe.set_energy_required("insulated-cable", 2)
seablock.lib.substingredient("insulated-cable", "tinned-copper-cable", nil, 8)
seablock.lib.substingredient("insulated-cable", "rubber", nil, 8)
bobmods.lib.recipe.set_result("insulated-cable", { "insulated-cable", 8 })
bobmods.lib.recipe.set_energy_required("bob-insulated-cable", 2)
seablock.lib.substingredient("bob-insulated-cable", "bob-tinned-copper-cable", nil, 8)
seablock.lib.substingredient("bob-insulated-cable", "bob-rubber", nil, 8)
bobmods.lib.recipe.set_result("bob-insulated-cable", { type = "item", name = "bob-insulated-cable", amount = 8 })

-- Combine Stone and Crushed Stone
local function replace_stone(recipe)
if recipe.ingredients then
for _, ingredient in pairs(recipe.ingredients) do
if ingredient.name == "stone" then
ingredient.amount = ingredient.amount * 2
elseif ingredient.name == "stone-crushed" then
elseif ingredient.name == "angels-stone-crushed" then
ingredient.name = "stone"
elseif ingredient[1] == "stone" then
ingredient[2] = ingredient[2] * 2
elseif ingredient[1] == "stone-crushed" then
ingredient[1] = "stone"
end
end
end
if recipe.results then
if recipe.results then --needed for recipes parameter- which have no results
for _, result in pairs(recipe.results) do
if result.name == "stone" then
result.amount = result.amount * 2
elseif result.name == "stone-crushed" then
elseif result.name == "angels-stone-crushed" then
result.name = "stone"
elseif result[1] == "stone" then
result[2] = result[2] * 2
elseif result[1] == "stone-crushed" then
result[1] = "stone"
end
end
end
if recipe.result == "stone" then
recipe.result_count = recipe.result_count or 1 * 2
elseif recipe.result == "stone-crushed" then
recipe.result = "stone"
end
if recipe.main_product == "stone-crushed" then
if recipe.main_product == "angels-stone-crushed" then
recipe.main_product = "stone"
end
end
Expand All @@ -52,11 +39,11 @@ for _, recipe in pairs(data.raw.recipe) do
replace_stone(recipe)
end
end
bobmods.lib.recipe.hide("stone-crushed")
seablock.lib.hide("item", "stone-crushed")
bobmods.lib.recipe.hide("angels-stone-from-crushed-stone")
seablock.lib.hide("item", "angels-stone-crushed")

if data.raw.recipe["stone-crushed-dissolution"] then
data.raw.recipe["stone-crushed-dissolution"].icons = angelsmods.functions.create_liquid_recipe_icon(
if data.raw.recipe["angels-stone-crushed-dissolution"] then
data.raw.recipe["angels-stone-crushed-dissolution"].icons = angelsmods.functions.create_liquid_recipe_icon(
nil,
{ { 142, 079, 028 }, { 107, 062, 021 }, { 075, 040, 015 } },
{ "stone" }
Expand Down
Loading
Loading