mirror of
https://github.com/peter-tanner/017-science-transition-mod.git
synced 2024-11-30 11:00:19 +08:00
cleanup code + add power-armor-2 changes + option
This commit is contained in:
parent
2111f6f388
commit
efaf4543dc
|
@ -17,22 +17,47 @@ for _, mod in pairs(data.raw.module) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
data.raw["technology"]["rocket-silo"].unit.ingredients =
|
local function replace_table(table, condition, replace)
|
||||||
{
|
for _=1, #table do
|
||||||
{"science-pack-1", 1},
|
if table[_][1] == condition then
|
||||||
{"science-pack-2", 1},
|
table[_] = replace
|
||||||
{"science-pack-3", 1},
|
end
|
||||||
--{"military-science-pack", 1},
|
end
|
||||||
{"production-science-pack", 1},
|
end
|
||||||
{"high-tech-science-pack", 1}
|
|
||||||
}
|
local function prerequisites(technology, condition, replace)
|
||||||
|
for _=1, #technology do
|
||||||
|
if technology[_] == condition then
|
||||||
|
table.remove(technology, _)
|
||||||
|
if replace ~= nil then
|
||||||
|
table.insert(technology, replace)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
replace_table(data.raw["technology"]["rocket-silo"].unit.ingredients, "military-science-pack", nil)
|
||||||
|
|
||||||
|
if settings.startup["017-recipes-changes"].value then
|
||||||
|
replace_table(data.raw["recipe"]["atomic-bomb"].ingredients, "processing-unit", {"rocket-control-unit", 15})
|
||||||
|
|
||||||
|
replace_table(data.raw["recipe"]["power-armor-mk2"].ingredients, "speed-module-3", {"speed-module-2", 5})
|
||||||
|
replace_table(data.raw["recipe"]["power-armor-mk2"].ingredients, "effectivity-module-3", {"effectivity-module-2", 5})
|
||||||
|
local power_armor = data.raw["technology"]["power-armor-2"].prerequisites
|
||||||
|
prerequisites(power_armor, "speed-module-3", "speed-module-2")
|
||||||
|
prerequisites(power_armor, "effectivity-module-3", "effectivity-module-2")
|
||||||
|
table.insert(power_armor, "advanced-electronics-2")
|
||||||
|
end
|
||||||
|
|
||||||
|
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" or effects[_].recipe == "rocket-fuel" or effects[_].recipe == "rocket-control-unit") then
|
||||||
|
effects[_] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
prerequisites(data.raw["technology"]["rocket-silo"].prerequisites, "rocket-speed-5", nil)
|
||||||
|
|
||||||
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
|
--HUGE THANKS to Dimava for the following changes
|
||||||
--Added options for some changes (for modded users)
|
--Added options for some changes (for modded users)
|
||||||
|
|
||||||
|
|
|
@ -11,36 +11,21 @@ table.insert(data.raw["technology"]["advanced-electronics-2"].effects, {type = "
|
||||||
|
|
||||||
table.insert(data.raw["technology"]["advanced-material-processing-2"].effects, {type = "unlock-recipe",recipe = "rocket-fuel"})
|
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" 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
|
|
||||||
table.remove(technology, _)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not settings.startup["017-old-science"].value then
|
if not settings.startup["017-old-science"].value then
|
||||||
data.raw["recipe"]["science-pack-3"].hidden = true
|
local function hide(name, technology)
|
||||||
local effects = data.raw["technology"]["advanced-electronics"].effects
|
data.raw["recipe"][name].hidden = true
|
||||||
for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "science-pack-3" then effects[_] = nil end end
|
local effects = data.raw["technology"][technology].effects
|
||||||
|
for _=1, #effects do
|
||||||
|
if effects[_].type == "unlock-recipe" and effects[_].recipe == name then
|
||||||
|
effects[_] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
data.raw["recipe"]["military-science-pack"].hidden = true
|
hide("science-pack-3", "advanced-electronics")
|
||||||
local effects = data.raw["technology"]["military-2"].effects
|
hide("military-science-pack", "military-2")
|
||||||
for _=1, #effects do if effects[_].type == "unlock-recipe" and effects[_].recipe == "military-science-pack" then effects[_] = nil end end
|
hide("production-science-pack", "advanced-material-processing-2")
|
||||||
|
hide("high-tech-science-pack", "advanced-electronics-2")
|
||||||
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
|
|
||||||
|
|
||||||
data.raw["recipe"]["low-density-structure"].normal.hidden = true
|
data.raw["recipe"]["low-density-structure"].normal.hidden = true
|
||||||
data.raw["recipe"]["low-density-structure"].expensive.hidden = true
|
data.raw["recipe"]["low-density-structure"].expensive.hidden = true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "017_science",
|
"name": "017_science",
|
||||||
"version": "0.0.8",
|
"version": "0.0.9",
|
||||||
"factorio_version": "0.16",
|
"factorio_version": "0.16",
|
||||||
"title": "0.17 science conversion",
|
"title": "0.17 science conversion",
|
||||||
"author": "npc_strider(morley376)",
|
"author": "npc_strider(morley376)",
|
||||||
|
|
|
@ -9,9 +9,11 @@ high-tech-science-pack=Utility science pack
|
||||||
017-smelting=Reduce smelting time
|
017-smelting=Reduce smelting time
|
||||||
017-assem-lim=Remove assembler item limit
|
017-assem-lim=Remove assembler item limit
|
||||||
017-old-science=Enable old science recipes
|
017-old-science=Enable old science recipes
|
||||||
|
017-recipes-changes=Misc. recipe changes in 0.17
|
||||||
|
|
||||||
[mod-setting-description]
|
[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-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-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.
|
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.
|
017-old-science=(Default disabled) Toggle the old science recipes (0.16), including LDS. When disabled it removes the ability to use the vanilla science and LDS recipes (except SP 1 & 2) but allows existing crafting machines to continue using the recipe until manually changed.
|
||||||
|
017-recipes-changes=(Default enabled) atomic-bomb and power-armor-mk2 recipe changes
|
|
@ -23,5 +23,11 @@ data:extend(
|
||||||
name = "017-old-science",
|
name = "017-old-science",
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = false
|
default_value = false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "017-recipes-changes",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user