diff --git a/017_science/data-updates.lua b/017_science/data-updates.lua index e5324f5..c2817d4 100644 --- a/017_science/data-updates.lua +++ b/017_science/data-updates.lua @@ -17,6 +17,22 @@ for _, mod in pairs(data.raw.module) do end end +data.raw["technology"]["rocket-silo"].unit.ingredients = +{ + {"science-pack-1", 1}, + {"science-pack-2", 1}, + {"science-pack-3", 1}, + --{"military-science-pack", 1}, + {"production-science-pack", 1}, + {"high-tech-science-pack", 1} +} + +data.raw["recipe"]["atomic-bomb"].ingredients = +{ + {"rocket-control-unit", 15}, --{"processing-unit", 20}, + {"explosives", 10}, + {"uranium-235", 30} +} --HUGE THANKS to Dimava for the following changes --Added options for some changes (for modded users) diff --git a/017_science/data.lua b/017_science/data.lua index 01e0c83..e16a2a8 100644 --- a/017_science/data.lua +++ b/017_science/data.lua @@ -5,12 +5,41 @@ table.insert(data.raw["technology"]["advanced-electronics"].effects, {type = "un table.insert(data.raw["technology"]["advanced-material-processing-2"].effects, {type = "unlock-recipe",recipe = "17-production-science-pack"}) table.insert(data.raw["technology"]["advanced-electronics-2"].effects, {type = "unlock-recipe",recipe = "17-utility-science-pack"}) +table.insert(data.raw["technology"]["advanced-electronics-2"].effects, {type = "unlock-recipe",recipe = "rocket-control-unit"}) + table.insert(data.raw["technology"]["advanced-electronics-2"].effects, {type = "unlock-recipe",recipe = "low-density-structure"}) table.insert(data.raw["technology"]["advanced-electronics-2"].effects, {type = "unlock-recipe",recipe = "17-low-density-structure"}) --LDS unlock for pre-rocket bases +table.insert(data.raw["technology"]["advanced-material-processing-2"].effects, {type = "unlock-recipe",recipe = "rocket-fuel"}) + local effects = data.raw["technology"]["rocket-silo"].effects --remove the duplicate LDS effect in rocket-silo research for _=1, #effects do - if effects[_].type == "unlock-recipe" and effects[_].recipe == "low-density-structure" then + if effects[_].type == "unlock-recipe" and (effects[_].recipe == "low-density-structure" or effects[_].recipe == "rocket-fuel" or effects[_].recipe == "rocket-control-unit") then effects[_] = nil end +end + +local technology = data.raw["technology"]["rocket-silo"].prerequisites +for _=1, #technology do + if technology[_] == "rocket-speed-5" then + technology[_] = nil + end +end + +if not settings.startup["017-old-science"].value then + data.raw["recipe"]["science-pack-3"].hidden = true + local effects = data.raw["technology"]["advanced-electronics"].effects + for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "science-pack-3" then effects[_] = nil end end + + data.raw["recipe"]["military-science-pack"].hidden = true + local effects = data.raw["technology"]["military-2"].effects + for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "military-science-pack" then effects[_] = nil end end + + data.raw["recipe"]["production-science-pack"].hidden = true + local effects = data.raw["technology"]["advanced-material-processing-2"].effects + for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "production-science-pack" then effects[_] = nil end end + + data.raw["recipe"]["high-tech-science-pack"].hidden = true + local effects = data.raw["technology"]["advanced-electronics-2"].effects + for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "high-tech-science-pack" then effects[_] = nil end end end \ No newline at end of file diff --git a/017_science/info.json b/017_science/info.json index cce3032..b5703b9 100644 --- a/017_science/info.json +++ b/017_science/info.json @@ -1,6 +1,6 @@ { "name": "017_science", - "version": "0.0.5", + "version": "0.0.6", "factorio_version": "0.16", "title": "0.17 science conversion", "author": "npc_strider(morley376)", diff --git a/017_science/locale/en/base.cfg b/017_science/locale/en/base.cfg index f26f548..f2c41a6 100644 --- a/017_science/locale/en/base.cfg +++ b/017_science/locale/en/base.cfg @@ -8,8 +8,10 @@ high-tech-science-pack=Utility science pack 017-drill=Ore hardness simplification 017-smelting=Reduce smelting time 017-assem-lim=Remove assembler item limit +017-old-science=Enable old science recipes [mod-setting-description] 017-drill=(Default enabled) Toggle FFF-266 mining changes (removed hardness). This mod makes all vanilla ore hardness = 1 and makes the burner-mining-drill mining_power = 3, which may break modded ore gating. 017-smelting=(Default enabled) Toggle V's smelting changes (https://forums.factorio.com/viewtopic.php?t=64219#p392508). This mod may break ratios for modded recipes using vanilla and modded items. -017-assem-lim=(Default enabled) Toggle the assembly limit removal. This mod affects all assembling-machines and may affect modded crafting stations based on this entity, which may use the limit as a form of gating. \ No newline at end of file +017-assem-lim=(Default enabled) Toggle the assembly limit removal. This mod affects all assembling-machines and may affect modded crafting stations based on this entity, which may use the limit as a form of gating. +017-old-science=(Default disabled) Toggle the old science recipes (0.16). Disables the ability to use the vanilla recipes (except SP 1 & 2) but allows existing crafting machines to continue using the recipe until changed. \ No newline at end of file diff --git a/017_science/migrations/2019-01-06_017_science_0.0.6.lua b/017_science/migrations/2019-01-06_017_science_0.0.6.lua new file mode 100644 index 0000000..34244a9 --- /dev/null +++ b/017_science/migrations/2019-01-06_017_science_0.0.6.lua @@ -0,0 +1,16 @@ +for i, force in pairs(game.forces) do + if force.technologies["advanced-electronics-2"].researched then + force.recipes["rocket-control-unit"].enabled = true + end + if force.technologies["advanced-material-processing-2"].researched then + force.recipes["rocket-fuel"].enabled = true + end +end + +for i, force in pairs(game.forces) do + force.reset_recipes() +end + +for i, force in pairs(game.forces) do + force.reset_technologies() +end \ No newline at end of file diff --git a/017_science/migrations/migrations.lua b/017_science/migrations/migrations.lua index 50b1310..f991459 100644 --- a/017_science/migrations/migrations.lua +++ b/017_science/migrations/migrations.lua @@ -15,10 +15,12 @@ for i, force in pairs(game.forces) do end if force.technologies["advanced-material-processing-2"].researched then force.recipes["17-production-science-pack"].enabled = true + force.recipes["rocket-fuel"].enabled = true end if force.technologies["advanced-electronics-2"].researched then force.recipes["low-density-structure"].enabled = true force.recipes["17-low-density-structure"].enabled = true force.recipes["17-utility-science-pack"].enabled = true + force.recipes["rocket-control-unit"].enabled = true end end \ No newline at end of file diff --git a/017_science/settings.lua b/017_science/settings.lua index 5b2f98a..136c33d 100644 --- a/017_science/settings.lua +++ b/017_science/settings.lua @@ -17,5 +17,11 @@ data:extend( name = "017-assem-lim", setting_type = "startup", default_value = true + }, + { + type = "bool-setting", + name = "017-old-science", + setting_type = "startup", + default_value = false } }) \ No newline at end of file