Skip to content

Commit 185a3f1

Browse files
committed
Recycle destoyed platform in SE #10
1 parent 7e71709 commit 185a3f1

File tree

10 files changed

+91
-1
lines changed

10 files changed

+91
-1
lines changed

.graphics/icons-64.xcf

144 KB
Binary file not shown.

.graphics/icons/scrap.png

4.13 KB
Loading
913 Bytes
Loading

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ After the destruction of a part of the train, a movable platform remains.
1010
- src - mod files
1111
```
1212

13+
### Integrated with mods
14+
- Space Exploration
15+
1316
### Third-party resources
1417
- [Flat car v1](https://free3d.com/3d-model/flat-car-v1--355163.html) printable_models
1518
- [HDRIs/Railway Bridge 02](https://polyhaven.com/a/railway_bridge_02) Sergej Majboroda / CC0
6.74 KB
Loading
6.43 KB
Loading
6.22 KB
Loading
6.74 KB
Loading
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
-- Compatibility can be added later
1+
local space_exploration = require("space-exploration")
22

3+
-- SE recycling
4+
if mods["space-exploration"] then
5+
space_exploration.register_recycle_recipes_for_destroyed_rolling_stock()
6+
end
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
local prototype_defines = require("prototypes.defines")
2+
3+
local main = {}
4+
5+
function main.register_recycle_recipes_for_destroyed_rolling_stock()
6+
---@param se_recycling_facility_technology TechnologyPrototype
7+
local se_recycling_facility_technology = data.raw.technology["se-recycling-facility"]
8+
local recipe = nil
9+
10+
-- Destroyed Locomotive Recycling
11+
12+
recipe = {
13+
type = "recipe",
14+
name = "atd-se-recycle-destroyed-locomotive",
15+
icon = "__StrongTrainsPlatform__/graphics/recipe/se-recycle/recycle-locomotive.png",
16+
icon_size = 64,
17+
enabled = se_recycling_facility_technology.enabled,
18+
category = "hard-recycling",
19+
subgroup = "recycling",
20+
energy_required = 10,
21+
ingredients = {{prototype_defines.item.destroyed_locomotive, 1}},
22+
results = {{type="item", name="se-scrap", amount=30}}
23+
}
24+
25+
data:extend{recipe}
26+
table.insert(se_recycling_facility_technology.effects, { type = "unlock-recipe", recipe = recipe.name })
27+
28+
-- Destroyed Cargo Wagon Recycling
29+
30+
recipe = {
31+
type = "recipe",
32+
name = "atd-se-recycle-destroyed-cargo-wagon",
33+
icon = "__StrongTrainsPlatform__/graphics/recipe/se-recycle/recycle-cargo-wagon.png",
34+
icon_size = 64,
35+
enabled = se_recycling_facility_technology.enabled,
36+
category = "hard-recycling",
37+
subgroup = "recycling",
38+
energy_required = 5,
39+
ingredients = {{prototype_defines.item.destroyed_cargo_wagon, 1}},
40+
results = {{type="item", name="se-scrap", amount=10}}
41+
}
42+
43+
data.raw.recipe["atd-se-recycle-destroyed-cargo-wagon"] = recipe
44+
table.insert(se_recycling_facility_technology.effects, { type = "unlock-recipe", recipe = recipe.name })
45+
46+
-- Destroyed Fluid Wagon Recycling
47+
48+
recipe = {
49+
type = "recipe",
50+
name = "atd-se-recycle-destroyed-fluid-wagon",
51+
icon = "__StrongTrainsPlatform__/graphics/recipe/se-recycle/recycle-fluid-wagon.png",
52+
icon_size = 64,
53+
enabled = se_recycling_facility_technology.enabled,
54+
category = "hard-recycling",
55+
subgroup = "recycling",
56+
energy_required = 5,
57+
ingredients = {{prototype_defines.item.destroyed_fluid_wagon, 1}},
58+
results = {{type="item", name="se-scrap", amount=10}}
59+
}
60+
61+
data.raw.recipe["atd-se-recycle-destroyed-fluid-wagon"] = recipe
62+
table.insert(se_recycling_facility_technology.effects, { type = "unlock-recipe", recipe = recipe.name })
63+
64+
-- Destroyed Artillery Wagon Recycling
65+
66+
recipe = {
67+
type = "recipe",
68+
name = "atd-se-recycle-destroyed-artillery-wagon",
69+
icon = "__StrongTrainsPlatform__/graphics/recipe/se-recycle/recycle-artillery-wagon.png",
70+
icon_size = 64,
71+
enabled = se_recycling_facility_technology.enabled,
72+
category = "hard-recycling",
73+
subgroup = "recycling",
74+
energy_required = 5,
75+
ingredients = {{prototype_defines.item.destroyed_artillery_wagon, 1}},
76+
results = {{type="item", name="se-scrap", amount=20}}
77+
}
78+
79+
data.raw.recipe["atd-se-recycle-destroyed-artillery-wagon"] = recipe
80+
table.insert(se_recycling_facility_technology.effects, { type = "unlock-recipe", recipe = recipe.name })
81+
end
82+
83+
return main

0 commit comments

Comments
 (0)