forked from tburrows13/FreightForwarding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
49 lines (42 loc) · 2.23 KB
/
data-final-fixes.lua
File metadata and controls
49 lines (42 loc) · 2.23 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
require "__FreightForwarding__/prototypes/containers"
require "__FreightForwarding__/prototypes/fuel-categories"
local collision_mask_util = require "__core__.lualib.collision-mask-util"
data.raw["resource"]["ff-seamount"].collision_mask = {"resource-layer", non_deep_water_mask, "ground-tile"}
local platform_layer = collision_mask_util.get_first_unused_layer()
log("FF platform_layer assigned to " .. platform_layer)
table.insert(data.raw.tile["ff-dredging-platform"].collision_mask, platform_layer)
local banned_types = {"electric-pole", "underground-belt"}
for _, type in pairs(banned_types) do
for _, prototype in pairs(data.raw[type]) do
local mask = collision_mask_util.get_mask(prototype)
collision_mask_util.add_layer(mask, platform_layer)
prototype.collision_mask = mask
end
end
table.insert(data.raw["offshore-pump"]["offshore-pump"].center_collision_mask, platform_layer)
table.insert(data.raw["offshore-pump"]["waterfill-placer"].center_collision_mask, platform_layer)
-- Science
local util = require "__FreightForwarding__/prototypes/data-util"
for _, tech in pairs(data.raw.technology) do
if tech.unit then
local ingredients = tech.unit.ingredients
if util.contains_research_ingredient(tech.name, "chemical-science-pack")
and not util.contains_research_ingredient(tech.name, "ff-transport-science-pack") then
table.insert(ingredients, {"ff-transport-science-pack", 1})
else
-- Add to all techs descending from key techs
if (util.is_descendant_of(tech.name, "water_transport")
or util.is_descendant_of(tech.name, "fluid-handling")
or util.is_descendant_of(tech.name, "automobilism")
or util.is_descendant_of(tech.name, "ff-transport-science-pack"))
and util.contains_research_ingredient(tech.name, "logistic-science-pack")
and not util.contains_research_ingredient(tech.name, "ff-transport-science-pack") then
table.insert(ingredients, {"ff-transport-science-pack", 1})
end
end
end
end
-- Compatibility
require "__FreightForwarding__/compatibility/beautiful-bridge-railway/data-final-fixes"
require "__FreightForwarding__/compatibility/krastorio2/data-final-fixes"
require "__FreightForwarding__/compatibility/transport-drones/data-final-fixes"