-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.lua
More file actions
129 lines (114 loc) · 4.39 KB
/
Copy pathdata.lua
File metadata and controls
129 lines (114 loc) · 4.39 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
G2_wafer_recipes = {}
local du = require("dutil")
for _, technology in pairs(data.raw.technology) do
technology.hidden = true
end
for _, recipe in pairs(data.raw.recipe) do
recipe.hidden = true
recipe.enabled = false
end
require("prototypes.alias")
require("prototypes.constants")
require("prototypes.groups")
require("prototypes.minibuffer-entity")
require("prototypes.fluid")
require("prototypes.entity")
require("prototypes.item")
require("prototypes.recipe")
require("prototypes.programming")
require("prototypes.heat-exchange")
require("prototypes.tile")
require("prototypes.styles")
require("prototypes.resource.ore")
require("prototypes.pre-science.recipe")
require("prototypes.environmental-science.recipe")
require("prototypes.environmental-science.technology")
require("prototypes.environmental-science.forestry")
--require("prototypes.environmental-science.incinerating-recipe")
require("prototypes.electromagnetic-science.recipe")
require("prototypes.electromagnetic-science.petrochem")
require("prototypes.electromagnetic-science.wafers")
require("prototypes.electromagnetic-science.technology")
require("prototypes.automation-science.recipe")
require("prototypes.automation-science.technology")
require("prototypes.environmental-science.flaring")
require("prototypes.yafc-fixes")
for _, type in pairs(data.raw) do
for _, proto in pairs(data.raw[type] or {}) do
if proto.energy_source then
if proto.energy_source.type == "burner" then
proto.energy_source.burnt_inventory_size = proto.energy_source.burnt_inventory_size or 1
end
end
end
end
data.raw.locomotive.locomotive.energy_source.burnt_inventory_size = 3
data.raw.car.car.energy_source.burnt_inventory_size = 1
local order_by_tech = {
["environmental-science-pack"] = 1,
["mechanical-science-pack"] = 2,
["electromagnetic-science-pack"] = 3,
["automation-science-pack"] = 4,
["logistic-science-pack"] = 5,
}
for _, technology in pairs(data.raw.technology) do
if technology.unit then
if technology.unit.ingredients then
local do_autosort = false
if not technology.order then
do_autosort = true
end
technology.order = technology.order or "a"
local curr_order = 0
local curr_cost = 0
for _, ingredient in pairs(technology.unit.ingredients) do
if order_by_tech[ingredient[1] or ""] or 0 > curr_order then
curr_order = order_by_tech[ingredient[1]]
curr_cost = (technology.unit.count or 1) * (ingredient[2] or 1)
end
end
if do_autosort then
technology.order = tostring(curr_cost).."-"..technology.order
else
technology.order = "0-"..technology.order
end
technology.order = tostring(curr_order).."-"..technology.order
end
end
end
for _, fluid in pairs(data.raw.fluid) do
if not fluid.fuel_value or fluid.no_canister or data.raw.item[fluid.name.."-canister"] then
goto continue
end
local canister_name = fluid.name.."-canister"
local canister_item = {
type = "item",
name = canister_name,
fuel_value = (du.MJ(fluid.fuel_value) * 8).."MJ",
localised_name = {"label.filled-canister", {"fluid-name."..fluid.name}},
fuel_category = "chemical",
subgroup = "canister",
order = "a",
stack_size = 20,
burnt_result = "empty-canister",
icons = du.icons("empty-canister"):add_icons(du.get_icons(fluid)),
}
local canister_recipe = {
type = "recipe",
name = fluid.name.."-canister-filling",
localised_name = {"label.canister-filling", {"fluid-name."..fluid.name}},
category = "crafting-with-fluid",
energy_required = 1,
enabled = false,
ingredients = {
{type="item", name="empty-canister", amount=1},
{type="fluid", name=fluid.name, amount=10},
},
results = {{type="item", name=canister_name, amount=1}}
}
data:extend({canister_item, canister_recipe})
local canister_tech = data.raw.technology.canisters
table.insert(canister_tech.effects, {type="unlock-recipe", recipe=canister_recipe.name})
::continue::
end
table.insert(data.raw.technology.canisters.effects, {type="unlock-recipe", recipe="oxygen-canister-filling"})