-
Notifications
You must be signed in to change notification settings - Fork 3
/
modinterface.lua
192 lines (171 loc) · 5.91 KB
/
modinterface.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
require "config"
require "constants"
if data.raw.item.glass then
table.insert(data.raw.recipe.greenhouse.ingredients, {"glass", 30})
end
local function createDeadName(name)
return {"dead-farm.name", {"entity-name." .. name}}
end
if data.raw.resource["crude-oil-sand"] then
data:extend({{type = "resource-category", name = "oil-fracking"}})
data.raw.resource["crude-oil-sand"].category = "oil-fracking"
local newpump = table.deepcopy(data.raw["mining-drill"]["pumpjack"])
newpump.name = "fracking-well"
newpump.minable.result = "fracking-well"
newpump.resource_categories = {"oil-fracking"}
newpump.energy_source.emissions_per_minute = newpump.energy_source.emissions_per_minute*9
--[[
local dirs = {"north", "south", "west", "east"}
for _,dir in pairs(dirs) do
newpump.animations[dir].layers[1].filename = "__NauvisDay__/graphics/entity/fracking-well.png"
newpump.animations[dir].layers[1].hr_version.filename = "__NauvisDay__/graphics/entity/fracking-well.png"
end
--]]
local item = table.deepcopy(data.raw.item["pumpjack"])
item.name = newpump.name
item.place_result = item.name
local recipe = table.deepcopy(data.raw.recipe["pumpjack"])
recipe.name = newpump.name
recipe.result = newpump.name
data:extend({newpump, item, recipe})
table.insert(data.raw.technology["fracking"].effects, {type = "unlock-recipe", recipe = recipe.name})
--Copy his fluidpatch from pumpjack to fracking well
local fluid_inputs = {}
for k,v in pairs(data.raw["mining-drill"]["electric-mining-drill"]) do
if string.find(k, "input_fluid") then
fluid_inputs[k] = table.deepcopy(v)
end
end
if not newpump.input_fluid_box then
for k, v in pairs(fluid_inputs) do
newpump[k] = v
end
end
end
if data.raw["assembling-machine"]["bi_bio_farm"] then
local dead = table.deepcopy(data.raw["assembling-machine"]["bi_bio_farm"])
dead.name = "dead-bio-farm"
dead.crafting_speed = 0.001
dead.order = "z"
dead.energy_source =
{
type = "burner",
fuel_category = "chemical",
effectivity = 0.05,
fuel_inventory_size = 0,
burnt_inventory_size = 0,
emissions_per_minute = 40,
render_no_power_icon = false,
}
dead.animation.filename = "__NauvisDay__/graphics/entity/treefarm/dead-biofarm.png"
dead.working_visualisations.animation.filename ="__NauvisDay__/graphics/entity/treefarm/dead-biofarm-active.png"
dead.working_visualisations.light = nil
dead.localised_name = createDeadName("bi_bio_farm")
data:extend({dead})
end
if data.raw["assembling-machine"]["bob-greenhouse"] then
local dead = table.deepcopy(data.raw["assembling-machine"]["bob-greenhouse"])
dead.name = "dead-greenhouse"
dead.crafting_speed = 0.001
dead.order = "z"
dead.energy_source =
{
type = "burner",
fuel_category = "chemical",
effectivity = 0.05,
fuel_inventory_size = 0,
burnt_inventory_size = 0,
emissions_per_minute = 40,
render_no_power_icon = false,
}
dead.animation.filename = "__NauvisDay__/graphics/entity/treefarm/dead-greenhouse.png"
dead.working_visualisations[1].animation.filename = "__NauvisDay__/graphics/entity/treefarm/dead-greenhouse-active.png"
dead.working_visualisations[1].light = nil
dead.animation.width = 113
dead.animation.height = 91
dead.animation.frame_count = 1
dead.animation.line_length = 1
dead.animation.shift = nil
dead.working_visualisations[1].animation.width = 113
dead.working_visualisations[1].animation.height = 91
dead.working_visualisations[1].animation.frame_count = 1
dead.working_visualisations[1].animation.line_length = 1
dead.working_visualisations[1].animation.shift = nil
dead.localised_name = createDeadName("bob-greenhouse")
data:extend({dead})
end
if data.raw.tree["tf-germling"] then
data:extend({
{
type = "simple-entity",
name = "dead-tf-tree",
icon = "__base__/graphics/icons/tree-01-stump.png",
flags = {"placeable-neutral", "not-on-map"},
minable = {mining_time = 2, result=nil},
collision_box = {{-0.7*0.75, -0.8*0.75}, {0.7*0.75, 0.8*0.75}},
selection_box = {{-0.8*0.75, -2.2*0.75}, {0.8*0.75, 0.8*0.75}},
tile_width = 1,
tile_height = 1,
--selectable_in_game = false,
--time_before_removed = 60 * 60 * 15, -- 15 minutes
final_render_layer = "object",
render_layer = "object",
subgroup = "remnants",
order="d[remnants]-b[tree]",
localised_name = {"entity-name.dead-tree"},
pictures = {
{
filename = "__NauvisDay__/graphics/entity/treefarm/dead-tree-01.png",
priority = "extra-high",
width = math.floor(155*0.75),
height = math.floor(118*0.75),
shift = {1.1*0.75, -1*0.75},
frame_count = 1,
direction_count = 1,
},
{
filename = "__NauvisDay__/graphics/entity/treefarm/dead-tree-05.png",
priority = "extra-high",
width = math.floor(156*0.75),
height = math.floor(154*0.75),
shift = {1.5*0.75, -1.7*0.75},
frame_count = 1,
direction_count = 1,
},
{
filename = "__NauvisDay__/graphics/entity/treefarm/dead-tree-06.png",
priority = "extra-high",
width = math.floor(113*0.75),
height = math.floor(111*0.75),
shift = {0.7*0.75, -0.9*0.75},
frame_count = 1,
direction_count = 1,
}
}
}
})
end
if Config.enableSteamFurnace and data.raw.item["stone-pipe"] then
data:extend({
{
type = "recipe",
name = "steam-furnace-2",
energy_required = 3.5,
enabled = "false",
ingredients = {
{"steel-furnace", 1},
{"stone-pipe", 8},
{"pipe", 2},
{"stone", 5},
},
result = "steam-furnace",
}
})
local rec = createConversionRecipe("stone-furnace", "steam-furnace-2", false, nil, true)
rec.enabled = false
rec.name = "stone-to-steam-furnace-2"
rec.energy_required = data.raw.recipe["steam-furnace"].energy_required
data:extend({rec})
table.insert(data.raw.technology["advanced-material-processing"].effects, {type="unlock-recipe", recipe="steam-furnace-2"})
table.insert(data.raw.technology["advanced-material-processing"].effects, {type="unlock-recipe", recipe=rec.name})
end