-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdata-updates.lua
291 lines (247 loc) · 10.8 KB
/
data-updates.lua
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
if settings.startup["pypp-dev-mode"].value == true and settings.startup["pypp-create-cache"].value == true then
for r, resource in pairs(data.raw.resource) do
resource.autoplace = nil
end
end
require("prototypes/updates/pycoalprocessing-updates")
require("prototypes/updates/pypetroleumhandling-updates")
require("prototypes/updates/pyrawores-updates")
require("prototypes/updates/pyalienlife-updates")
require("prototypes/updates/pyalternativeenergy-updates")
--mapgen--
require("prototypes/mapgen")
--UNUSED
--require('prototypes/updates/ddc-coal-updates')
--require("prototypes/updates/pyfusionenergy-updates")
--require('prototypes/updates/pyhightech-updates')
--add driftwood for closer logs
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings.driftwood = {}
data:extend {
{
type = "fish",
name = "driftwood",
icon = "__PyBlock__/graphics/icons/driftwood.png",
icon_size = 64,
flags = {"placeable-neutral", "not-on-map"},
minable = {mining_time = 0.4, result = "log", count = 4},
max_health = 20,
subgroup = "creatures",
order = "b-a",
collision_box = {{-0.75, -0.75}, {0.75, 0.75}},
selection_box = {{-0.5, -0.3}, {0.5, 0.3}},
collision_mask = {layers = {ground_tile = true}, colliding_with_tiles_only = true},
pictures = {
{
filename = "__PyBlock__/graphics/icons/driftwood.png",
priority = "extra-high",
blend_mode = "additive",
width = 64,
height = 64,
scale = 0.5
}
},
autoplace = {probability_expression = 0.004},
protected_from_tile_building = false
}
}
-- create "floating" seaweed that moves
local seaweed = table.deepcopy(data.raw.tree.seaweed)
data.raw.tree.seaweed = nil
seaweed.type = "fish"
data.raw.fish.seaweed = seaweed
--adjust landfill cost for landfill painter
if mods["LandfillPainting"] then
local recipe_list = {
"landfill-dry-dirt",
"landfill-dirt-4",
"landfill-grass-1",
"landfill-red-desert-1",
"landfill-sand-3",
}
for _, recipe in pairs(recipe_list) do
RECIPE(recipe):remove_ingredient("stone"):add_ingredient {type = "item", name = "stone", amount = 1}:add_ingredient {type = "item", name = "sand", amount = 2}
end
end
data.raw.technology["excavation-1"].unit.ingredients = {{"automation-science-pack", 1}, {"py-science-pack-1", 1}}
data.raw.technology["excavation-1"].prerequisites = nil
table.insert(RECIPE("soot-separation").results, {type = "item", name = "ore-nickel", amount = 1, probability = 0.1})
RECIPE("soot-separation"):set_fields {unlock_results = true, ignore_in_pypp = false}
RECIPE("mining-antimony"):remove_unlock("excavation-2"):add_unlock("excavation-1") --:set_fields{results = {{type = "item", name = "antimonium-ore", amount = 20}}}
RECIPE("ground-borer"):remove_ingredient("intermetallics")
-- reduce fish oil to lube cost to increase drilling yield relative to fish input
RECIPE("mining-borax"):replace_ingredient("drilling-fluid-1", "lubricant")
RECIPE("fish-oil-to-lube"):replace_ingredient("fish-oil", "fish-oil", 50)
-- create new soot to ore recipes that generalize byproducts
local ores = {
["iron-ore"] = {
recipe_extension = "iron",
amount = 8,
technology = "oil-sands",
byproduct_probability = 0.2
},
["copper-ore"] = {
recipe_extension = "copper",
amount = 8,
technology = "ash-separation",
byproduct_probability = 0.2
},
["ore-aluminium"] = {
recipe_extension = "aluminium",
amount = 6,
technology = "mining-with-fluid",
byproduct_probability = 0.1
},
["ore-zinc"] = {
recipe_extension = "zinc",
amount = 6,
technology = "oil-sands",
byproduct_probability = 0.1
},
["ore-lead"] = {
recipe_extension = "lead",
amount = 8,
technology = "solder-mk01",
byproduct_probability = 0.1
},
["ore-nickel"] = {
recipe_extension = "nickel",
amount = 0,
technology = "",
byproduct_probability = 0.1
}
}
for o, ore in pairs(ores) do
if ore.amount ~= 0 then
RECIPE("soot-to-" .. ore.recipe_extension):set_fields {
energy_required = 15,
ingredients = {
{type = "item", name = "soot", amount = 10}
},
results = {
{type = "item", name = o, amount = ore.amount},
{type = "item", name = "ash", amount = 1, probability = 0.3}
},
result = nil,
main_product = o,
ignore_in_pypp = false
}
for s, secondary_ore in pairs(ores) do
if s ~= o then
table.insert(data.raw.recipe["soot-to-" .. ore.recipe_extension].results, {type = "item", name = s, amount = 1, probability = secondary_ore.byproduct_probability})
end
end
end
end
RECIPE("soot-to-copper"):add_unlock("ash-separation")
RECIPE("soot-to-aluminium"):add_unlock("mining-with-fluid")
-- get rid of the steam power tech
TECHNOLOGY("steam-power"):set_fields {hidden = true, unit = data.raw["technology"]["mining-productivity-4"].unit}
data.raw.technology["steam-power"].research_trigger = nil
for e, effect in pairs(data.raw["technology"]["steam-power"].effects) do
if effect.type == "unlock-recipe" then
RECIPE(effect.recipe):remove_unlock("steam-power"):set_fields {enabled = true}
else
data.raw["technology"]["ash-separation"].effects[#data.raw["technology"]["ash-separation"].effects + 1] = effect
end
end
-- remove required recipes from automation science pack
RECIPE("empty-planter-box"):remove_unlock("automation-science-pack"):set_fields {enabled = true}
RECIPE("soil"):remove_unlock("automation-science-pack"):set_fields {enabled = true}
-- move starter ash separation recipes to ash-separation and set trigger tech
TECHNOLOGY("ash-separation"):set_fields {research_trigger = {type = "craft-item", item = "ash", count = 200}, prerequisites = {"atomizer-mk00"}}
RECIPE("copper-plate"):add_unlock("ash-separation"):set_fields {enabled = false}
RECIPE("inductor1-2"):add_unlock("ash-separation"):set_fields {enabled = false}
data.raw["technology"]["ash-separation"].unit = nil
-- set automation science pack to require 10 copper plates
TECHNOLOGY("automation-science-pack"):set_fields {research_trigger = {type = "craft-item", item = "copper-plate", count = 10}}
data.raw["technology"]["automation-science-pack"].prerequisites = {"ash-separation"}
data.raw["technology"]["automation-science-pack"].unit = nil
data.raw["technology"]["atomizer-mk00"].unit = nil
-- burner/steam mk00 recipe adjustments
RECIPE("wpu"):add_ingredient {type = "item", name = "inductor1", amount = 12}:add_ingredient {type = "item", name = "wpu-mk00", amount = 1}:remove_unlock("automation-science-pack"):add_unlock("wood-processing"):set_fields {enabled = false}
RECIPE("soil-extractor-mk01"):remove_ingredient("burner-mining-drill"):add_ingredient {type = "item", name = "soil-extractor-mk00", amount = 1}
RECIPE("washer"):remove_ingredient("steam-engine"):add_ingredient {type = "item", name = "washer-mk00", amount = 1}
RECIPE("flora-collector-mk01"):remove_ingredient("soil-extractor-mk01"):add_ingredient {type = "item", name = "soil-extractor-mk00", amount = 1}
RECIPE("compost-plant-mk01"):add_ingredient {type = "item", name = "compost-plant-mk00", amount = 1}:remove_unlock("compost"):add_unlock("fertilizer-mk01")
RECIPE("slaughterhouse-mk01"):add_ingredient {type = "item", name = "slaughterhouse-mk00", amount = 1}
RECIPE("destructive-distillation-column-mk01"):add_ingredient {type = "item", name = "destructive-distillation-column-mk00", amount = 1}
-- increase construction costs of geothermal plant
RECIPE("geothermal-plant-mk01"):add_ingredient {type = "item", name = "pipe", amount = 80}:add_ingredient {type = "item", name = "concrete", amount = 150}
-- move check valve from fluid handling to assembly
RECIPE("py-check-valve"):remove_unlock("fluid-handling"):add_unlock("automation")
-- slow down geowater->steam recipe, and add more ingredients
RECIPE("geo-he-00"):set_fields {
energy_required = 10,
ingredients = {
{type = "fluid", name = "geothermal-water", amount = 180, minimum_temperature = 950},
{type = "fluid", name = "water", amount = 400}
},
results = {
{type = "fluid", name = "steam", amount = 320, temperature = 500}
}
}
-- move atomizer recipes to new trigger tech
RECIPE("iron-plate"):add_unlock("atomizer-mk00"):set_fields {enabled = false}
-- add burner atomizer to atomizer mk01 recipe
RECIPE("atomizer-mk01"):remove_ingredient("washer"):add_ingredient {type = "item", name = "atomizer-mk00", amount = 1}
-- data.raw.technology["mega-farm"].unit.ingredients = {{"automation-science-pack", 1},{"py-science-pack-1",1}}
-- TECHNOLOGY("mega-farm"):set_fields{prerequisites = {}}
-- RECIPE("mega-farm"):set_fields{ingredients = {}}:add_ingredient({"concrete", 200}):add_ingredient({"treated-wood", 50})
-- RECIPE("replicator-bioreserve"):set_fields{ingredients = {}}
-- data.raw.technology["mega-farm-bioreserve"].unit.ingredients = {{"automation-science-pack", 1},{"py-science-pack-1",1}}
RECIPE("earth-generic-sample"):remove_unlock("xenobiology"):add_unlock("biotech-mk01")
RECIPE("data-array"):remove_ingredient("titanium-plate")
RECIPE("molten-zinc-01"):replace_ingredient("heavy-oil", "heavy-oil", 40)
-- create pumping productivity techs
for i = 1, 12 do
local tech = table.deepcopy(data.raw.technology["mining-productivity-" .. i])
tech.name = "pumping-productivity-" .. i
tech.icons = {
{
icon = "__PyBlock__/graphics/icons/pumping-productivity.png",
icon_size = 128
},
{
icon = "__core__/graphics/icons/technology/constants/constant-mining-productivity.png",
icon_size = 128,
scale = 0.5,
shift = {50, 50},
floating = true
}
}
data.raw.technology["pumping-productivity-" .. i] = tech
tech.effects = {}
end
drilling_categories = {
clay = true,
["soil-extraction"] = true,
["ground-borer"] = true,
["sand-extractor"] = true
}
pumping_categories = {
coalbed = true,
fracking = true,
pumpjack = true
}
for r, recipe in pairs(data.raw.recipe) do
if drilling_categories[recipe.category] then
for i = 1, 12 do
data.raw.technology["mining-productivity-" .. i].effects[#data.raw.technology["mining-productivity-" .. i].effects + 1] = {
type = "change-recipe-productivity",
recipe = r,
change = 0.1
}
end
elseif pumping_categories[recipe.category] then
for i = 1, 12 do
data.raw.technology["pumping-productivity-" .. i].effects[#data.raw.technology["pumping-productivity-" .. i].effects + 1] = {
type = "change-recipe-productivity",
recipe = r,
change = 0.1
}
end
end
end
if register_cache_file ~= nil then
register_cache_file({"pycoalprocessing", "pyfusionenergy", "pyindustry", "pyrawores", "pypetroleumhandling", "pyalienlife", "pyhightech", "pyalternativeenergy", "PyBlock"}, "__PyBlock__/cached-configs/PyBlock+pyalienlife+pyalternativeenergy+pycoalprocessing+pyfusionenergy+pyhightech+pyindustry+pypetroleumhandling+pyrawores")
end