forked from nicholasgower/pelagos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
152 lines (135 loc) · 5.31 KB
/
Copy pathdata-final-fixes.lua
File metadata and controls
152 lines (135 loc) · 5.31 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
-- make sure plants can grow on sand-1
require("prototypes.plants-autoplace-settings")
require("prototypes.pirate-ship")
require("prototypes.liquid-fuel.rocket-silo")
require("prototypes.planet.electromagnetic-waves-pollution-emision")
require("prototypes.corrosive-dmg-resistances")
-- allow foundation on pelagos-deepsea
local landfill = data.raw.item["foundation"]
if landfill and landfill.place_as_tile and landfill.place_as_tile.tile_condition then
table.insert(landfill.place_as_tile.tile_condition, "pelagos-deepsea")
end
-- make pelagos-deepsea water_tile_type
table.insert(water_tile_type_names, "pelagos-deepsea")
-- Disable Arig's high-support electric poles on Pelagos deep sea tiles
-- Register a new collision layer if it doesn't exist yet
if not data.raw["collision-layer"]["deepsea_mechanic"] then
data:extend({
{
type = "collision-layer",
name = "deepsea_mechanic",
},
})
end
-- Add this collision layer to the "pelagos-deepsea" tile
local deepsea = data.raw.tile["pelagos-deepsea"]
if deepsea then
-- Ensure the tile has a proper collision_mask structure
if not deepsea.collision_mask then
deepsea.collision_mask = { layers = {} }
elseif not deepsea.collision_mask.layers then
deepsea.collision_mask = { layers = deepsea.collision_mask }
end
deepsea.collision_mask.layers["deepsea_mechanic"] = true
end
-- If Planetaris Unbounded is installed, restrict pole placement on deep sea
if mods["planetaris-arig"] then
local pole = data.raw["electric-pole"] and data.raw["electric-pole"]["planetaris-high-support-electric-pole"]
if pole then
-- Ensure the pole collides with our deep sea layer
pole.collision_mask = pole.collision_mask or { layers = {} }
if not pole.collision_mask.layers then
pole.collision_mask = { layers = pole.collision_mask }
end
pole.collision_mask.layers["deepsea_mechanic"] = true
-- Add a buildability rule for clarity (optional but harmless)
pole.tile_buildability_rules = pole.tile_buildability_rules or {}
table.insert(pole.tile_buildability_rules, {
area = { { -1, -1 }, { 1, 1 } },
colliding_tiles = { layers = { ["deepsea_mechanic"] = true } },
remove_on_collision = true,
})
end
end
-- Assign that layer to the coral so foundations collide with it
local coral = data.raw["simple-entity"]["pelagos-titanium-coral"]
if coral then
coral.collision_mask = coral.collision_mask or { layers = {} }
if not coral.collision_mask.layers then
coral.collision_mask = { layers = coral.collision_mask }
end
coral.collision_mask.layers["water_resource"] = true
end
-- diesel assembling-machine recipes
local base_categories = data.raw["assembling-machine"]["assembling-machine-3"].crafting_categories
local diesel_categories = table.deepcopy(base_categories)
table.insert(diesel_categories, "barreling")
data.raw["assembling-machine"]["diesel-assembling-machine"].crafting_categories = diesel_categories
-- remove buggy input from pirate ship mod
data:extend({
{
type = "custom-input",
name = "enter-pirate-ship",
key_sequence = "",
consuming = "none",
},
})
-- disable elevated rails on pleagos deep sea
if mods["elevated-rails"] then
data.raw["utility-constants"].default.default_collision_masks["rail-support"].layers["deepsea_mechanic"] = true
end
-- add placeholder layer for wooden-platform rework
if not data.raw["collision-layer"]["wooden-platform"] then
data:extend({
{
type = "collision-layer",
name = "wooden-platform",
},
})
end
-- cargo ships big ships
if data.raw["locomotive"]["cargo_ship_engine"] then
local ship = data.raw["locomotive"]["cargo_ship_engine"]
ship.energy_source = ship.energy_source or {}
ship.energy_source.type = "burner"
ship.energy_source.fuel_categories = { "diesel-fuel" }
--ship.energy_source.effectivity = 1
--ship.energy_source.effectivity = 1.5 -- moved to separate mod
--ship.energy_source.fuel_inventory_size = 10 -- moved to separate mod
ship.energy_source.burnt_inventory_size = 10
--ship.max_power = "1.2MW"
ship.max_power = "1.2MW"
end
if data.raw["locomotive"]["boat_engine"] then
local boat_engine = data.raw["locomotive"]["boat_engine"]
boat_engine.energy_source = boat_engine.energy_source or {}
boat_engine.energy_source.type = "burner"
boat_engine.energy_source.fuel_categories = { "diesel-fuel" }
boat_engine.energy_source.effectivity = 1
boat_engine.energy_source.fuel_inventory_size = 3
boat_engine.energy_source.burnt_inventory_size = 3
boat_engine.max_power = "0.3MW"
end
-- cargo ships boat
if data.raw["car"]["indep-boat"] then
local boat = data.raw["car"]["indep-boat"]
boat.energy_source = boat.energy_source or {}
boat.energy_source.type = "burner"
boat.energy_source.fuel_categories = { "diesel-fuel" }
boat.energy_source.effectivity = 1
boat.energy_source.fuel_inventory_size = 3
boat.energy_source.burnt_inventory_size = 3
--boat.max_power = "0.3MW"
boat.max_power = "0.3MW"
end
-- adding diesel-fuel into maraxsis-diesel-submarine
if data.raw["spider-vehicle"]["maraxsis-diesel-submarine"] then
local sub = data.raw["spider-vehicle"]["maraxsis-diesel-submarine"]
sub.energy_source = sub.energy_source or {}
sub.energy_source.fuel_categories = sub.energy_source.fuel_categories or {}
sub.movement_energy_consumption = "6.5MW"
table.insert(sub.energy_source.fuel_categories, "diesel-fuel")
end
if data.raw["mining-drill"]["canex-excavator"] then
local excavator = data.raw["mining-drill"]["canex-excavator"]
end