From c7885afe346ee5c910c06bff034336153c9215ee Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 12 Mar 2025 20:16:43 +0100 Subject: [PATCH] Mark Any planet start and Planet picker as incompatible --- lignumis/info.json | 3 +- .../prototypes/compatibility/aai-industry.lua | 4 +- lignumis/prototypes/compatibility/data.lua | 1 - .../compatibility/planet-picker.lua | 7 - .../content/basic-circuit-board.lua | 6 +- .../content/burner-agricultural-tower.lua | 6 +- lignumis/prototypes/content/technology.lua | 148 ++++++----- lignumis/prototypes/integrations/vanilla.lua | 248 +++++++++--------- lignumis/scripts/init-existing.lua | 4 +- lignumis/scripts/init-new.lua | 1 - lignumis/scripts/init.lua | 1 - lignumis/settings.lua | 9 - 12 files changed, 202 insertions(+), 236 deletions(-) delete mode 100644 lignumis/prototypes/compatibility/planet-picker.lua diff --git a/lignumis/info.json b/lignumis/info.json index 03dd3b6..e86051b 100644 --- a/lignumis/info.json +++ b/lignumis/info.json @@ -24,11 +24,12 @@ "?wood-military >= 2.3.3", "?metal-and-stars", "?aai-industry", - "?planet-picker", "?Diversitree", "?aai-loaders", "?atan-nuclear-science", "?lane-splitters", + "!planet-picker", + "!any-planet-start", "!apm_power_ldinc", "!wood-logistics", "!early-agriculture", diff --git a/lignumis/prototypes/compatibility/aai-industry.lua b/lignumis/prototypes/compatibility/aai-industry.lua index 14174bd..b4f27f3 100644 --- a/lignumis/prototypes/compatibility/aai-industry.lua +++ b/lignumis/prototypes/compatibility/aai-industry.lua @@ -8,9 +8,7 @@ local burner_mechanics = Technology:new("burner-mechanics") burner_mechanics:removeRecipe("burner-inserter") burner_mechanics:removeRecipe("burner-mining-drill") burner_mechanics:removeRecipe("burner-assembling-machine") -if not mods["planet-picker"] and not mods["any-planet-start"] then - burner_mechanics:addPrerequisite("iron-processing") -end +burner_mechanics:addPrerequisite("iron-processing") data.raw.recipe["burner-inserter"].enabled = true data.raw.recipe["burner-mining-drill"].enabled = true diff --git a/lignumis/prototypes/compatibility/data.lua b/lignumis/prototypes/compatibility/data.lua index 08074f9..893c11f 100644 --- a/lignumis/prototypes/compatibility/data.lua +++ b/lignumis/prototypes/compatibility/data.lua @@ -2,7 +2,6 @@ require("hot-metals") require("wood-military") require("metal-and-stars") require("alien-biomes") -require("planet-picker") require("aai-loaders") require("nuclear-science") require("lane-splitters") \ No newline at end of file diff --git a/lignumis/prototypes/compatibility/planet-picker.lua b/lignumis/prototypes/compatibility/planet-picker.lua deleted file mode 100644 index 170924a..0000000 --- a/lignumis/prototypes/compatibility/planet-picker.lua +++ /dev/null @@ -1,7 +0,0 @@ -local Technology = require("__cf-lib__/data/Technology") - -if not mods["planet-picker"] and not mods["any-planet-start"] then return end - -local technology = Technology:new("planet-discovery-lignumis") -technology:setPrerequisites({ "space-platform-thruster" }) -technology:addIngredients({ "logistic-science-pack", "chemical-science-pack", "space-science-pack" }) diff --git a/lignumis/prototypes/content/basic-circuit-board.lua b/lignumis/prototypes/content/basic-circuit-board.lua index 79e0312..7c12dcc 100644 --- a/lignumis/prototypes/content/basic-circuit-board.lua +++ b/lignumis/prototypes/content/basic-circuit-board.lua @@ -51,11 +51,7 @@ data:extend({ } }) -if not mods["planet-picker"] and not mods["any-planet-start"] then - Technology:new("copper-processing"):addRecipe("basic-circuit-board-copper") -else - Technology:new("electronics"):addRecipe("basic-circuit-board-copper") -end +Technology:new("copper-processing"):addRecipe("basic-circuit-board-copper") if settings.startup["lignumis-circuit-progression"].value then table.insert(data.raw.recipe["electronic-circuit"].ingredients, { type = "item", name = "basic-circuit-board", amount = 1 }) diff --git a/lignumis/prototypes/content/burner-agricultural-tower.lua b/lignumis/prototypes/content/burner-agricultural-tower.lua index d81c83e..21fac1d 100644 --- a/lignumis/prototypes/content/burner-agricultural-tower.lua +++ b/lignumis/prototypes/content/burner-agricultural-tower.lua @@ -132,8 +132,4 @@ data:extend({ } }) -if not mods["planet-picker"] and not mods["any-planet-start"] then - Technology:new("copper-processing"):addRecipe("burner-agricultural-tower-copper") -else - Technology:new("electronics"):addRecipe("burner-agricultural-tower-copper") -end +Technology:new("copper-processing"):addRecipe("burner-agricultural-tower-copper") \ No newline at end of file diff --git a/lignumis/prototypes/content/technology.lua b/lignumis/prototypes/content/technology.lua index c83db13..fa19344 100644 --- a/lignumis/prototypes/content/technology.lua +++ b/lignumis/prototypes/content/technology.lua @@ -83,83 +83,81 @@ data:extend({ } }) -if not mods["planet-picker"] and not mods["any-planet-start"] then - data:extend({ - { - type = "technology", - name = "planet-discovery-nauvis", - icons = util.technology_icon_constant_planet(Lignumis.graphics .. "technology/nauvis.png"), - icon_size = 256, - essential = true, - effects = { - { - type = "unlock-space-location", - space_location = "nauvis", - use_icon_overlay_constant = true - }, - { - type = "unlock-space-platforms", - modifier = true, - hidden = true - } +data:extend({ + { + type = "technology", + name = "planet-discovery-nauvis", + icons = util.technology_icon_constant_planet(Lignumis.graphics .. "technology/nauvis.png"), + icon_size = 256, + essential = true, + effects = { + { + type = "unlock-space-location", + space_location = "nauvis", + use_icon_overlay_constant = true }, - prerequisites = { "provisional-rocketry" }, - unit = { - count = 100, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 30 + { + type = "unlock-space-platforms", + modifier = true, + hidden = true } }, - { - type = "technology", - name = "iron-processing", - icon = "__base__/graphics/icons/iron-plate.png", - icon_size = 64, - essential = true, - effects = { - { - type = "unlock-recipe", - recipe = "iron-plate" - }, - { - type = "unlock-recipe", - recipe = "iron-chest" - }, - { - type = "unlock-recipe", - recipe = "iron-gear-wheel" - } + prerequisites = { "provisional-rocketry" }, + unit = { + count = 100, + ingredients = { + { "wood-science-pack", 1 }, + { "steam-science-pack", 1 } }, - prerequisites = { "planet-discovery-nauvis" }, - research_trigger = { - type = "mine-entity", - entity = "iron-ore" - } - }, - { - type = "technology", - name = "copper-processing", - icon = "__base__/graphics/icons/copper-plate.png", - icon_size = 64, - essential = true, - effects = { - { - type = "unlock-recipe", - recipe = "copper-plate" - }, - { - type = "unlock-recipe", - recipe = "copper-cable" - } - }, - prerequisites = { "planet-discovery-nauvis" }, - research_trigger = { - type = "mine-entity", - entity = "copper-ore" - } + time = 30 } - }) -end + }, + { + type = "technology", + name = "iron-processing", + icon = "__base__/graphics/icons/iron-plate.png", + icon_size = 64, + essential = true, + effects = { + { + type = "unlock-recipe", + recipe = "iron-plate" + }, + { + type = "unlock-recipe", + recipe = "iron-chest" + }, + { + type = "unlock-recipe", + recipe = "iron-gear-wheel" + } + }, + prerequisites = { "planet-discovery-nauvis" }, + research_trigger = { + type = "mine-entity", + entity = "iron-ore" + } + }, + { + type = "technology", + name = "copper-processing", + icon = "__base__/graphics/icons/copper-plate.png", + icon_size = 64, + essential = true, + effects = { + { + type = "unlock-recipe", + recipe = "copper-plate" + }, + { + type = "unlock-recipe", + recipe = "copper-cable" + } + }, + prerequisites = { "planet-discovery-nauvis" }, + research_trigger = { + type = "mine-entity", + entity = "copper-ore" + } + } +}) \ No newline at end of file diff --git a/lignumis/prototypes/integrations/vanilla.lua b/lignumis/prototypes/integrations/vanilla.lua index 75b9b74..cd907b2 100644 --- a/lignumis/prototypes/integrations/vanilla.lua +++ b/lignumis/prototypes/integrations/vanilla.lua @@ -129,14 +129,12 @@ table.insert(data.raw["assembling-machine"]["assembling-machine-3"].crafting_cat -- Disable vanilla early game recipes -if not mods["planet-picker"] and not mods["any-planet-start"] then - data.raw.recipe["iron-plate"].enabled = false - data.raw.recipe["iron-gear-wheel"].enabled = false - data.raw.recipe["iron-chest"].enabled = false - data.raw.recipe["copper-plate"].enabled = false - data.raw.recipe["copper-cable"].enabled = false - data.raw.recipe["transport-belt"].enabled = false -end +data.raw.recipe["iron-plate"].enabled = false +data.raw.recipe["iron-gear-wheel"].enabled = false +data.raw.recipe["iron-chest"].enabled = false +data.raw.recipe["copper-plate"].enabled = false +data.raw.recipe["copper-cable"].enabled = false +data.raw.recipe["transport-belt"].enabled = false -- Progressive recipes @@ -157,143 +155,141 @@ end -- Adjust vanilla technologies -if not mods["planet-picker"] and not mods["any-planet-start"] then - local automation_science_pack_technology = data.raw.technology["automation-science-pack"] - automation_science_pack_technology.enabled = false - automation_science_pack_technology.visible_when_disabled = true - automation_science_pack_technology.research_trigger = nil - automation_science_pack_technology.unit = { - count = 1, - ingredients = {}, - time = 1 - } +local automation_science_pack_technology = data.raw.technology["automation-science-pack"] +automation_science_pack_technology.enabled = false +automation_science_pack_technology.visible_when_disabled = true +automation_science_pack_technology.research_trigger = nil +automation_science_pack_technology.unit = { + count = 1, + ingredients = {}, + time = 1 +} - if not mods["aai-industry"] then - local electronics_technology = data.raw.technology["electronics"] - electronics_technology.prerequisites = { "copper-processing" } +if not mods["aai-industry"] then + local electronics_technology = data.raw.technology["electronics"] + electronics_technology.prerequisites = { "copper-processing" } - local steam_power_technology = data.raw.technology["steam-power"] - steam_power_technology.prerequisites = { "iron-processing" } - end + local steam_power_technology = data.raw.technology["steam-power"] + steam_power_technology.prerequisites = { "iron-processing" } +end - local automation_technology = data.raw.technology["automation"] - automation_technology.ignore_tech_cost_multiplier = false +local automation_technology = data.raw.technology["automation"] +automation_technology.ignore_tech_cost_multiplier = false - local logistics_technology = data.raw.technology["logistics"] - table.insert(logistics_technology.effects, { - type = "unlock-recipe", - recipe = "transport-belt" - }) +local logistics_technology = data.raw.technology["logistics"] +table.insert(logistics_technology.effects, { + type = "unlock-recipe", + recipe = "transport-belt" +}) - local landfill_technology = data.raw.technology["landfill"] - landfill_technology.prerequisites = { "burner-automation" } - landfill_technology.unit = { - count = 50, - ingredients = { { "wood-science-pack", 1 } }, - time = 15 - } +local landfill_technology = data.raw.technology["landfill"] +landfill_technology.prerequisites = { "burner-automation" } +landfill_technology.unit = { + count = 50, + ingredients = { { "wood-science-pack", 1 } }, + time = 15 +} - local robots_speed_technology_1 = data.raw.technology["worker-robots-speed-1"] - robots_speed_technology_1.prerequisites = { "provisional-rocketry", "basic-construction-robotics-gold" } - robots_speed_technology_1.unit = { - count = 100, - ingredients = { { "wood-science-pack", 1 }, { "steam-science-pack", 1 } }, - time = 15 - } +local robots_speed_technology_1 = data.raw.technology["worker-robots-speed-1"] +robots_speed_technology_1.prerequisites = { "provisional-rocketry", "basic-construction-robotics-gold" } +robots_speed_technology_1.unit = { + count = 100, + ingredients = { { "wood-science-pack", 1 }, { "steam-science-pack", 1 } }, + time = 15 +} - local robots_speed_technology_2 = data.raw.technology["worker-robots-speed-2"] - robots_speed_technology_2.prerequisites = { - "worker-robots-speed-1", - "logistic-science-pack" - } - robots_speed_technology_2.unit = { - count = 100, - ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 } }, - time = 30 - } +local robots_speed_technology_2 = data.raw.technology["worker-robots-speed-2"] +robots_speed_technology_2.prerequisites = { + "worker-robots-speed-1", + "logistic-science-pack" +} +robots_speed_technology_2.unit = { + count = 100, + ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 } }, + time = 30 +} - local robots_speed_technology_3 = data.raw.technology["worker-robots-speed-3"] - robots_speed_technology_3.prerequisites = { "robotics", "chemical-science-pack" } - robots_speed_technology_3.unit = { - count = 150, - ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 }, { "chemical-science-pack", 1 } }, - time = 30 - } +local robots_speed_technology_3 = data.raw.technology["worker-robots-speed-3"] +robots_speed_technology_3.prerequisites = { "robotics", "chemical-science-pack" } +robots_speed_technology_3.unit = { + count = 150, + ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 }, { "chemical-science-pack", 1 } }, + time = 30 +} - local robots_speed_technology_4 = data.raw.technology["worker-robots-speed-4"] - robots_speed_technology_4.prerequisites = { "worker-robots-speed-3", "utility-science-pack" } - robots_speed_technology_4.unit.ingredients = { - { "automation-science-pack", 1 }, - { "logistic-science-pack", 1 }, - { "chemical-science-pack", 1 }, - { "utility-science-pack", 1 } - } +local robots_speed_technology_4 = data.raw.technology["worker-robots-speed-4"] +robots_speed_technology_4.prerequisites = { "worker-robots-speed-3", "utility-science-pack" } +robots_speed_technology_4.unit.ingredients = { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "utility-science-pack", 1 } +} - local physical_damage_technology_1 = data.raw.technology["physical-projectile-damage-1"] - physical_damage_technology_1.prerequisites = { "basic-gun-turret" } - physical_damage_technology_1.unit.ingredients = { { "wood-science-pack", 1 } } - table.insert(physical_damage_technology_1.effects, { - type = "turret-attack", - turret_id = "basic-gun-turret", - modifier = 0.2 - }) +local physical_damage_technology_1 = data.raw.technology["physical-projectile-damage-1"] +physical_damage_technology_1.prerequisites = { "basic-gun-turret" } +physical_damage_technology_1.unit.ingredients = { { "wood-science-pack", 1 } } +table.insert(physical_damage_technology_1.effects, { + type = "turret-attack", + turret_id = "basic-gun-turret", + modifier = 0.2 +}) - local weapon_speed_technology_1 = data.raw.technology["weapon-shooting-speed-1"] - weapon_speed_technology_1.prerequisites = table.deepcopy(physical_damage_technology_1.prerequisites) - weapon_speed_technology_1.unit.ingredients = table.deepcopy(physical_damage_technology_1.unit.ingredients) +local weapon_speed_technology_1 = data.raw.technology["weapon-shooting-speed-1"] +weapon_speed_technology_1.prerequisites = table.deepcopy(physical_damage_technology_1.prerequisites) +weapon_speed_technology_1.unit.ingredients = table.deepcopy(physical_damage_technology_1.unit.ingredients) - local physical_damage_technology_2 = data.raw.technology["physical-projectile-damage-2"] - physical_damage_technology_2.prerequisites = { "physical-projectile-damage-1", "steam-science-pack" } - physical_damage_technology_2.unit.ingredients = { { "wood-science-pack", 1 }, { "steam-science-pack", 1 } } - table.insert(physical_damage_technology_2.effects, { - type = "turret-attack", - turret_id = "basic-gun-turret", - modifier = 0.2 - }) +local physical_damage_technology_2 = data.raw.technology["physical-projectile-damage-2"] +physical_damage_technology_2.prerequisites = { "physical-projectile-damage-1", "steam-science-pack" } +physical_damage_technology_2.unit.ingredients = { { "wood-science-pack", 1 }, { "steam-science-pack", 1 } } +table.insert(physical_damage_technology_2.effects, { + type = "turret-attack", + turret_id = "basic-gun-turret", + modifier = 0.2 +}) - local weapon_speed_technology_2 = data.raw.technology["weapon-shooting-speed-2"] - weapon_speed_technology_2.prerequisites = { "weapon-shooting-speed-1", "steam-science-pack" } - weapon_speed_technology_2.unit.ingredients = table.deepcopy(physical_damage_technology_2.unit.ingredients) +local weapon_speed_technology_2 = data.raw.technology["weapon-shooting-speed-2"] +weapon_speed_technology_2.prerequisites = { "weapon-shooting-speed-1", "steam-science-pack" } +weapon_speed_technology_2.unit.ingredients = table.deepcopy(physical_damage_technology_2.unit.ingredients) - local physical_damage_technology_3 = data.raw.technology["physical-projectile-damage-3"] - physical_damage_technology_3.prerequisites = { "military-2", "logistic-science-pack" } - physical_damage_technology_3.unit.ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 } } - physical_damage_technology_3.upgrade = false - table.insert(physical_damage_technology_3.effects, { - type = "turret-attack", - turret_id = "basic-gun-turret", - modifier = 0.3 - }) +local physical_damage_technology_3 = data.raw.technology["physical-projectile-damage-3"] +physical_damage_technology_3.prerequisites = { "military-2", "logistic-science-pack" } +physical_damage_technology_3.unit.ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 } } +physical_damage_technology_3.upgrade = false +table.insert(physical_damage_technology_3.effects, { + type = "turret-attack", + turret_id = "basic-gun-turret", + modifier = 0.3 +}) - local weapon_speed_technology_3 = data.raw.technology["weapon-shooting-speed-3"] - weapon_speed_technology_3.prerequisites = { "military-2", "logistic-science-pack" } - weapon_speed_technology_3.unit.ingredients = table.deepcopy(physical_damage_technology_3.unit.ingredients) - weapon_speed_technology_3.upgrade = false +local weapon_speed_technology_3 = data.raw.technology["weapon-shooting-speed-3"] +weapon_speed_technology_3.prerequisites = { "military-2", "logistic-science-pack" } +weapon_speed_technology_3.unit.ingredients = table.deepcopy(physical_damage_technology_3.unit.ingredients) +weapon_speed_technology_3.upgrade = false - local physical_damage_technology_4 = data.raw.technology["physical-projectile-damage-4"] - physical_damage_technology_4.prerequisites = { "physical-projectile-damage-3", "military-science-pack" } - table.insert(physical_damage_technology_4.effects, { - type = "turret-attack", - turret_id = "basic-gun-turret", - modifier = 0.3 - }) +local physical_damage_technology_4 = data.raw.technology["physical-projectile-damage-4"] +physical_damage_technology_4.prerequisites = { "physical-projectile-damage-3", "military-science-pack" } +table.insert(physical_damage_technology_4.effects, { + type = "turret-attack", + turret_id = "basic-gun-turret", + modifier = 0.3 +}) - local weapon_speed_technology_4 = data.raw.technology["weapon-shooting-speed-4"] - weapon_speed_technology_4.prerequisites = { "weapon-shooting-speed-3", "military-science-pack" } +local weapon_speed_technology_4 = data.raw.technology["weapon-shooting-speed-4"] +weapon_speed_technology_4.prerequisites = { "weapon-shooting-speed-3", "military-science-pack" } - local production_science_pack_technology = Technology:new("production-science-pack") - production_science_pack_technology:replacePrerequisite("advanced-material-processing-2", "space-platform-thruster") - production_science_pack_technology:addIngredients({ "space-science-pack" }) - if settings.startup["lignumis-technology-progression"].value then - production_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) - end +local production_science_pack_technology = Technology:new("production-science-pack") +production_science_pack_technology:replacePrerequisite("advanced-material-processing-2", "space-platform-thruster") +production_science_pack_technology:addIngredients({ "space-science-pack" }) +if settings.startup["lignumis-technology-progression"].value then + production_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) +end - local utility_science_pack_technology = Technology:new("utility-science-pack") - utility_science_pack_technology:setPrerequisites({ "space-platform-thruster" }) - utility_science_pack_technology:addIngredients({ "space-science-pack" }) - if settings.startup["lignumis-technology-progression"].value then - utility_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) - end +local utility_science_pack_technology = Technology:new("utility-science-pack") +utility_science_pack_technology:setPrerequisites({ "space-platform-thruster" }) +utility_science_pack_technology:addIngredients({ "space-science-pack" }) +if settings.startup["lignumis-technology-progression"].value then + utility_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) end if not mods["planet-muluna"] then -- Muluna does the same diff --git a/lignumis/scripts/init-existing.lua b/lignumis/scripts/init-existing.lua index c5cb392..3836b3a 100644 --- a/lignumis/scripts/init-existing.lua +++ b/lignumis/scripts/init-existing.lua @@ -15,11 +15,11 @@ InitExisting.on_init = function() end for _, force in pairs(game.forces) do - force.technologies["iron-processing"].researched = true - force.technologies["copper-processing"].researched = true if force.is_space_location_unlocked("nauvis") then force.technologies["planet-discovery-nauvis"].researched = true end + force.technologies["iron-processing"].researched = true + force.technologies["copper-processing"].researched = true end game.print { "", { "lignumis.start-new-game" } } diff --git a/lignumis/scripts/init-new.lua b/lignumis/scripts/init-new.lua index 1acc2fb..efe1a07 100644 --- a/lignumis/scripts/init-new.lua +++ b/lignumis/scripts/init-new.lua @@ -62,7 +62,6 @@ end InitNew.on_init = function() if game.tick > 0 then return end - if script.active_mods["planet-picker"] or script.active_mods["any-planet-start"] then return end init_intro() init_space_locations() diff --git a/lignumis/scripts/init.lua b/lignumis/scripts/init.lua index 2b0ceba..24b5af4 100644 --- a/lignumis/scripts/init.lua +++ b/lignumis/scripts/init.lua @@ -37,7 +37,6 @@ end -- Initialize the freeplay scenario local function init_freeplay(event) - if script.active_mods["planet-picker"] or script.active_mods["any-planet-start"] then return end if storage.crashed_ship_lignumis then return end local player = game.get_player(event.player_index) diff --git a/lignumis/settings.lua b/lignumis/settings.lua index 744094c..47268af 100644 --- a/lignumis/settings.lua +++ b/lignumis/settings.lua @@ -52,12 +52,3 @@ if mods["wood-military"] then data.raw["bool-setting"]["lignumis-ammo-progression"].forced_value = false data.raw["bool-setting"]["lignumis-ammo-progression"].hidden = true end - -if mods["planet-picker"] or mods["any-planet-start"] then - data.raw["bool-setting"]["lignumis-belt-progression"].forced_value = false - data.raw["bool-setting"]["lignumis-belt-progression"].hidden = true - data.raw["bool-setting"]["lignumis-inserter-progression"].forced_value = false - data.raw["bool-setting"]["lignumis-inserter-progression"].hidden = true - data.raw["bool-setting"]["lignumis-ammo-progression"].forced_value = false - data.raw["bool-setting"]["lignumis-ammo-progression"].hidden = true -end