diff --git a/bztungsten2/changelog.txt b/bztungsten2/changelog.txt index a7ad895..4d308d3 100644 --- a/bztungsten2/changelog.txt +++ b/bztungsten2/changelog.txt @@ -1,10 +1,4 @@ --------------------------------------------------------------------------------------------------- -Version: 2.0.2 -Date: 02.11.2025 - Bug Fixes: - - Change "optics" to "lamp" to respect the Factorio 2.0 renaming - - Remove duplicate pumpjack technology ---------------------------------------------------------------------------------------------------- Version: 2.0.1 Date: 21.10.2025 Changes: diff --git a/bztungsten2/data-final-fixes.lua b/bztungsten2/data-final-fixes.lua index 731fc80..1f7142f 100644 --- a/bztungsten2/data-final-fixes.lua +++ b/bztungsten2/data-final-fixes.lua @@ -36,7 +36,7 @@ end -- SE + K2: Keep radar at red science level -util.remove_prerequisite("kr-radar", "lamp") +util.remove_prerequisite("kr-radar", "optics") util.add_prerequisite("kr-radar", "electricity") @@ -48,7 +48,7 @@ util.add_ingredient("omt-electric-mining-drill", "tungsten-carbide", 10) -- Junk Trains, no optics: -util.remove_prerequisite("automated-scrap-rail-transportation", "lamp") +util.remove_prerequisite("automated-scrap-rail-transportation", "optics") util.remove_ingredient("train-stop-scrap", "small-lamp") util.remove_ingredient("rail-signal-scrap", "small-lamp") util.remove_ingredient("rail-chain-signal-scrap", "small-lamp") diff --git a/bztungsten2/data-util.lua b/bztungsten2/data-util.lua index b4a1738..bc84044 100644 --- a/bztungsten2/data-util.lua +++ b/bztungsten2/data-util.lua @@ -109,65 +109,65 @@ function util.se_landfill(params) end end --- k2 matter + +-- k2 matter -- params: {k2matter}, k2baseicon , {icon} function util.k2matter(params) local matter = require("__Krastorio2__/prototypes/libraries/matter") - if mods["space-exploration"] then - params.k2matter.needs_stabilizer = true + if mods["space-exploration"] then + params.k2matter.need_stabilizer = true end if not params.k2matter.minimum_conversion_quantity then params.k2matter.minimum_conversion_quantity = 10 end - if not data.raw.technology[params.k2matter.unlocked_by] then + if not data.raw.technology[params.k2matter.unlocked_by_technology] then local icon = "" if params.k2baseicon then - icon = util.k2assets() .. "/technologies/matter-" .. params.k2baseicon .. ".png" + icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png" else - icon = util.k2assets() .. "/technologies/backgrounds/matter.png" + icon = util.k2assets().."/technologies/backgrounds/matter.png" end - - data:extend({ - { - type = "technology", - name = params.k2matter.unlocked_by, - icons = { + + data:extend( + { { - icon = icon, - icon_size = 256, + type = "technology", + name = params.k2matter.unlocked_by_technology, + icons = + { + { + icon = icon, + icon_size = 256, + }, + params.icon, + }, + prerequisites = {"kr-matter-processing"}, + unit = + { + count = 350, + ingredients = mods["space-exploration"] and + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"se-astronomic-science-pack-4", 1}, + {"se-energy-science-pack-4", 1}, + {"se-material-science-pack-4", 1}, + {"se-deep-space-science-pack-2", 1}, + {"se-kr-matter-science-pack-2", 1}, + } or + { + {"production-science-pack", 1}, + {"utility-science-pack", 1}, + {"kr-matter-tech-card", 1} + }, + time = 45, + }, + localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, }, - params.icon, - }, - prerequisites = { "kr-matter-processing" }, - unit = { - count = 350, - ingredients = mods["space-exploration"] and { - { "automation-science-pack", 1 }, - { "logistic-science-pack", 1 }, - { "chemical-science-pack", 1 }, - { "se-astronomic-science-pack-4", 1 }, - { "se-energy-science-pack-4", 1 }, - { "se-material-science-pack-4", 1 }, - { "se-deep-space-science-pack-2", 1 }, - { "se-kr-matter-science-pack-2", 1 }, - } or { - { "production-science-pack", 1 }, - { "utility-science-pack", 1 }, - { "kr-matter-tech-card", 1 }, - }, - time = 45, - }, - effects = {}, - -- localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, - }, - }) + }) end - if params.k2matter.only_deconversion then - matter.make_deconversion_recipe(params.k2matter) - else - matter.make_recipes(params.k2matter) - end - + matter.make_recipes(params.k2matter) end @@ -1193,8 +1193,8 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier) end util.remove_prior_unlocks(tech, old) for i, recipe in pairs(data.raw.recipe) do - if (recipe.enabled and recipe.enabled ~= false) - and (not recipe.hidden or recipe.hidden == true) -- probably don't want to change hidden recipes + if (recipe.enabled and recipe.enabled ~= 'false') + and (not recipe.hidden or recipe.hidden == 'true') -- probably don't want to change hidden recipes and string.sub(recipe.name, 1, 3) ~= 'se-' -- have to exlude SE in general :( then -- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name) -- Handy Debug :| diff --git a/bztungsten2/info.json b/bztungsten2/info.json index 2a1cd33..d4b5b65 100644 --- a/bztungsten2/info.json +++ b/bztungsten2/info.json @@ -1,6 +1,6 @@ { "name": "bztungsten2", - "version": "2.0.2", + "version": "2.0.1", "factorio_version": "2.0", "title": "Tungsten", "description": "Adds tungsten ore (wolframite), tungsten plates, tungsten carbide and rocket engine nozzles to the base game.", diff --git a/bztungsten2/tungsten-matter.lua b/bztungsten2/tungsten-matter.lua index d38b879..01c5974 100644 --- a/bztungsten2/tungsten-matter.lua +++ b/bztungsten2/tungsten-matter.lua @@ -1,32 +1,22 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then - local util = require("data-util") + local util = require("data-util"); + local matter = require("__Krastorio2__/prototypes/libraries/matter") - util.k2matter({ - k2matter = { - material = { type = "item", name = "tungsten-ore", amount = 30 }, - item_name = "tungsten-ore", + matter.make_recipes({ + material = { type = "item", name = "tungsten-ore", amount = 1 }, matter_count = 6, energy_required = 1, - needs_stabilizer = false, - unlocked_by = "tungsten-matter-processing", - }, - icon = { - icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", - icon_size = 64, - scale = 1 - }, + need_stabilizer = false, + unlocked_by_technology = "tungsten-matter-processing", + icon = {icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", icon_size = 64, scale = 1.25} }) - util.k2matter({ - k2matter = { - material = { type = "item", name = "tungsten-plate", amount = 10 }, - item_name = "tungsten-plate", + matter.make_recipes({ + material = { type = "item", name = "tungsten-plate", amount = 1 }, matter_count = 10, energy_required = 2, - only_deconversion = true, - needs_stabilizer = true, - unlocked_by = "tungsten-matter-processing", - }, + need_stabilizer = false, + unlocked_by_technology = "tungsten-matter-processing", }) end diff --git a/bztungsten2/tungsten-recipe-updates.lua b/bztungsten2/tungsten-recipe-updates.lua index c7781a3..1a240d7 100644 --- a/bztungsten2/tungsten-recipe-updates.lua +++ b/bztungsten2/tungsten-recipe-updates.lua @@ -4,12 +4,12 @@ local cuw = "tungsten-plate" if util.me.cuw() then cuw = "cuw" end -- Lamps -util.add_prerequisite("lamp", util.me.tungsten_processing) -util.set_tech_recipe("lamp", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) +util.add_prerequisite("optics", util.me.tungsten_processing) +util.set_tech_recipe("optics", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.add_ingredient("small-lamp", "tungsten-plate", 1) -- Rail signals use lamps -util.add_prerequisite("rail-signals", "lamp") +util.add_prerequisite("rail-signals", "optics") util.add_ingredient("rail-signal", "small-lamp", 1) util.add_ingredient("rail-chain-signal", "small-lamp", 1) @@ -104,14 +104,14 @@ util.add_ingredient("deadlock-floor-lamp", "tungsten-plate", 2) if mods["Krastorio2"] then util.set_tech_recipe("engine", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.set_tech_recipe("fluid-handling", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) - util.set_tech_recipe("lamp", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("optics", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) -- TODO: Fix --util.set_tech_recipe("oil-processing", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.set_tech_recipe("plastics", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) if util.me.get_setting("bztungsten-avoid-military") == "yes" then util.set_tech_recipe("rocketry", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) end - util.remove_prerequisite("kr-sentinel", "lamp") + util.remove_prerequisite("kr-sentinel", "optics") util.add_prerequisite(util.me.tungsten_processing, "kr-mineral-water-gathering") @@ -453,7 +453,7 @@ util.add_ingredient("simply-power-armor-mk3", "tungsten-plate", 20) -- Cargo Ships -util.add_prerequisite("water_transport_signals", "lamp") +util.add_prerequisite("water_transport_signals", "optics") util.add_ingredient("buoy", "small-lamp", 1) util.add_ingredient("chain_buoy", "small-lamp", 1) util.add_ingredient("oil_rig", "tungsten-carbide", 5) diff --git a/bztungsten2/tungsten-recipe.lua b/bztungsten2/tungsten-recipe.lua index 4097004..9d38537 100644 --- a/bztungsten2/tungsten-recipe.lua +++ b/bztungsten2/tungsten-recipe.lua @@ -101,6 +101,37 @@ data:extend({ } or nil, }) +if mods["aai-industry"] and not data.raw.technology["pumpjack"] then +data:extend({ + { + type = "technology", + name = "pumpjack", + icons = { + { icon = data.raw.technology["oil-processing"].icon, icon_size=data.raw.technology["oil-processing"].icon_size }, + }, + effects = + { + { + type = "unlock-recipe", + recipe = "pumpjack", + }, + }, + unit = + { + count = 25, + ingredients = + { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1} + }, + time = 30, + }, + prerequisites = {"fluid-handling"}, + order = "b-b", + }, +}) +end + data:extend({ { type = "recipe",