diff --git a/SeaBlock/changelog.txt b/SeaBlock/changelog.txt index 729638b0..ddf378bf 100644 --- a/SeaBlock/changelog.txt +++ b/SeaBlock/changelog.txt @@ -2,9 +2,31 @@ 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 + - Basegame 2.0 changes + - Added/Modified library functions to include better warnings/new 2.0 code + - Removed all references of normal/expensive recipes + - Crafting category "electronics" is no longer craftable by hand (see Fulgora changes) and must thus be readded to handcrafting + - Updated the mapgen to implement the new 2.0 mapgen functions + - Added "tile_condition" to landfill (2.0) + - Replaced old research trigger with new 2.0 trigger tech + - Added incompatibility condition with "space-age" and "quality" for SeaBlockMetaPack + - BobsMods 2.0 changes + - Reimplemented "item-group": "bob-gems" since it is quite fitting in SB + - bobwarfare 2.0 now includes "coal" in "firearm-magazine" which is unobtainable so this change is reverted + - bobplates 2.0 uses "steel-plate"/"iron-plate" instead of "plastic-bar" in batteries, this change is reverted + - "bob-alien-x-alloy" is hidden in SB and must be removed from the equipment recipes + - "bob-rocket-engine" is no longer needed + - AngelsMods 2.0 changes + - The ore amount for tin and lead were changed in 2.0, this was reverted + - SpaceMod 2.0 changes + - None of the listed recipes took one of the listed upgrades or were already applied + - Because of the changes of bobmodules and circuitprocessing the tech prerequisites changed as well + - Miscellaneous 2.0 changes + - control.lua cleanup + - data-final-fixes.lua cleanup + - SCT 2.0 has replaced "automation-science-pack" with "sct-automation-science-pack" + - Added "shotgun" recipe if "blueprint-shotgun" is enabled + - Changed the volume of the "wind-turbine-2" as it is way too loud --------------------------------------------------------------------------------------------------- Version: 0.5.17 Date: ??.??.?? diff --git a/SeaBlock/control.lua b/SeaBlock/control.lua index 49bae988..4564038a 100644 --- a/SeaBlock/control.lua +++ b/SeaBlock/control.lua @@ -188,45 +188,7 @@ 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 quantity > 0 then - inv.insert({ name = item, count = quantity }) - end - end - end -end) - -if script.active_mods["Companion_Drones"] then - script.on_event(defines.events.on_player_created, function(e) - local s = game.surfaces["nauvis"] - if s then - local companions = s.find_entities_filtered({ name = "companion" }) - for _, companion in pairs(companions) do - local inventory = companion.get_main_inventory() - local i = companion.remove_item("coal") - -- Only do drone inventory cleanup if coal is found - -- Else players will get free wood pellets any time a new player joins - if i > 0 then - companion.insert("wood-pellets") - local grid = companion.grid - for _, item in pairs(grid.equipment) do - if (item.name == "companion-defense-equipment") or (item.name == "companion-shield-equipment") then - grid.take({ equipment = item }) - end - end - end - end - end - end) -end - -script.on_load(function() - set_pvp() -end) - -script.on_event(defines.events.on_player_created, function(e) + game.get_player(e.player_index).get_main_inventory().clear() 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 diff --git a/SeaBlock/data-final-fixes.lua b/SeaBlock/data-final-fixes.lua index c7952791..d1638927 100644 --- a/SeaBlock/data-final-fixes.lua +++ b/SeaBlock/data-final-fixes.lua @@ -17,11 +17,6 @@ for _, v in pairs(reactors) do end end --- Refresh circuit board icon as it may have been overwritten -if data.raw.tool["sb-basic-circuit-board-tool"] and data.raw.item["basic-circuit-board"] then - seablock.lib.copy_icon(data.raw.tool["sb-basic-circuit-board-tool"], data.raw.item["basic-circuit-board"]) -end - require("data-final-fixes/logistics") require("data-final-fixes/icons") require("data-final-fixes/recipe") @@ -29,6 +24,8 @@ require("data-final-fixes/tech-tree") require("data-final-fixes/unobtainable_items") require("data-final-fixes/mapgen") require("data-final-fixes/SpaceMod") +require("data-final-fixes/entities") + data.raw.recipe["copper-cable"].allow_decomposition = true data.raw.recipe["angels-solid-paper"].allow_decomposition = true @@ -38,3 +35,58 @@ for _, v in pairs(data.raw.character) do table.insert(v.crafting_categories, "sb-crafting-handonly") end end + +-- Adds handcrafting recipes because crafting category "electronics" is no longer craftable by hand +local handcrafting_recipes = { + "electronic-circuit", + "copper-cable", + "advanced-circuit", + "bob-tinned-copper-cable", + "bob-insulated-cable", + "bob-gilded-copper-cable", + "bob-wooden-board", + "bob-basic-circuit-board", + "bob-robot-brain", + "bob-robot-brain-2", + "bob-robot-brain-3", + "bob-robot-brain-4", + "angels-wire-gold", + "angels-wire-platinum", + "angels-wire-silver", + "angels-wire-tin" +} + +if mods["bobmodules"] then + table.insert(handcrafting_recipes, "bob-module-case") + table.insert(handcrafting_recipes, "bob-module-contact") + table.insert(handcrafting_recipes, "bob-speed-processor") + table.insert(handcrafting_recipes, "bob-efficiency-processor") + table.insert(handcrafting_recipes, "bob-productivity-processor") +end + +if mods["CircuitProcessing"] then + table.insert(handcrafting_recipes, "cp-electronic-circuit-board") + table.insert(handcrafting_recipes, "cp-advanced-circuit-board") +end + +for _, name in pairs(handcrafting_recipes) do + seablock.lib.add_recipe_category(name, "crafting") +end + +if mods["bobelectronics"] and mods["bobassembly"] then + -- Recipe was craftable with assembling-machine-1 even though it required a fluid + data.raw.recipe["bob-phenolic-board"].category = "electronics-with-fluid" + data.raw.recipe["bob-phenolic-board"].additional_categories = nil +end + + +--- TODO +--- This fix is only temporary +--- Needed because angelspetrochem moved the global_replace_item function to +--- data-updates stage (was in data-final-fixes stage) +if mods["bobplates"] and mods["angelspetrochem"] then + local OV = angelsmods.functions.OV + + OV.global_replace_item("bob-carbon", "angels-solid-carbon") + OV.execute() +end \ No newline at end of file diff --git a/SeaBlock/data-final-fixes/entities.lua b/SeaBlock/data-final-fixes/entities.lua new file mode 100644 index 00000000..1ace4936 --- /dev/null +++ b/SeaBlock/data-final-fixes/entities.lua @@ -0,0 +1,19 @@ +-- crafting category "electronics" got removed from assembling machines since it is now part of Fulgora +if mods["bobassembly"] then + seablock.lib.add_category("assembling-machine", "assembling-machine-1", "electronics") + + seablock.lib.add_category("assembling-machine", "assembling-machine-2", "electronics") + seablock.lib.add_category("assembling-machine", "assembling-machine-2", "electronics-with-fluid") + + seablock.lib.add_category("assembling-machine", "assembling-machine-3", "electronics") + seablock.lib.add_category("assembling-machine", "assembling-machine-3", "electronics-with-fluid") + + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-4", "electronics") + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-4", "electronics-with-fluid") + + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-5", "electronics") + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-5", "electronics-with-fluid") + + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-6", "electronics") + seablock.lib.add_category("assembling-machine", "bob-assembling-machine-6", "electronics-with-fluid") +end diff --git a/SeaBlock/data-final-fixes/logistics.lua b/SeaBlock/data-final-fixes/logistics.lua index 939c055d..392a987f 100644 --- a/SeaBlock/data-final-fixes/logistics.lua +++ b/SeaBlock/data-final-fixes/logistics.lua @@ -31,6 +31,9 @@ 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) +-- Change base game beacon +data.raw.beacon["beacon"].distribution_effectivity = 1 + -- Increase energy consumption of bob's extra beacons -- Also reduce module slots and effectivity if data.raw.beacon["bob-beacon-2"] then diff --git a/SeaBlock/data-final-fixes/mapgen.lua b/SeaBlock/data-final-fixes/mapgen.lua index f7ad3c9f..fa522f09 100644 --- a/SeaBlock/data-final-fixes/mapgen.lua +++ b/SeaBlock/data-final-fixes/mapgen.lua @@ -1,48 +1,99 @@ -- No resource placement -for k, v in pairs(data.raw.resource) do - v.autoplace = nil +for k, _ in pairs(data.raw.resource) do + data.raw.resource[k].autoplace = nil +end + +data.raw["planet"]["nauvis"].map_gen_settings.autoplace_settings = { + tile = { + settings = { + deepwater = {}, + water = {}, + ["sand-4"] = {}, + ["sand-5"] = {}, + } + }, + entity = { + settings = { + ["angels-desert-garden"] = {}, + ["angels-temperate-garden"] = {}, + ["angels-swamp-garden"] = {}, + + ["angels-desert-tree"] = {}, + ["angels-temperate-tree"] = {}, + ["angels-swamp-tree"] = {}, + + ["angels-puffer-nest"] = {}, + ["small-worm-turret"] = {}, + ["medium-worm-turret"] = {}, + ["big-worm-turret"] = {}, + ["behemoth-worm-turret"] = {}, + + ["angels-alien-fish-1"] = {}, + ["angels-alien-fish-2"] = {}, + ["angels-alien-fish-3"] = {}, + + ["fish"] = {} + } + } +} +data.raw["planet"]["nauvis"].map_gen_settings.autoplace_controls = nil + +-- Enemies +for _,name in pairs({ "bob-big-explosive-worm-turret", "bob-big-fire-worm-turret", "bob-big-poison-worm-turret", "bob-big-piercing-worm-turret", "bob-giant-worm-turret" }) do + if (data.raw.turret[name]) then + data.raw["planet"]["nauvis"].map_gen_settings.autoplace_settings.entity.settings[name] = {} + end end -- No spawners -for k, v in pairs(data.raw["unit-spawner"]) do +for _, v in pairs(data.raw["unit-spawner"]) do v.autoplace = nil - v.control = nil + if v.autoplace then + v.autoplace.default_enabled = false + end end -- No trees for k, v in pairs(data.raw.tree) do if - k ~= "temperate-garden" - and k ~= "desert-garden" - and k ~= "swamp-garden" - and k ~= "temperate-tree" - and k ~= "desert-tree" - and k ~= "swamp-tree" - and k ~= "puffer-nest" + k ~= "angels-temperate-garden" + and k ~= "angels-desert-garden" + and k ~= "angels-swamp-garden" + and k ~= "angels-temperate-tree" + and k ~= "angels-desert-tree" + and k ~= "angels-swamp-tree" + and k ~= "angels-puffer-nest" then v.autoplace = nil seablock.lib.add_flag("tree", v.name, "not-deconstructable") + else + v.autoplace.control = nil end end -- No rocks -for k, v in pairs(data.raw["simple-entity"]) do +for _, v in pairs(data.raw["simple-entity"]) do v.autoplace = nil seablock.lib.add_flag("simple-entity", v.name, "not-deconstructable") end +for _, v in pairs(data.raw["optimized-decorative"]) do + v.autoplace = nil + seablock.lib.add_flag("optimized-decorative", v.name, "not-deconstructable") +end + local keepcontrols = {} local turrets = data.raw["turret"] -for turret_name, turret in pairs(turrets) do +for _, turret in pairs(turrets) do if turret.autoplace and turret.autoplace.control then keepcontrols[turret.autoplace.control] = true end end local controls = data.raw["autoplace-control"] -for k, v in pairs(controls) do +for k, _ in pairs(controls) do if k ~= "enemy-base" and not keepcontrols[k] then - controls[k] = nil + data.raw["autoplace-control"][k] = nil end end diff --git a/SeaBlock/data-final-fixes/recipe.lua b/SeaBlock/data-final-fixes/recipe.lua index 855c0f1c..c6be73f8 100644 --- a/SeaBlock/data-final-fixes/recipe.lua +++ b/SeaBlock/data-final-fixes/recipe.lua @@ -38,3 +38,42 @@ if data.raw.recipe["angels-stone-crushed-dissolution"] then { "stone" } ) end + +-- Recipe gets changed by bobwarfare to include coal which is unobtainable +bobmods.lib.recipe.set_ingredients("firearm-magazine", {{ type = "item", name = "iron-plate", amount = 4}}) --this function automatically clears previous ingredients + +-- angelspetrochem changes petroleum-gas to angels-gas-methane +bobmods.lib.recipe.remove_ingredient("sct-t3-flash-fuel", "angels-gas-methane") + +-- bobmods switched plastic-bar for steel-plate in 2.0 +if settings.startup["bobmods-plates-batteryupdate"].value == true then + bobmods.lib.recipe.replace_ingredient("battery", "steel-plate", "plastic-bar") +else + bobmods.lib.recipe.replace_ingredient("battery", "iron-plate", "plastic-bar") +end +bobmods.lib.tech.add_prerequisite("battery", "plastics") + +if (mods["blueprint-shotgun"]) then + seablock.lib.unhide_recipe("shotgun") + seablock.lib.unhide_recipe("shotgun-shell") + + seablock.lib.unhide("gun", "shotgun") + seablock.lib.unhide("ammo", "shotgun-shell") + + bobmods.lib.tech.add_recipe_unlock("military", "shotgun") + bobmods.lib.tech.add_recipe_unlock("military", "shotgun-shell") +end + +-- bob-alien-x-alloy is hidden by Sea Block +bobmods.lib.recipe.replace_ingredient("bob-fission-reactor-equipment-4", "bob-alien-blue-alloy", "bob-cobalt-steel-alloy") +bobmods.lib.recipe.replace_ingredient("bob-fission-reactor-equipment-4", "bob-alien-fire", "angels-liquid-naphtha") + +bobmods.lib.recipe.replace_ingredient("bob-exoskeleton-equipment-3", "bob-alien-blue-alloy", "bob-cobalt-steel-alloy") + +bobmods.lib.recipe.replace_ingredient("bob-personal-laser-defense-equipment-6", "bob-alien-blue-alloy", "bob-cobalt-steel-alloy") +bobmods.lib.recipe.replace_ingredient("bob-personal-laser-defense-equipment-6", "bob-alien-orange-alloy", "bob-gold-plate") +bobmods.lib.recipe.replace_ingredient("bob-personal-laser-defense-equipment-6", "bob-alien-poison", "angels-liquid-nitric-acid") + +-- No longer needed for rockets +bobmods.lib.recipe.hide("bob-rocket-engine") +bobmods.lib.item.hide("bob-rocket-engine") \ No newline at end of file diff --git a/SeaBlock/data-final-fixes/tech-tree.lua b/SeaBlock/data-final-fixes/tech-tree.lua index ed11d03c..a6f3266e 100644 --- a/SeaBlock/data-final-fixes/tech-tree.lua +++ b/SeaBlock/data-final-fixes/tech-tree.lua @@ -18,12 +18,78 @@ bobmods.lib.tech.remove_prerequisite("circuit-network", "angels-bio-wood-process bobmods.lib.tech.add_prerequisite("circuit-network", "angels-bio-paper-1") bobmods.lib.tech.remove_prerequisite("angels-rubbers", "circuit-network") +-- Alien research is disabled in Sea Block +bobmods.lib.tech.remove_prerequisite("bob-exoskeleton-equipment-3", "bob-alien-blue-research") + +bobmods.lib.tech.remove_prerequisite("bob-fission-reactor-equipment-3", "bob-alien-research") +bobmods.lib.tech.remove_prerequisite("bob-fission-reactor-equipment-4", "bob-alien-blue-research") +bobmods.lib.tech.remove_prerequisite("bob-fission-reactor-equipment-4", "bob-alien-red-research") + +if data.raw.technology["bob-personal-laser-defense-equipment-6"] then + local tech = data.raw.technology["bob-personal-laser-defense-equipment-6"] + + tech.unit = { + count = 350, + time = 30, + ingredients = { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "military-science-pack", 1 }, + { "production-science-pack", 1 }, + { "utility-science-pack", 1 }, + { "space-science-pack", 1 }, + } + } + + bobmods.lib.tech.remove_prerequisite("bob-personal-laser-defense-equipment-6", "bob-alien-orange-research") + bobmods.lib.tech.remove_prerequisite("bob-personal-laser-defense-equipment-6", "bob-alien-blue-research") + bobmods.lib.tech.remove_prerequisite("bob-personal-laser-defense-equipment-6", "bob-alien-green-research") +end + +bobmods.lib.tech.remove_prerequisite("bob-power-armor-3", "bob-alien-research") + -- Unhide solid fuel from hydrogen seablock.lib.unhide_recipe("bob-solid-fuel-from-hydrogen") seablock.lib.add_recipe_unlock("flammables", "bob-solid-fuel-from-hydrogen", 4) +data.raw.recipe["bob-solid-fuel-from-hydrogen"].localised_name = nil bobmods.lib.tech.replace_prerequisite( "bob-lithium-processing", "angels-chlorine-processing-4", "angels-chlorine-processing-2" ) + +-- electronics is hidden since it is a trigger tech and is replaced by bob-electronics +bobmods.lib.tech.remove_prerequisite("automation-2", "electronics") +bobmods.lib.tech.remove_prerequisite("logistics-2", "electronics") +bobmods.lib.tech.remove_prerequisite("bob-chemical-plant", "electronics") + +-- repair-pack is now unlocked with military +bobmods.lib.tech.remove_prerequisite("bob-repair-pack-2", "repair-pack") + +-- Empty technology +bobmods.lib.tech.hide("bob-chemical-plant") + +bobmods.lib.tech.remove_prerequisite("lubricant", "bob-chemical-plant") +bobmods.lib.tech.remove_prerequisite("plastics", "bob-chemical-plant") + +-- uranium-mining only adds fluid inputs to mining drills which is never used +bobmods.lib.tech.hide("uranium-mining") +bobmods.lib.tech.remove_prerequisite("uranium-processing", "uranium-mining") + +-- Not needed in Sea Block +bobmods.lib.tech.remove_prerequisite("angels-bio-processing-blue", "bob-zinc-processing") +bobmods.lib.tech.remove_prerequisite("angels-bio-processing-blue", "angels-stone-smelting-2") +bobmods.lib.tech.remove_prerequisite("angels-bio-processing-blue", "angels-aluminium-smelting-1") + +bobmods.lib.tech.remove_recipe_unlock("angels-bio-wood-processing", "angels-wood-bricks") + +bobmods.lib.tech.remove_prerequisite("angels-bio-wood-processing-2", "angels-coal-processing") +seablock.lib.add_recipe_unlock("angels-bio-wood-processing-2", "angels-wood-bricks", 3) + +bobmods.lib.tech.remove_prerequisite("angels-bio-wood-processing-3", "angels-stone-smelting-1") +bobmods.lib.tech.remove_recipe_unlock("angels-bio-wood-processing-3", "angels-bio-processor") + +-- Bobs Greenhouse +bobmods.lib.tech.replace_prerequisite("bob-greenhouse", "automation-science-pack", "sct-automation-science-pack") \ No newline at end of file diff --git a/SeaBlock/data-final-fixes/unobtainable_items.lua b/SeaBlock/data-final-fixes/unobtainable_items.lua index aa01abbb..f1cadc10 100644 --- a/SeaBlock/data-final-fixes/unobtainable_items.lua +++ b/SeaBlock/data-final-fixes/unobtainable_items.lua @@ -13,19 +13,19 @@ for k, v in pairs(itemrename) do data.raw.item[v] = item end end + local function updateline(line) local item = line.name if itemrename[item] then line.name = itemrename[item] end + end for _, recipe in pairs(data.raw.recipe) do - for _, v in pairs(recipe.ingredients) do + for _, v in pairs(recipe.ingredients or {}) do updateline(v) end - if recipe.result and itemrename[recipe.result] then - recipe.result = itemrename[recipe.result] - end + for _, v in pairs(recipe.results or {}) do updateline(v) end @@ -131,8 +131,7 @@ for k, v in pairs(data.raw.technology) do end end -for k, v in pairs(recipes) do - for _, recipe in pairs(v) do +for k, recipe in pairs(recipes) do local items = {} if recipe.ingredients then for _, ingredient in pairs(recipe.ingredients) do @@ -161,7 +160,6 @@ for k, v in pairs(recipes) do unobtainable[r] = nil end end - end end local work = true @@ -187,6 +185,19 @@ for k, _ in pairs(unobtainable) do seablock.lib.hide_item(k) end +local keep_unobtainable_recipes = { + ["parameter-0"] = true, + ["parameter-1"] = true, + ["parameter-2"] = true, + ["parameter-3"] = true, + ["parameter-4"] = true, + ["parameter-5"] = true, + ["parameter-6"] = true, + ["parameter-7"] = true, + ["parameter-8"] = true, + ["parameter-9"] = true +} + -- Remove any recipe that uses an unobtainable ingredient for recipe_name, recipe in pairs(data.raw.recipe) do local keep = true @@ -225,3 +236,30 @@ end if data.raw.lab["bob-lab-alien"] then data.raw.lab["bob-lab-alien"].inputs = {} end + +-- We now need a dummy lab that can take all the science packs or else some techs can't load (even if hidden), (we could also use "bob-lab-alien" which is hidden in data-updates/military.lua) +local dummyLab = table.deepcopy(data.raw.lab["lab"]) +dummyLab.name = "dummy-lab" +dummyLab.hidden = true +--dummyLab.hidden_in_factoriopedia = true +bobmods.lib.safe_insert(dummyLab.inputs, "space-science-pack") +if data.raw.tool["sct-bio-science-pack"] then + bobmods.lib.safe_insert(dummyLab.inputs, "sct-bio-science-pack") +end +bobmods.lib.safe_insert(dummyLab.inputs, "automation-science-pack") +bobmods.lib.safe_insert(dummyLab.inputs, "logistic-science-pack") +bobmods.lib.safe_insert(dummyLab.inputs, "chemical-science-pack") +bobmods.lib.safe_insert(dummyLab.inputs, "production-science-pack") +bobmods.lib.safe_insert(dummyLab.inputs, "utility-science-pack") + +if mods["bobtech"] and mods["bobenemies"] then + bobmods.lib.safe_insert(dummyLab.inputs, "bob-science-pack-gold") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-purple") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-blue") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-red") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-green") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-orange") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack-yellow") + bobmods.lib.safe_insert(dummyLab.inputs, "bob-alien-science-pack") +end +data:extend({dummyLab}) \ No newline at end of file diff --git a/SeaBlock/data-updates/SpaceMod.lua b/SeaBlock/data-updates/SpaceMod.lua index 5170fc3a..5f6767d4 100644 --- a/SeaBlock/data-updates/SpaceMod.lua +++ b/SeaBlock/data-updates/SpaceMod.lua @@ -20,16 +20,6 @@ if mods["SpaceMod"] then bobmods.lib.tech.add_prerequisite("space-assembly", "bob-robots-4") end - if not mods["bobmodules"] then - -- Do nothing - elseif mods["CircuitProcessing"] then - bobmods.lib.tech.add_prerequisite("space-assembly", "effectivity-module-4") - bobmods.lib.tech.add_prerequisite("space-assembly", "productivity-module-4") - bobmods.lib.tech.add_prerequisite("space-assembly", "speed-module-4") - else - bobmods.lib.tech.add_prerequisite("space-assembly", "productivity-module-8") - end - if mods["bobpower"] and settings.startup["bobmods-power-solar"].value == true then bobmods.lib.tech.add_prerequisite("space-construction", "bob-solar-energy-3") end diff --git a/SeaBlock/data-updates/clowns.lua b/SeaBlock/data-updates/clowns.lua index cc940dd1..9bd9cdf5 100644 --- a/SeaBlock/data-updates/clowns.lua +++ b/SeaBlock/data-updates/clowns.lua @@ -25,7 +25,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore1", amount = 1 }, @@ -46,7 +46,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore2", amount = 1 }, @@ -67,7 +67,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore3", amount = 1 }, @@ -88,7 +88,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore4", amount = 1 }, @@ -109,7 +109,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore5", amount = 1 }, @@ -130,7 +130,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore6", amount = 1 }, @@ -151,7 +151,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore7", amount = 1 }, @@ -172,7 +172,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore8", amount = 1 }, @@ -193,7 +193,7 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "fluid", name = "mineral-sludge", amount = 25 }, + { type = "fluid", name = "angels-mineral-sludge", amount = 25 }, }, results = { { type = "item", name = "clowns-ore9", amount = 1 }, @@ -210,8 +210,8 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "item", name = "solid-sand", amount = 1 }, - { type = "item", name = "stone-crushed", amount = 6 }, + { type = "item", name = "angels-solid-sand", amount = 1 }, + { type = "item", name = "stone", amount = 6 }, }, results = { { type = "item", name = "clowns-resource1", amount = 1 }, @@ -228,8 +228,8 @@ if mods["Clowns-Extended-Minerals"] then allow_decomposition = false, energy_required = 4, ingredients = { - { type = "item", name = "solid-sand", amount = 5 }, - { type = "item", name = "blue-cellulose-fiber", amount = 1 }, + { type = "item", name = "angels-solid-sand", amount = 5 }, + { type = "item", name = "angels-blue-cellulose-fiber", amount = 1 }, }, results = { { type = "item", name = "clowns-resource2", amount = 5 }, diff --git a/SeaBlock/data-updates/coal.lua b/SeaBlock/data-updates/coal.lua index a084ffed..64e10242 100644 --- a/SeaBlock/data-updates/coal.lua +++ b/SeaBlock/data-updates/coal.lua @@ -42,4 +42,4 @@ bobmods.lib.tech.add_prerequisite("angels-coal-processing-3", "angels-sodium-pro -- Buff the Carbon 2 recipe to make it a bit more worthwhile bobmods.lib.recipe.set_result("angels-coke-purification-2", { type = "item", name = "angels-solid-carbon", amount = 8 }) -data.raw.recipe["angels-filter-coal"].localised_name = { "item-name.angels-filter-charcoal" } +data.raw.recipe["angels-filter-coal"].localised_name = { "item-name.angels-filter-charcoal" } \ No newline at end of file diff --git a/SeaBlock/data-updates/fuel.lua b/SeaBlock/data-updates/fuel.lua index 6995edae..2eeec4ac 100644 --- a/SeaBlock/data-updates/fuel.lua +++ b/SeaBlock/data-updates/fuel.lua @@ -63,7 +63,10 @@ if mods["KS_Power"] then seablock.lib.hide("burner-generator", "big-burner-generator") seablock.lib.hide("burner-generator", "burner-generator") seablock.lib.hide("generator", "petroleum-generator") + local turbine = data.raw["electric-energy-interface"]["wind-turbine-2"] + turbine.working_sound.sound.volume = 0.3 + if turbine and turbine.energy_source then turbine.energy_source.output_flow_limit = "15kW" end diff --git a/SeaBlock/data-updates/groups.lua b/SeaBlock/data-updates/groups.lua index bf590147..cacb9ce3 100644 --- a/SeaBlock/data-updates/groups.lua +++ b/SeaBlock/data-updates/groups.lua @@ -1,18 +1,21 @@ local move_item = angelsmods.functions.move_item if not mods["angelsindustries"] then - -- Move misc sciencey things over to intermediate products tab - for k, v in pairs(data.raw["item-subgroup"]) do + -- Move all the gems to separate gems group + for _, v in pairs(data.raw["item-subgroup"]) do if - v.group == "bob-resource-products" - or v.group == "bob-fluid-products" - or v.group == "bob-intermediate-products" + v.name == "bob-gems-crystallization" + or v.name == "bob-gems-raw" + or v.name == "bob-gems-cut" + or v.name == "bob-gems-polished" then + v.group = "bob-gems" + end + if (v.name == "bob-nuclear") then v.group = "intermediate-products" end end - move_item("battery", "bob-intermediates", "f-cba[battery]") move_item("iron-gear-wheel", "bob-gears", "aa[iron-gear-wheel]") end diff --git a/SeaBlock/data-updates/landfill.lua b/SeaBlock/data-updates/landfill.lua index 4bd037d1..1b0231c0 100644 --- a/SeaBlock/data-updates/landfill.lua +++ b/SeaBlock/data-updates/landfill.lua @@ -6,9 +6,15 @@ for k, v in pairs(data.raw.item) do end end +local function strip_landfill_string(name) + return name:gsub("^landfill%-", "") +end + -- Set prefered type for basic landfill crafting if settings.startup["sb-default-landfill"] and data.raw.item[settings.startup["sb-default-landfill"].value] then - data.raw.recipe["landfill"].result = settings.startup["sb-default-landfill"].value + data.raw.recipe["landfill"].results[1].name = settings.startup["sb-default-landfill"].value + + data.raw.recipe["landfill"].localised_name = {strip_landfill_string(settings.startup["sb-default-landfill"].value)..'-name.name'} end local function BuffLandfill(recipe) @@ -34,8 +40,48 @@ end data.raw.technology["landfill"].prerequisites = { "angels-water-washing-1" } data.raw.technology["landfill"].unit = { count = 10, - ingredients = { { type = "item", name = "automation-science-pack", amount = 1 } }, + ingredients = { { "automation-science-pack", 1 } }, time = 15, } bobmods.lib.tech.remove_prerequisite("angels-water-washing-2", "landfill") bobmods.lib.tech.ignore_tech_cost_multiplier("landfill", true) + +local startup_landfill = "landfill" +local setting = settings.startup["sb-default-landfill"] + +if setting and type(setting.value) == "string" then + local stripped = strip_landfill_string(setting.value) + if data.raw.tile[stripped] then + startup_landfill = stripped + end +end + +-- For blueprint pasting on water +data.raw.tile["water"].default_cover_tile = startup_landfill +data.raw.tile["deepwater"].default_cover_tile = startup_landfill + +-- Adds SeaBlock tiles to tile condition so they can be replaced with landfill when placing +if mods["LandfillPainting"] then + local terrains = { + "dry-dirt", + "dirt-4", + "grass-1", + "red-desert-1", + "sand-3" + } + + for _, name in pairs(terrains) do + if (data.raw.item["landfill-"..name].place_as_tile.tile_condition) then + local tile_cond = data.raw.item["landfill-"..name].place_as_tile.tile_condition + + table.insert(tile_cond, "sand-4") + table.insert(tile_cond, "sand-5") + end + end +end + +-- Paste over sand-4 and -5 +local tile_cond = data.raw.item["landfill"].place_as_tile.tile_condition + +table.insert(tile_cond, "sand-4") +table.insert(tile_cond, "sand-5") \ No newline at end of file diff --git a/SeaBlock/data-updates/misc.lua b/SeaBlock/data-updates/misc.lua index 989a3961..0159e58a 100644 --- a/SeaBlock/data-updates/misc.lua +++ b/SeaBlock/data-updates/misc.lua @@ -36,13 +36,19 @@ if not seablock.trigger.mining_productivity then end end +-- Angels-sea-pump-resource is a virtual resource. +-- When the heavy offshore pump is placed, it is supposed to be replaced by the resource and a mining-drill. +-- Removing the resource causes placement of heavy pumps to crash new maps. +-- Crude-oil causes an error because of the trigger techs +local exclusion_map = { + ["angels-sea-pump-resource"] = true, + ["crude-oil"] = true +} + -- Remove resources so mining recipes don't show in FNEI -- Have to leave at least one resource or game will not load -for k, v in pairs(data.raw["resource"]) do - -- Sea-pump-resource is a virtual resource. - -- When the offshore pump is placed, it is supposed to be replaced by the resource and a mining-drill. - -- Removing the resource causes placement of heavy pumps to crash new maps. - if k ~= "sea-pump-resource" then +for k, _ in pairs(data.raw["resource"]) do + if (not exclusion_map[k]) then data.raw["resource"][k] = nil end end @@ -141,7 +147,6 @@ seablock.lib.substingredient("angels-ore-pure-mix2-processing", "angels-ore3-pur -- Unhide rocket part to make it easier to view recipes if data.raw.recipe["rocket-part"] then - angelsmods.functions.remove_flag("rocket-part", "hidden") local r = data.raw.recipe["rocket-part"] r.hidden = false @@ -238,4 +243,4 @@ bobmods.lib.recipe.remove_ingredient("angels-solid-cement-2", "iron-ore") bobmods.lib.recipe.replace_ingredient("angels-solid-cement-2", "bob-quartz", "bob-silicon-powder") bobmods.lib.recipe.set_ingredient("angels-solid-cement-2", { type = "item", name = "angels-solid-lime", amount = 4 }) bobmods.lib.recipe.set_result("angels-solid-cement-2", { type = "item", name = "angels-solid-cement", amount = 4 }) -bobmods.lib.recipe.set_energy_required("angels-solid-cement-2", 16) +bobmods.lib.recipe.set_energy_required("angels-solid-cement-2", 16) \ No newline at end of file diff --git a/SeaBlock/data-updates/slag-processing.lua b/SeaBlock/data-updates/slag-processing.lua index 9d285347..2623803b 100644 --- a/SeaBlock/data-updates/slag-processing.lua +++ b/SeaBlock/data-updates/slag-processing.lua @@ -18,8 +18,8 @@ end -- Angels ores 1, 3 (Saphirite, Stiratite) available from tutorial tech 1, -- Angels ores 5, 6 (Rubyte, Bobmonium) available from Slag processing 1 -- Angels ores 2, 4 (Jivolite, Crotinnium) available from Advanced mechanical refining -bobmods.lib.recipe.enabled("angels-ore1-crushed-smelting", false) -bobmods.lib.recipe.enabled("angels-ore3-crushed-smelting", false) +bobmods.lib.recipe.enabled("iron-plate", false) +bobmods.lib.recipe.enabled("copper-plate", false) seablock.lib.moveeffect("angels-catalysator-brown", "angels-slag-processing-1", "angels-advanced-ore-refining-1", 3) local slag1start = seablock.lib.findeffectidx(data.raw.technology["angels-slag-processing-1"].effects, "angels-slag-processing-1") @@ -130,3 +130,30 @@ table.insert(data.raw["assembling-machine"]["angels-electrolyser-4"].crafting_ca bobmods.lib.recipe.set_category("angels-ore8-anode-sludge", "sb-petrochem-electrolyser-4") bobmods.lib.recipe.set_category("angels-ore9-anode-sludge", "sb-petrochem-electrolyser-4") bobmods.lib.tech.add_prerequisite("angels-ore-electro-whinning-cell", "angels-advanced-chemistry-3") + +-- This was changed by Angelsmods in 2.0 +local OV = angelsmods.functions.OV +OV.patch_recipes({ + { + name = "bob-tin-plate", + ingredients = { + { name = "bob-tin-ore", type = "item", amount = "+3" }, + }, + results = { + { name = "bob-tin-plate", type = "item", amount = "+2" }, + }, + localised_name = { "item-name.bob-tin-plate" }, + subgroup = "angels-tin-casting" + }, + { + name = "bob-lead-plate", + ingredients = { + { name = "bob-lead-ore", type = "item", amount = "+3" }, + }, + results = { + { name = "bob-lead-plate", type = "item", amount = "+2" }, + }, + localised_name = { "item-name.bob-lead-plate" }, + subgroup = "angels-lead-casting" + } +}) \ No newline at end of file diff --git a/SeaBlock/data-updates/startup.lua b/SeaBlock/data-updates/startup.lua index 463c721d..c0a7abce 100644 --- a/SeaBlock/data-updates/startup.lua +++ b/SeaBlock/data-updates/startup.lua @@ -133,7 +133,7 @@ local function consumes_startup_item(recipe) ["copper-cable"] = true, ["stone-furnace"] = true, } - for k, v in pairs(recipe.ingredients) do + for k, v in pairs(recipe.ingredients or {}) do if ironnames[v.name] then found = true break @@ -207,3 +207,9 @@ data.raw.technology["angels-bio-wood-processing"].unit = { ingredients = {}, time = 1, } + +-- Remove cycle introduced in the tech tree +-- Sectoid upgraded angelsbioprocessing by renaming the old prerequisite "basic-automation" into "electronics" +bobmods.lib.tech.remove_prerequisite("angels-basic-chemistry", "electronics") +bobmods.lib.tech.remove_prerequisite("angels-bio-processing-brown", "electronics") +bobmods.lib.tech.add_prerequisite("angels-bio-processing-brown", "automation") \ No newline at end of file diff --git a/SeaBlock/data-updates/sulfur.lua b/SeaBlock/data-updates/sulfur.lua index 1f6ba9de..0a8faa4d 100644 --- a/SeaBlock/data-updates/sulfur.lua +++ b/SeaBlock/data-updates/sulfur.lua @@ -2,8 +2,9 @@ local washing_fluid_box = { production_type = "output", pipe_covers = pipecoverspictures(), - base_level = 1, - pipe_connections = { { position = { -3, 0 }, type = "output" } }, + --base_level = 1, + volume = 100, --TODO: decide the correct value + pipe_connections = { { position = { -2, 0 }, flow_direction = "output", direction = defines.direction.west } }, } for _, v in pairs({ "", "-2", "-3", "-4" }) do local washingplant = data.raw["assembling-machine"]["angels-washing-plant" .. v] diff --git a/SeaBlock/data-updates/thermal-extractor.lua b/SeaBlock/data-updates/thermal-extractor.lua index 1f46955d..63296731 100644 --- a/SeaBlock/data-updates/thermal-extractor.lua +++ b/SeaBlock/data-updates/thermal-extractor.lua @@ -24,7 +24,7 @@ local function makeextractorlayers(bottom, top) shift = { 0, 0 }, frame_count = 16, x = 288 * 2, - animation_speed = 0.5, + animation_speed = 1, }) end table.insert(layers, { @@ -35,7 +35,7 @@ local function makeextractorlayers(bottom, top) shift = { 0, 0 }, filename = "__angelsrefininggraphics__/graphics/entity/thermal-extractor/thermal-extractor-animation.png", frame_count = 16, - animation_speed = 0.5, + animation_speed = 1, }) if bottom then table.insert(layers, { @@ -49,7 +49,7 @@ local function makeextractorlayers(bottom, top) shift = { 0, 0 }, frame_count = 16, x = 0, - animation_speed = 0.5, + animation_speed = 1, }) end return { layers = layers } @@ -65,32 +65,32 @@ extractor.fluid_boxes = { { production_type = "input", base_area = 10, - base_level = -1, + --base_level = -1, + volume = 1000, pipe_covers = pipecoverspictures(), - pipe_connections = { { type = "input", position = { 5, 3 } } }, + pipe_connections = { { flow_direction = "input", position = { 3, - 4 }, direction = defines.direction.north } }, }, { production_type = "output", base_area = 10, - base_level = 1, + --base_level = 1, + volume = 1000, pipe_covers = pipecoverspictures(), - pipe_connections = { { type = "output", position = { -5, -3 } } }, + pipe_connections = { { flow_direction = "output", position = { -3, 4 }, direction = defines.direction.south } }, }, } -extractor.animation = { - north = makeextractorlayers(false, false), - east = makeextractorlayers(true, true), - south = makeextractorlayers(false, false), - west = makeextractorlayers(true, true), +extractor.graphics_set.animation = { + north = makeextractorlayers(true, true), + east = makeextractorlayers(false, false), + south = makeextractorlayers(true, true), + west = makeextractorlayers(false, false), } extractor.crafting_categories = { "sb-thermal-extractor" } extractor.fixed_recipe = "sb-thermal-extractor-water" bobmods.lib.tech.add_recipe_unlock("angels-thermal-water-extraction-2", "sb-thermal-extractor-water") move_item("angels-thermal-extractor", "angels-water-treatment-building", "f[thermal-extractor]-b[extractor]", "item") -bobmods.lib.recipe.add_ingredient( - "angels-thermal-extractor", - { type = "item", name = "angels-thermal-bore", amount = 1 } -) +bobmods.lib.recipe.add_ingredient("angels-thermal-extractor", { type = "item", name = "angels-thermal-bore", amount = 1 }) +extractor.vector_to_place_result = nil -- remove the yellow arrow of the mining drill local bore = data.raw["mining-drill"]["angels-thermal-bore"] data.raw["mining-drill"]["angels-thermal-bore"] = nil @@ -102,56 +102,49 @@ bore.fluid_boxes = { { production_type = "output", base_area = 1, - base_level = 1, - pipe_covers = pipecoverspictures(), - pipe_connections = { - { - type = "output", - position = { -5, -3 }, - }, - }, + volume = 500, + pipe_covers = bore.output_fluid_box.pipe_covers, + pipe_connections = bore.output_fluid_box.pipe_connections }, } -bore.animation = { - north = makeextractorlayers(false, false), - east = makeextractorlayers(true, true), - south = makeextractorlayers(false, false), - west = makeextractorlayers(true, true), -} -bore.crafting_categories = { "sb-thermal-bore" } -bore.fixed_recipe = "sb-thermal-bore-water" +bore.vector_to_place_result = nil -local function makesheet(sheet, count, d) - local r = table.deepcopy(sheet) - r.stripes = makestripes(r.filename, count) - r.frame_count = count - r.filename = nil - r.x = r.width * d - if r.hr_version then - r.hr_version = makesheet(r.hr_version, count, d) - end - return r -end -local function makeborelayers(d) - return { +-- This is needed for the animation below +bore.base_picture.sheet.line_length = 1 +bore.base_picture.sheet.repeat_count = 16 + +-- Edit animation to include output pipe facing north and south +local working_animation = table.deepcopy(bore.graphics_set.animation.north) + +--- This animation is a translation of the mining_drill but for an assembling_machine +--- This is done because an assembling_machine has no base_picture so the northern and southern pipe extentions have to be added via animation +bore.graphics_set.animation = { + north = { layers = { - makesheet(bore.base_picture.sheets[1], bore.animations.north.layers[1].frame_count, d), - makesheet(bore.base_picture.sheets[2], bore.animations.north.layers[1].frame_count, d), - bore.animations.north.layers[1], - bore.animations.north.layers[2], - }, - } -end -bore.animation = { - north = makeborelayers(0), - east = makeborelayers(1), - south = makeborelayers(2), - west = makeborelayers(3), + table.deepcopy(bore.base_picture.sheet), + working_animation + } + }, + east = working_animation, + south = { + layers = { + table.deepcopy(bore.base_picture.sheet), + working_animation + } + }, + west = working_animation, } -bore.crafting_categories = { "thermal-bore" } -bore.fixed_recipe = "thermal-bore-water" -bobmods.lib.tech.add_recipe_unlock("thermal-water-extraction", "thermal-bore-water") -move_item("thermal-bore", "water-treatment-building", "f[thermal-extractor]-a[bore]", "item") + +-- Shift animation to make other pipe visible +bore.graphics_set.animation.south.layers[1].x = 576 + +-- Reset animation speed for directions without additional layers +bore.graphics_set.animation.east.animation_speed = 1 +bore.graphics_set.animation.west.animation_speed = 1 + +bore.crafting_categories = { "sb-thermal-bore" } +bore.fixed_recipe = "sb-thermal-bore-water" +bobmods.lib.tech.add_recipe_unlock("angels-thermal-water-extraction", "sb-thermal-bore-water") move_item("angels-thermal-bore", "angels-water-treatment-building", "f[thermal-extractor]-a[bore]", "item") -- Fish Pressing requires thermal water so add a prerequisite @@ -160,4 +153,4 @@ if data.raw.technology["angels-bio-pressing-fish"] then else bobmods.lib.tech.add_prerequisite("angels-bio-pressing-fish-1", "angels-thermal-water-extraction") end -bobmods.lib.tech.add_prerequisite("angels-thermal-water-extraction", "angels-bio-processing-brown") +bobmods.lib.tech.add_prerequisite("angels-thermal-water-extraction", "angels-bio-processing-brown") \ No newline at end of file diff --git a/SeaBlock/data-updates/wood.lua b/SeaBlock/data-updates/wood.lua index eb00e8ba..83422fe0 100644 --- a/SeaBlock/data-updates/wood.lua +++ b/SeaBlock/data-updates/wood.lua @@ -2,13 +2,6 @@ seablock.lib.removeingredient("bob-basic-underground-belt", "wood") seablock.lib.removeingredient("bob-basic-splitter", "wood") --- Can always apply productivity modules to furnace recipes, so make it official -for k, v in pairs(data.raw.module) do - if v.effect and v.effect.productivity and v.limitation then - table.insert(v.limitation, "sb-wood-bricks-charcoal") - end -end - bobmods.lib.recipe.enabled("wooden-chest", false) bobmods.lib.recipe.enabled("bob-wooden-board", false) bobmods.lib.recipe.enabled("angels-cellulose-fiber-raw-wood", false) diff --git a/SeaBlock/data/misc.lua b/SeaBlock/data/misc.lua index f75ccaf2..506fedd7 100644 --- a/SeaBlock/data/misc.lua +++ b/SeaBlock/data/misc.lua @@ -35,3 +35,14 @@ seablock.lib.copy_icon( data.raw.technology["angels-ore-crushing"], data.raw.technology["angels-advanced-ore-refining-1"] ) + +data:extend({ + { -- This was removed with bobs2.0 but is fitting for SeaBlock + -- TODO this might break when bio-processing-override-bob.lua gets changed because it moves its gems to group bob-gems + type = "item-group", + name = "bob-gems", + order = "d-g", + icon = "__bobplates__/graphics/icons/technology/gems.png", + icon_size = 64, + }, +}) \ No newline at end of file diff --git a/SeaBlock/data/tech-tree.lua b/SeaBlock/data/tech-tree.lua index 51460bc3..30e4a6e5 100644 --- a/SeaBlock/data/tech-tree.lua +++ b/SeaBlock/data/tech-tree.lua @@ -108,3 +108,34 @@ if data.raw.technology["bob-gem-processing-3"] then bobmods.lib.tech.add_prerequisite("productivity-module-3", "bob-gem-processing-3") bobmods.lib.tech.add_prerequisite("efficiency-module-3", "bob-gem-processing-3") end + +bobmods.lib.tech.remove_prerequisite("automation-science-pack", "electronics") +seablock.lib.hide_technology("automation-science-pack") + +seablock.lib.hide_technology("electronics") --new trigger tech in base game, we don't want it in seablock +data.raw["technology"]["electronics"].research_trigger = nil +data.raw["technology"]["electronics"].unit = {time = 1, count = 1, ingredients = {}} +bobmods.lib.tech.remove_prerequisite("bob-electronics", "electronics") +bobmods.lib.tech.remove_prerequisite("bob-electronics", "automation-science-pack") + +seablock.lib.hide_technology("electric-mining-drill") +seablock.lib.hide_technology("repair-pack") + +bobmods.lib.tech.add_prerequisite("radar", "military") +bobmods.lib.tech.remove_prerequisite("military", "automation-science-pack") +bobmods.lib.tech.remove_prerequisite("gun-turret", "automation-science-pack") +bobmods.lib.tech.remove_prerequisite("stone-wall", "automation-science-pack") +bobmods.lib.tech.remove_prerequisite("radar", "automation-science-pack") +bobmods.lib.tech.remove_prerequisite("automation", "automation-science-pack") + +-- Change order for esthetics of the tech tree +data.raw["technology"]["military"].order = "z-[military]" + +if data.raw["technology"]["logistics-0"] then + data.raw["technology"]["logistics-0"].research_trigger = nil + data.raw["technology"]["logistics-0"].unit = { + ingredients = {{"automation-science-pack", 1}}, + time = 5, + count = 10 + } +end diff --git a/SeaBlock/lib.lua b/SeaBlock/lib.lua index e876077b..4a0d8b76 100644 --- a/SeaBlock/lib.lua +++ b/SeaBlock/lib.lua @@ -2,6 +2,35 @@ seablock = seablock or {} seablock.lib = {} seablock.reskins = {} +---Sets a tile restriction on any specified prototype +---does not replace existing autoplace dict but creates if it doesnt exist +---@param ptype string "tile", "entity", ... +---@param name string name of prototype +---@param restriction string|table string for singular restrict, table for multiple restrictions +function seablock.lib.set_tile_restriction(ptype, name, restriction) + if (not data.raw[ptype]) then error ("Tried to set tile restriction on "..ptype.." "..name..": type does not exist") end + if (not data.raw[ptype][name]) then error("Tried to set tile restriction on "..ptype.." "..name..": "..name.." does not exist") end + + data.raw[ptype][name].autoplace = data.raw[ptype][name].autoplace or {} + + if (type(restriction) == "string") then restriction = { restriction } end + + data.raw[ptype][name].autoplace["tile_restriction"] = restriction +end + +---Sets a probability expression on any specified prototype +---does not replace existing autoplace dict but creates if it doesnt exist +---@param ptype string "tile", "entity", ... +---@param name string name of prototype +---@param expression string expression +function seablock.lib.set_probability_expression(ptype, name, expression) + if (not data.raw[ptype]) then error ("Tried to set probability expression on "..ptype.." "..name..": type does not exist") end + if (not data.raw[ptype][name]) then error("Tried to set probability expression on "..ptype.." "..name..": "..name.." does not exist") end + + data.raw[ptype][name].autoplace = data.raw[ptype][name].autoplace or {} + data.raw[ptype][name].autoplace["probability_expression"] = expression +end + function seablock.lib.findname(t, name) for i, v in ipairs(t) do if v.name == name then @@ -21,6 +50,8 @@ end function seablock.lib.takeeffect(tech, name) if not data.raw.technology[tech] then + log("Warning: seablock.lib.takeeffect - can't find technology : " .. tech) + log(debug.traceback()) return nil end local effects = data.raw.technology[tech].effects or {} @@ -39,10 +70,29 @@ function seablock.lib.findeffectidx(effects, name) end end +---Inserts recipe into tech at index +---@param recipe_name string +---@param tech_name string +---@param index integer +function seablock.lib.insert_effect(recipe_name, tech_name, index) + local tech = data.raw.technology[tech_name] + + if not tech then + return + end + + if index then + table.insert(tech.effects, index, { type = "unlock-recipe", recipe = recipe_name }) + else + table.insert(tech.effects, { type = "unlock-recipe", recipe = recipe_name }) + end +end + function seablock.lib.moveeffect(name, fromtech, totech, insertindex) local effect = seablock.lib.takeeffect(fromtech, name) if not effect then - log("Effect " .. name .. " not found in tech " .. fromtech) + log("Warning : seablock.lib.moveeffect - Effect " .. name .. " not found in tech " .. fromtech) + log(debug.traceback()) return end if insertindex then @@ -87,6 +137,31 @@ function seablock.lib.add_recipe_unlock(technology, recipe, insertindex) end end +function seablock.lib.iteraterecipes(recipe, func) + if recipe.ingredients then + func(recipe) + end +end + +function seablock.lib.recipeforeach(recipename, itemname, func, tablename) + local doline = function(recipe) + for _, line in pairs(recipe[tablename]) do + local nameidx = 1 + local amountidx = 2 + if line.name then + nameidx = "name" + end + if line.amount then + amountidx = "amount" + end + if line[nameidx] == itemname then + func(line, nameidx, amountidx) + end + end + end + seablock.lib.iteraterecipes(data.raw.recipe[recipename], doline) +end + function seablock.lib.substingredient(name, from, to, count) local recipe = data.raw.recipe[name] if recipe then @@ -101,6 +176,7 @@ function seablock.lib.substingredient(name, from, to, count) end end else + log("Warning : seablock.lib.substingredient - can't find recipe : " .. name) log(debug.traceback()) end end @@ -114,6 +190,9 @@ function seablock.lib.removeingredient(name, ingredient) return end end + else + log("Warning : seablock.lib.removeingredient - can't find recipe : " .. name) + log(debug.traceback()) end end @@ -130,6 +209,9 @@ function seablock.lib.substresult(name, from, to, count) end end end + else + log("Warning : seablock.lib.substresult - can't find recipe : " .. name) + log(debug.traceback()) end end @@ -138,6 +220,9 @@ function seablock.lib.addresult(name, resulttable) if recipe then recipe.results = recipe.results or {} table.insert(recipe.results, resulttable) + else + log("Warning: seablock.lib.addresult - can't find recipe : " .. name) + log(debug.traceback()) end end @@ -160,11 +245,26 @@ function seablock.lib.tablefind(table, item) return nil end -function seablock.lib.unhide_recipe(recipe_name) - local recipe = data.raw.recipe[recipe_name] - if recipe then - recipe.hidden = false +function seablock.lib.unhide(type_name, name) + if not data.raw[type_name] then + log("Warning: seablock.lib.unhide - unknown type: " .. type_name) + log(debug.traceback()) + return + end + + local item = data.raw[type_name][name] + + if not item then + log("Warning: seablock.lib.unhide - unknown " .. type_name .. ": " .. name) + log(debug.traceback()) + return end + + item.hidden = false +end + +function seablock.lib.unhide_recipe(recipe_name) + seablock.lib.unhide("recipe", recipe_name) end function seablock.lib.hide_technology(technology_name) @@ -172,6 +272,9 @@ function seablock.lib.hide_technology(technology_name) if technology then technology.hidden = true technology.enabled = false + else + log("Warning: seablock.lib.hide_technology - Hide non existing tech : " .. technology_name) + log(debug.traceback()) end end @@ -184,42 +287,26 @@ function seablock.lib.copy_icon(to, from) end end -function seablock.lib.hide_item(item_name) - local item = data.raw.item[item_name] - if item then - if not item.flags then - item.flags = {} - end - if not seablock.lib.tablefind(item.flags, "hidden") then - table.insert(item.flags, "hidden") - end - else - item = data.raw.fluid[item_name] - if item then - item.hidden = true - end - end -end - function seablock.lib.hide(type_name, name) if not data.raw[type_name] then - log("Unknown type: " .. type_name) + log("Warning: seablock.lib.hide - Unknown type: " .. type_name) + log(debug.traceback()) else local item = data.raw[type_name][name] if not item then - log("Unknown " .. type_name .. ": " .. name) + log("Warning: seablock.lib.hide - Unknown " .. type_name .. ": " .. name) + log(debug.traceback()) else if type_name == "fluid" then item.hidden = true else - if not item.flags then - item.flags = {} - end - if not seablock.lib.tablefind(item.flags, "hidden") then - table.insert(item.flags, "hidden") - end + item.hidden = true if type_name == "item" then + if not item.flags then + item.flags = {} + end + table.insert(item.flags, "hide-from-bonus-gui") end @@ -229,10 +316,19 @@ function seablock.lib.hide(type_name, name) end end +function seablock.lib.hide_item(item_name) + if data.raw.item[item_name] then + seablock.lib.hide("item", item_name) + else + seablock.lib.hide("fluid", item_name) + end +end + function seablock.lib.remove_effect(technology_name, effect_type, effect_key, effect_value) local tech = data.raw.technology[technology_name] if not tech then - log("Unknown technology: " .. technology_name) + log("Warning: seablock.lib.remove_effect - Unknown technology: " .. technology_name) + log(debug.traceback()) return end @@ -248,13 +344,15 @@ end function seablock.lib.add_flag(type, name, flag) if not data.raw[type] then - log("Unknown type: " .. type) + log("Warning : seablock.lib.add_flag - Unknown type: " .. type) + log(debug.traceback()) return end local item = data.raw[type][name] if not item then - log("Unknown " .. type .. ": " .. name) + log("Warning : seablock.lib.add_flag - Unknown " .. type .. ": " .. name) + log(debug.traceback()) return end @@ -495,3 +593,55 @@ function seablock.reskins.clear_icon_specification(name, type) entity.icon_mipmaps = nil end end + +---Adds a crafting category to an entity +---@param type string assembling-machine, ... +---@param entity_name string +---@param category string +function seablock.lib.add_category(type, entity_name, category) + if (not data.raw["recipe-category"][category]) then + log("Warning: seablock.lib.add_category - Category \""..category.."\" does not exist") + return + end + + if (not data.raw[type]) then + log("Warning: seablock.lib.add_category - Type \""..type.."\" does not exist") + return + end + + if (not data.raw[type][entity_name]) then + log("Warning: seablock.lib.add_category - Entity \""..entity_name.."\" does not exist") + return + end + + data.raw[type][entity_name].crafting_categories = data.raw[type][entity_name].crafting_categories or {} + + table.insert(data.raw[type][entity_name].crafting_categories, category) +end + +--- Adds a crafting category to a recipe. +--- If no category is set before it will be set to category_name. +--- Otherwise it will be safely added to additional_categories. +---@param recipe_name string +---@param category_name string +function seablock.lib.add_recipe_category(recipe_name, category_name) + local recipe = data.raw.recipe[recipe_name] + + if (not recipe) then + log("Warning: seablock.lib.add_recipe_category - Recipe \""..recipe_name.."\" not found") + return + end + + if (not data.raw["recipe-category"][category_name]) then + log("Warning: seablock.lib.add_recipe_category - Category \""..category_name.."\" does not exist") + return + end + + if (not recipe.category) then + recipe.category = category_name + else + recipe.additional_categories = recipe.additional_categories or {} + + table.insert(recipe.additional_categories, category_name) + end +end \ No newline at end of file diff --git a/SeaBlock/locale/ja/SeaBlock.cfg b/SeaBlock/locale/ja/SeaBlock.cfg index 07e06486..7f010761 100644 --- a/SeaBlock/locale/ja/SeaBlock.cfg +++ b/SeaBlock/locale/ja/SeaBlock.cfg @@ -4,13 +4,18 @@ sb-wood-foraging=流木採集 sb-blue-algae-liquefaction=青藻液化 [item-name] +charcoal=木炭 +angels-filter-charcoal=木炭ろ過器 +angels-pellet-charcoal=木炭顆粒 rocket-part=ロケット部品 sct-lab-lab2=系外惑星研究所 [entity-name] sct-lab-lab2=系外惑星研究所 +angels-silo-coal=木炭サイロ [entity-description] +angels-silo-coal=「木炭」の美的要素を持つサイロ。 [technology-name] sb-startup1=破砕スチラタイト diff --git a/SeaBlock/locale/ru/SeaBlock.cfg b/SeaBlock/locale/ru/SeaBlock.cfg index 2524dfb3..86d9f858 100644 --- a/SeaBlock/locale/ru/SeaBlock.cfg +++ b/SeaBlock/locale/ru/SeaBlock.cfg @@ -4,13 +4,18 @@ sb-wood-foraging=Собирать плавающую древесину sb-blue-algae-liquefaction=Ожижение синих водорослей [item-name] +charcoal=Древесный уголь +angels-filter-charcoal=Фильтр из древесного угля +angels-pellet-charcoal=Гранулы древесного угля rocket-part=Часть ракеты sct-lab-lab2=Лаборатория экзопланетарных исследований [entity-name] sct-lab-lab2=Лаборатория экзопланетарных исследований +angels-silo-coal=Древесноугольный элеватор [entity-description] +angels-silo-coal=Элеватор с эстетикой древесного угля. [technology-name] sb-startup1=Измельчить ститарит diff --git a/SeaBlock/locale/uk/SeaBlock.cfg b/SeaBlock/locale/uk/SeaBlock.cfg index b6db891a..dd175eb8 100644 --- a/SeaBlock/locale/uk/SeaBlock.cfg +++ b/SeaBlock/locale/uk/SeaBlock.cfg @@ -4,13 +4,19 @@ sb-wood-foraging=Корм для корчів sb-blue-algae-liquefaction=Зрідження синіх водоростей [item-name] +charcoal=Деревне вугілля +angels-filter-charcoal=Фільтр з деревинного вугілля +angels-pellet-charcoal=Деревне вугілля в гранулах rocket-part=Частина ракети sct-lab-lab2=Лабораторія екзопланетарних досліджень +sb-catalyst-metal-purple=Каталізатор з фіолетового металу [entity-name] sct-lab-lab2=Лабораторія екзопланетарних досліджень +angels-silo-coal=Вугільне сховище [entity-description] +angels-silo-coal=Сховище з "вугільною" естетикою. [technology-name] sb-startup1=Подрібнити стиратит diff --git a/SeaBlock/mapgen.lua b/SeaBlock/mapgen.lua index e3cafabd..795693bd 100644 --- a/SeaBlock/mapgen.lua +++ b/SeaBlock/mapgen.lua @@ -1,3 +1,4 @@ +-- See mapgen.md for further information data.raw.tile["sand-4"] = table.deepcopy(data.raw.tile["sand-1"]) data.raw.tile["sand-5"] = table.deepcopy(data.raw.tile["sand-2"]) data.raw.tile["sand-4"].name = "sand-4" @@ -32,449 +33,134 @@ data.raw.tile["sand-5"].vehicle_friction_modifier = 1.8 data.raw.tile["landfill"].vehicle_friction_modifier = 1.8 for _, v in pairs(data.raw.tile) do - v.autoplace = nil + v.autoplace = nil end --- Want player to collide with cliffs --- Want player to collide with water --- Don't want cliffs to collide with water --- Water tile's default collision mask includes player-layer and item-layer --- So use train-layer as a substitute player-layer -data.raw.cliff["cliff"].collision_mask = { "object-layer", "train-layer", "not-colliding-with-itself" } +data.raw.cliff["cliff"].collision_mask = { not_colliding_with_itself = true, layers = { object = true, train = true}} -local octaves = -3 -local persistence = 0.2 -local waterline = 9.4 -local elevation_scale = 5 -local function scale_elevation(x) - return (x - waterline) * elevation_scale + waterline -end --- low lying sand -data.raw.tile["sand-4"].autoplace = { - peaks = { - { -- Around cliff islands - influence = 5, - elevation_optimal = 0.3 * elevation_scale + waterline, - elevation_range = 0.3 * elevation_scale, - elevation_max_range = 0.3 * elevation_scale, - }, - { - influence = 0.77 * 8, -- Worm islands - min_influence = 0, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - tier_from_start_optimal = 8, - tier_from_start_max_range = 40, - tier_from_start_top_property_limit = 8, - }, - { -- Not in starting area - influence = -5, - starting_area_weight_optimal = 1, - starting_area_weight_range = 0, - starting_area_weight_max_range = 0, - }, - { - influence = 100, -- ... except for starting tile - min_influence = 0, - distance_optimal = 0, - distance_range = 0.1, - distance_max_range = 0.1, - }, +data:extend({ { - influence = -5, - }, - }, -} + type = "noise-expression", + name = "waterline", + expression = "10" + }, + { + type = "noise-expression", + name = "distance_sigmoid", -- sigmoid to gradually increase island size while limiting the maximum size + local_expressions = { + amount = "2", + offset = "500", + scale = "300" + }, + expression = "amount/(1+e^(-(distance-offset)/scale))" + }, + { + type = "noise-function", + name = "shifted_hyperbolic_rational", + parameters = { "amplitude", "offset", "squish" }, + expression = "(amplitude*4)/(distance*squish-offset*squish) - (amplitude*4)/((distance*squish-offset*squish)^2)" + }, + { + type = "noise-function", + name = "random_tree_islands", + parameters = { "seed", "noise_seed", "frequency", "limit" }, + local_expressions = { + base = "basis_noise{x = x, y = y, seed0 = map_seed, seed1 = noise_seed, input_scale = 1.99995}", + multoctave = "multioctave_noise{x = x, y = y, persistence = 0.75, seed0 = map_seed, seed1 = seed, octaves = 3, input_scale = 1/32, output_scale = 10} * (1+frequency+shifted_hyperbolic_rational(200, 0, 0.7))" + }, + expression = "if(multoctave >= limit, base, -inf)" + }, + { + type = "noise-function", + name = "worm_autoplace", + parameters = { "other_distance", "probability", "falloff", "seed" }, + local_expressions = { + d = "distance - starting_area_radius", + _falloff = "if(falloff == 1, clamp(((other_distance+2)*128-d)/128, 0, 1), 1)", + _waterline = "clamp(waterline-elevation, 0, 1)", + prob = "clamp((d-other_distance*128)/128, 0, 1) * _falloff * _waterline * probability", + pen = "random_penalty(x, y, prob, seed, probability*0.5)" + }, + expression = "pen" + } +}) --- highground sand -data.raw.tile["sand-5"].autoplace = { - peaks = { - { - influence = 5, - min_influence = 0, - elevation_optimal = scale_elevation(15), - elevation_range = 5 * elevation_scale, - elevation_max_range = 5 * elevation_scale, - tier_from_start_optimal = 0.1, - tier_from_start_range = 0, - tier_from_start_max_range = 0, - tier_from_start_top_property_limit = 0.1, - }, - { - influence = 0.65, -- starting area garden islands - min_influence = 0, - max_influence = 1, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - tier_from_start_optimal = 0, - tier_from_start_range = 0.1, - tier_from_start_max_range = 0.1, - }, - { - influence = 1, - max_influence = 0, - starting_area_weight_optimal = 1, - starting_area_weight_range = 0, - starting_area_weight_max_range = 0, - }, - { - influence = -100, -- not on starting tile - max_influence = 0, - distance_optimal = 0, - distance_range = 3, - distance_max_range = 3, - }, - }, -} +-- cant put that in data:extend since elevation exists in base game +local elevation = data.raw["noise-expression"]["elevation"] -local plant_elevation_range = 9.9 * elevation_scale -data.raw.tree["desert-garden"].autoplace = { - max_probability = 0.2, - random_probability_penalty = 0.05, - sharpness = 1, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - { - influence = 0.31, -- Trial and error value to generate size that approximately matches starting area islands - min_influence = 0, - max_influence = 1, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - tier_from_start_optimal = 0, - tier_from_start_range = 0.1, - tier_from_start_max_range = 0.1, - }, - { - influence = 1, - max_influence = 0, - noise_layer = "desert-garden-noise", - noise_persistence = 0.8, - noise_octaves_difference = -0.5, - }, - }, - order = "yc", - tile_restriction = { "sand-5" }, +elevation.local_expressions = { + base = "basis_noise{x = x, y = y, seed0 = map_seed, seed1 = 5, input_scale = 1/32, output_scale = 6}", + starting_tile = "if(distance <= 1, 100, 0)", } -data.raw.tree["temperate-garden"].autoplace = { - max_probability = 0.2, - random_probability_penalty = 0.05, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - { - influence = 1, - max_influence = 0, - noise_layer = "temperate-garden-noise", - noise_persistence = 0.8, - noise_octaves_difference = -0.5, - }, - }, - order = "ya", - tile_restriction = { "sand-5" }, -} +elevation.expression = "if(distance <= starting_area_radius/2, min(base - waterline, 0), base - waterline) + starting_tile + distance_sigmoid+1" -data.raw.tree["swamp-garden"].autoplace = { - max_probability = 0.05, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - }, - order = "yb", - tile_restriction = { "sand-5" }, -} +------- Tiles ------- +-- Water +seablock.lib.set_probability_expression("tile", "deepwater", "if(elevation <= -8, elevation*-1, -inf)") +seablock.lib.set_probability_expression("tile", "water", "if(elevation < 0, elevation*-1, -inf)") -data.raw.tree["desert-tree"].autoplace = { - max_probability = 0.1, - random_probability_penalty = 0.025, - sharpness = 1, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - { - influence = 0.31, -- Trial and error value to generate size that approximately matches starting area islands - min_influence = 0, - max_influence = 1, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - tier_from_start_optimal = 0, - tier_from_start_range = 0.1, - tier_from_start_max_range = 0.1, - }, - { - influence = 1, - max_influence = 0, - noise_layer = "desert-tree-noise", - noise_persistence = 0.8, - noise_octaves_difference = -0.5, - }, - }, - order = "za", - tile_restriction = { "sand-5" }, -} -data.raw.tree["temperate-tree"].autoplace = { - max_probability = 0.1, - random_probability_penalty = 0.025, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - { - influence = 1, - max_influence = 0, - noise_layer = "temperate-tree-noise", - noise_persistence = 0.8, - noise_octaves_difference = -0.5, - }, - }, - order = "zc", - tile_restriction = { "sand-5" }, -} +-- Beaches +seablock.lib.set_probability_expression("tile", "sand-4", "if(elevation >= 0, elevation, -inf)") -data.raw.tree["swamp-tree"].autoplace = { - max_probability = 0.05, - peaks = { - { - influence = 1, - min_influence = 0, - elevation_optimal = scale_elevation(20), - elevation_range = plant_elevation_range, - elevation_max_range = plant_elevation_range, - }, - { - influence = 1, - max_influence = 0, - noise_layer = "swamp-tree-noise", - noise_persistence = 0.8, - noise_octaves_difference = -0.5, - }, - }, - order = "zb", - tile_restriction = { "sand-5" }, -} +-- Landmass +seablock.lib.set_probability_expression("tile", "sand-5", "if(elevation >= 1.2, inf, -inf)") -data.raw.tile["water"].autoplace = { - peaks = { - { - influence = 0.1, -- shallow water around cliff islands - min_influence = 0, - elevation_optimal = -2 * elevation_scale + waterline, - elevation_range = 2.5 * elevation_scale, - elevation_max_range = 2.5 * elevation_scale, - }, - { - influence = 0.77 * 2, -- around worm islands - min_influence = 0, - max_influence = 1, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - }, - { - influence = 5, -- around starting tile - min_influence = 0, - distance_optimal = 0, - distance_range = 5, - distance_max_range = 5, - }, - }, -} +------- Trees ------- +-- Trees should only spawn on sand-5 which is the middle of each island +for _, name in pairs({ "angels-desert-garden", "angels-temperate-garden", "angels-swamp-garden", "angels-desert-tree", "angels-temperate-tree", "angels-swamp-tree", }) do + seablock.lib.set_tile_restriction("tree", name, "sand-5") +end -data.raw.tile["deepwater"].autoplace = { - peaks = { - { - influence = 0.01, - }, - }, -} +seablock.lib.set_probability_expression("tree", "angels-desert-garden", "random_tree_islands(1, 1, 0.6, 16)") +seablock.lib.set_probability_expression("tree", "angels-desert-tree", "random_tree_islands(1, 2, 0.4, 16)") -data.raw.fish["alien-fish-1"].autoplace = { - peaks = { - { - influence = -0.1, - max_influence = 0, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - }, - { - influence = 0.01, - }, - }, -} +seablock.lib.set_probability_expression("tree", "angels-temperate-garden", "random_tree_islands(2, 1, 0.6, 16)") +seablock.lib.set_probability_expression("tree", "angels-temperate-tree", "random_tree_islands(2, 2, 0.6, 16)") -data.raw.fish["alien-fish-2"].autoplace = { - peaks = { - { - influence = 0.02, - min_influence = 0, - noise_layer = "enemy-base", - noise_octaves_difference = octaves, - noise_persistence = persistence, - }, - }, -} +seablock.lib.set_probability_expression("tree", "angels-swamp-garden", "random_tree_islands(3, 1, 0.6, 16)") +seablock.lib.set_probability_expression("tree", "angels-swamp-tree", "random_tree_islands(3, 2, 0.5, 16)") -data.raw.fish["alien-fish-3"].autoplace = { - peaks = { - { - influence = 0.015, - min_influence = 0, - elevation_optimal = scale_elevation(10), - elevation_range = 5 * elevation_scale, - elevation_max_range = 5 * elevation_scale, - tier_from_start_optimal = 0.1, - tier_from_start_range = 0, - tier_from_start_max_range = 0, - tier_from_start_top_property_limit = 0.1, - }, - }, -} - -local noise = require("noise") -local tne = noise.to_noise_expression +------- Enemies ------- local enemy_random_seed = 1 local function new_random_seed() - enemy_random_seed = enemy_random_seed + 1 - return enemy_random_seed + enemy_random_seed = enemy_random_seed + 1 + return enemy_random_seed end -local function worm_autoplace(distance, probability, order, falloff, control_name) - local d = noise.var("distance") - noise.var("starting_area_radius") - local p = noise.clamp((d - distance * 128) / 128, 0, 1) - if falloff then - p = p * noise.clamp(((distance + 2) * 128 - d) / 128, 0, 1) - end - p = p * noise.clamp((waterline - noise.var("elevation")), 0, 1) - p = p * probability - p = noise.random_penalty(p, probability * 0.5, { - x = noise.var("x") + new_random_seed(), - }) - return { - control = control_name, - order = order, - force = "enemy", - probability_expression = p, - richness_expression = tne(1), - } +local function worm_autoplace(distance, probability, order, falloff, control_name) + return { + control = control_name, + order = order, + force = "enemy", + probability_expression = "worm_autoplace("..distance..","..probability..","..falloff..","..new_random_seed()..")", + richness_expression = 1, + } end -data.raw.turret["small-worm-turret"].autoplace = worm_autoplace(0, 1, "z", true, "enemy-base") -data.raw.turret["medium-worm-turret"].autoplace = worm_autoplace(1, 1, "y", true, "enemy-base") +data.raw.turret["small-worm-turret"].autoplace = worm_autoplace(0, 1, "z", 1, "enemy-base") +data.raw.turret["medium-worm-turret"].autoplace = worm_autoplace(1, 1, "y", 1, "enemy-base") +data.raw.turret["big-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") +data.raw.turret["behemoth-worm-turret"].autoplace = worm_autoplace(2, 0.2, "t", 0, "enemy-base") + +seablock.lib.set_tile_restriction("tree", "angels-puffer-nest", {}) --clear tile restrictions +data.raw.tree["angels-puffer-nest"].autoplace = worm_autoplace(0, 0.01, "s", 0) + if data.raw.turret["bob-big-explosive-worm-turret"] then - data.raw.turret["bob-big-explosive-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") + data.raw.turret["bob-big-explosive-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") end if data.raw.turret["bob-big-fire-worm-turret"] then - data.raw.turret["bob-big-fire-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") + data.raw.turret["bob-big-fire-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") end if data.raw.turret["bob-big-poison-worm-turret"] then - data.raw.turret["bob-big-poison-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") + data.raw.turret["bob-big-poison-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") end if data.raw.turret["bob-big-piercing-worm-turret"] then - data.raw.turret["bob-big-piercing-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") + data.raw.turret["bob-big-piercing-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") end if data.raw.turret["bob-big-electric-worm-turret"] then - data.raw.turret["bob-big-electric-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") + data.raw.turret["bob-big-electric-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", 0, "enemy-base") end if data.raw.turret["bob-giant-worm-turret"] then - data.raw.turret["bob-giant-worm-turret"].autoplace = worm_autoplace(2, 0.6, "u", false, "enemy-base") -end -if data.raw.turret["behemoth-worm-turret"] then - data.raw.turret["big-worm-turret"].autoplace = worm_autoplace(1.5, 0.5, "v", false, "enemy-base") - data.raw.turret["behemoth-worm-turret"].autoplace = worm_autoplace(2, 0.2, "t", false, "enemy-base") -else - data.raw.turret["big-worm-turret"].autoplace = worm_autoplace(2, 1, "v", false, "enemy-base") -end -data.raw.tree["puffer-nest"].autoplace = worm_autoplace(0, 0.01, "s", false) - -for _, v in pairs(data.raw.turret) do - v.map_generator_bounding_box = nil -end - -data:extend({ - { - type = "noise-layer", - name = "desert-tree-noise", - }, - { - type = "noise-layer", - name = "temperate-tree-noise", - }, - { - type = "noise-layer", - name = "swamp-tree-noise", - }, - { - type = "noise-layer", - name = "desert-garden-noise", - }, - { - type = "noise-layer", - name = "temperate-garden-noise", - }, - { - type = "noise-layer", - name = "swamp-garden-noise", - }, -}) - -local function make_basis_noise_function(seed0, seed1, outscale0, inscale0) - outscale0 = outscale0 or 1 - inscale0 = inscale0 or 1 / outscale0 - return function(x, y, inscale, outscale) - return tne({ - type = "function-application", - function_name = "factorio-basis-noise", - arguments = { - x = tne(x), - y = tne(y), - seed0 = tne(seed0), - seed1 = tne(seed1), - input_scale = tne((inscale or 1) * inscale0), - output_scale = tne((outscale or 1) * outscale0), - }, - }) - end + data.raw.turret["bob-giant-worm-turret"].autoplace = worm_autoplace(2, 0.6, "u", 0, "enemy-base") end - -data.raw["noise-expression"]["cliffiness"].expression = noise.define_noise_function(function(x, y, tile, map) - local t = noise.clamp((tile.tier - 0.2) * noise.ceil(noise.var("control-setting:cliffs:richness:multiplier")), 0, 1) -- No cliffs in starting area - return 100 * t -end) -data.raw["noise-expression"]["elevation"].expression = noise.define_noise_function(function(x, y, tile, map) - x = x + 40000 - y = y - local v = make_basis_noise_function(map.seed, 5, 6, 1 / 64)(x, y) - v = noise.max(v, 0) - v = (v * elevation_scale) - (waterline * (elevation_scale - 1)) -- Increase gradient for cliffs while leaving waterline unchanged - return v -end) diff --git a/SeaBlock/migrations/SeaBlock_0.6.0.lua b/SeaBlock/migrations/SeaBlock_0.6.0.lua index 3fe5ccbc..0d0a134b 100644 --- a/SeaBlock/migrations/SeaBlock_0.6.0.lua +++ b/SeaBlock/migrations/SeaBlock_0.6.0.lua @@ -1,3 +1,5 @@ +local angelsmods = require("__angelsrefining__/prototypes/migration-functions") + for _, surface in pairs(game.surfaces) do for chunk in surface.get_chunks() do angelsmods.migration.replace_item(surface.find_entities(chunk.area), { diff --git a/SeaBlock/prototypes/recipe.lua b/SeaBlock/prototypes/recipe.lua index 964a44c3..131ba475 100644 --- a/SeaBlock/prototypes/recipe.lua +++ b/SeaBlock/prototypes/recipe.lua @@ -4,6 +4,7 @@ data:extend({ name = "sb-wood-bricks-charcoal", localised_name = { "item-name.angels-wood-charcoal" }, category = "smelting", + allow_productivity = true, enabled = false, energy_required = 3.5, ingredients = { { type = "item", name = "angels-wood-bricks", amount = 1 } }, diff --git a/SeaBlock/prototypes/technology.lua b/SeaBlock/prototypes/technology.lua index dd8d57e5..d5e80a55 100644 --- a/SeaBlock/prototypes/technology.lua +++ b/SeaBlock/prototypes/technology.lua @@ -1,50 +1,15 @@ data:extend({ - { - type = "tool", - name = "sb-angelsore3-tool", - localised_name = { "item-name.angels-ore3-crushed" }, - icon = "__angelsrefining__/graphics/icons/angels-ore3-crushed.png", - icon_size = 32, - flags = { "hidden" }, - stack_size = 100, - durability = 1, - }, - { - type = "tool", - name = "sb-basic-circuit-board-tool", - localised_name = { "item-name.basic-circuit-board" }, - icon = "__bobelectronics__/graphics/icons/basic-circuit-board.png", - icon_size = 128, - flags = { "hidden" }, - stack_size = 100, - durability = 1, - }, - { - type = "tool", - name = "sb-lab-tool", - localised_name = { "item-name.lab" }, - icon = "__base__/graphics/icons/lab.png", - icon_size = 64, - icon_mipmaps = 4, - flags = { "hidden" }, - stack_size = 100, - durability = 1, - }, { type = "technology", name = "sb-startup1", icon = "__SeaBlock__/graphics/technology/ore.png", icon_size = 128, effects = { - { type = "unlock-recipe", recipe = "angels-ore1-crushed-smelting" }, - { type = "unlock-recipe", recipe = "angels-ore3-crushed-smelting" }, + { type = "unlock-recipe", recipe = "iron-plate" }, + { type = "unlock-recipe", recipe = "copper-plate" }, { type = "unlock-recipe", recipe = "copper-cable" }, }, - unit = { - count = 1, - ingredients = { { "sb-angelsore3-tool", 1 } }, - time = 1, - }, + research_trigger = {type = "craft-item", item = "angels-ore3-crushed"} }, { type = "technology", @@ -62,12 +27,8 @@ data:extend({ { type = "unlock-recipe", recipe = "burner-inserter" }, { type = "unlock-recipe", recipe = "iron-chest" }, }, - prerequisites = { "bio-wood-processing" }, - unit = { - count = 1, - ingredients = { { "sb-basic-circuit-board-tool", 1 } }, - time = 1, - }, + prerequisites = { "angels-bio-wood-processing" }, + research_trigger = {type = "craft-item", item = "bob-basic-circuit-board"}, }, { type = "technology", @@ -78,11 +39,7 @@ data:extend({ { type = "unlock-recipe", recipe = "automation-science-pack" }, }, prerequisites = { "sb-startup3" }, - unit = { - count = 1, - ingredients = { { "sb-lab-tool", 1 } }, - time = 1, - }, + research_trigger = {type = "craft-item", item = "lab"}, }, { type = "technology", diff --git a/SeaBlock/remote.lua b/SeaBlock/remote.lua index 4ed0a771..c3bec44e 100644 --- a/SeaBlock/remote.lua +++ b/SeaBlock/remote.lua @@ -121,14 +121,20 @@ local function milestones_presets() -- Vanilla modules grouped_milestones["modules"] = { { type = "item", name = "productivity-module", quantity = 1 }, + { type = "item", name = "bob-productivity-module-4", quantity = 1 }, + { type = "item", name = "bob-productivity-module-5", quantity = 1 }, + } + elseif script.active_mods["CircuitProcessing"] then + -- Circuit Processing modules + grouped_milestones["modules"] = { { type = "item", name = "productivity-module-2", quantity = 1 }, - { type = "item", name = "productivity-module-3", quantity = 1 }, + { type = "item", name = "bob-productivity-module-4", quantity = 1 }, + { type = "item", name = "bob-productivity-module-5", quantity = 1 }, } else -- Bob's Modules grouped_milestones["modules"] = { { type = "item", name = "productivity-module", quantity = 1 }, - { type = "item", name = "productivity-module-3", quantity = 1 }, { type = "item", name = "bob-productivity-module-5", quantity = 1 }, } end diff --git a/SeaBlockMetaPack/info.json b/SeaBlockMetaPack/info.json index 09289a7e..ec4e74d9 100644 --- a/SeaBlockMetaPack/info.json +++ b/SeaBlockMetaPack/info.json @@ -43,6 +43,9 @@ "Milestones", "ScienceCostTweakerM", "SeaBlock", - "SpaceMod" + "SpaceMod", + + "! space-age", + "! quality" ] }