-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
207 lines (187 loc) · 8.14 KB
/
data-final-fixes.lua
File metadata and controls
207 lines (187 loc) · 8.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
require("carbon-recipe-final-stacking")
require("carbon-recipe-final-k2")
require("carbon-recipe-final-se")
require("carbon-recipe-final-rrr")
require("nanotubes-final")
require("compatibility.vtkdeepcoremining")
require("compatibility.any-planet-start")
local futil = require("util")
local util = require("data-util");
util.add_minable_result("simple-entity", "huge-volcanic-rock", {type="item", name="flake-graphite", amount_min=10, amount_max=24})
util.add_minable_result("simple-entity", "big-volcanic-rock", {type="item", name="rough-diamond", amount_min=5, amount_max=10})
util.set_localised_name("low-density-structure", {"item-name.low-density-structure"})
-- supercapacitors with graphene cloned from supercapacitors with activated carbon
if data.raw.recipe["supercapacitor"] then
local new_recipe = futil.table.deepcopy(data.raw.recipe["supercapacitor"])
new_recipe.name = new_recipe.name.."-graphene"
new_recipe.localised_name = {"item-name.supercapacitor"}
new_recipe.icons = {
{ icon = data.raw.item["supercapacitor"].icon, icon_size = data.raw.item["supercapacitor"].icon_size},
{ icon = "__bzcarbon__/graphics/icons/graphene.png", icon_size = 128, scale=0.125, shift= {-8, -8}, tint={1,1,1}},
}
new_recipe.icon = nil
new_recipe.icon_size = nil
data:extend({new_recipe})
util.replace_ingredient(new_recipe.name, "activated-carbon", "graphene", 1)
util.add_unlock("electromagnetic-plant", new_recipe.name)
end
-- Green circuits in final fixes due to K2 shenanigans
if mods.MDbobelectronics or mods.bobelectronics then
util.replace_ingredient("basic-electronic-components", "coal", "graphite")
util.replace_ingredient("basic-electronic-components", "coke", "graphite")
else
-- Electronic circuits need final fixes
function modify_ec(recipe_name, to_replace)
if not to_replace then
to_replace = "copper-cable"
end
local amt_ec = util.get_amount(recipe_name, "electronic-circuit")
if amt_ec == 1 then
util.multiply_recipe(recipe_name, 2)
util.set_recipe_time(recipe_name, 0.5) -- faster but more complex
end
util.replace_some_ingredient(recipe_name, to_replace, 2, "graphite", 1)
end
modify_ec("electronic-circuit")
modify_ec("electronic-circuit-stone")
modify_ec("electronic-circuit-wood")
modify_ec("electronic-circuit-aluminum", "aluminum-cable")
end
if data.raw.recipe["low-density-structure"] and
not data.raw.recipe["low-density-structure"].icon and
not data.raw.recipe["low-density-structure"].icons
then
-- final failsafe check, might no longer be necessary, needs testing with a lot of varied mod loadouts
util.set_subgroup("low-density-structure", data.raw.item["low-density-structure"].subgroup)
util.set_icons("low-density-structure", {
{ icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4},
})
util.set_subgroup("se-low-density-structure-beryllium", data.raw.item["low-density-structure"].subgroup)
util.set_icons("se-low-density-structure-beryllium", {
{ icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4},
})
util.set_subgroup("low-density-structure-RS", data.raw.item["low-density-structure"].subgroup)
util.set_icons("low-density-structure-RS", {
{ icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4},
})
end
if util.me.use_fiber() then
if not mods["space-age"] then
util.remove_ingredient("low-density-structure", "plastic-bar")
util.remove_ingredient("low-density-structure-nanotubes", "plastic-bar")
util.remove_ingredient("se-low-density-structure-beryllium", "plastic-bar")
end
end
-- Only electric smelters can make Diamonds
function diamondsInElectricSmelter(entity)
if entity.energy_source.type == "electric" then
local isSmelter = false
local isSmelterRS = false
for j, category in pairs(entity.crafting_categories) do
if category == "smelting" then
isSmelter = true
end
if category == "smelting-RS" then
isSmelterRS = true
end
end
if isSmelter then
table.insert(entity.crafting_categories,"diamond-synthesis")
end
if isSmelterRS then
table.insert(entity.crafting_categories,"diamond-synthesis-RS")
end
end
end
for i, entity in pairs(data.raw.furnace) do
diamondsInElectricSmelter(entity)
end
for i, entity in pairs(data.raw["assembling-machine"]) do
diamondsInElectricSmelter(entity)
end
-- furnace recipe rework, remove crucible ingredients one more time
for i, furnace in pairs(util.me.furnaces) do
for j, ingredient in pairs(util.me.crucible_ingredients) do
util.remove_ingredient(furnace, ingredient)
end
end
util.remove_ingredient("electric-furnace", "cuw") -- support new tungsten
-- Vanilla burner phase tweaks -- green circuits after electronics
if not util.k2() and not mods["aai-industry"] and not mods.bzaluminum then
util.replace_ingredient("electric-mining-drill", "electronic-circuit", "copper-cable", 6)
-- Most of this can go post 2.0
-- util.replace_ingredient("offshore-pump", "electronic-circuit", "copper-cable")
-- util.replace_ingredient("lab", "electronic-circuit", "copper-cable")
-- util.replace_ingredient("assembling-machine-1", "electronic-circuit", "copper-plate")
-- util.replace_ingredient("radar", "electronic-circuit", "copper-plate")
-- util.replace_ingredient("splitter", "electronic-circuit", "copper-cable", 20)
-- Keep repair pack raw ingredients the same:
-- util.remove_ingredient("repair-pack", "electronic-circuit")
-- util.add_ingredient("repair-pack", "copper-cable", 6)
-- util.set_ingredient("repair-pack", "iron-gear-wheel", 3)
-- util.add_effect("electronics", { type = "unlock-recipe", recipe = "electronic-circuit" })
-- util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" })
-- util.add_effect("electronics", { type = "unlock-recipe", recipe = "long-handed-inserter" })
-- util.remove_recipe_effect("automation", "long-handed-inserter")
-- util.set_enabled("electronic-circuit", false)
-- util.set_enabled("inserter", false)
-- util.add_prerequisite("logistic-science-pack", "electronics")
end
if mods["aai-industry"] then
-- AAI Industry now unlocks steam much later. Move it to an earlier sensible location in the tech tree.
util.set_prerequisite("steam-power", {"basic-fluid-handling"})
util.set_tech_recipe("steam-power", {{"automation-science-pack", 1}})
end
util.add_prerequisite("nanobots", "electronics")
if not mods.bzaluminum then
util.replace_ingredients_prior_to("electronics", "electronic-circuit", "copper-cable", 2)
end
if mods.modmashsplintersubspacelogistics then
for i, item in pairs({"graphite", "diamond"}) do
if data.raw.item["super-container-for-"..item] then
for i, icon in pairs(data.raw.item["super-container-for-"..item].icons) do
if string.find(icon.icon, item) then
icon.size = 128
icon.scale = icon.scale / 2
icon.icon_scale = icon.icon_scale / 2
end
end
end
if data.raw.recipe["super-container-for-"..item] then
for i, icon in pairs(data.raw.recipe["super-container-for-"..item].icons) do
if string.find(icon.icon, item) then
icon.size = 128
icon.scale = icon.scale / 4
icon.icon_scale = icon.icon_scale / 4
end
end
end
if data.raw.recipe["empty-super-container-of-"..item] then
for i, icon in pairs(data.raw.recipe["empty-super-container-of-"..item].icons) do
if string.find(icon.icon, item) then
icon.size = 128
icon.scale = icon.scale / 4
icon.icon_scale = icon.icon_scale / 4
end
end
end
for i, technology in pairs(data.raw.technology) do
if string.find(technology.name, "containment") then
if technology.icons then
for j, icon in pairs(technology.icons) do
if string.find(icon.icon, item) then
icon.size = 128
icon.scale = icon.scale / 8
icon.icon_scale = icon.icon_scale / 8
end
end
end
end
end
end
end
util.redo_recycling()
util.size_recycler_output()
util.use_fluid_mining_final()
-- Must be last
util.create_list()