fusion-lab/data.lua

changeset 10
101603241531
equal deleted inserted replaced
9:b0f85ff1a503 10:101603241531
1 local fluoro_heat_exchanger_icons = {
2 {icon = data.raw.boiler['heat-exchanger'].icon},
3 {
4 icon = data.raw.fluid['fluoroketone-cold'].icon,
5 scale = 0.3,
6 shift = {-8, -8},
7 },
8 }
9
10 data:extend{
11 {
12 type = "item",
13 name = "fusion-lab",
14 icon = "__fusion-lab__/graphics/icons/photometric-lab-icon.png",
15 subgroup = "production-machine",
16 order = "z[lab]b[fusion-lab]",
17 inventory_move_sound = data.raw.lab.lab.inventory_move_sound,
18 pick_sound = data.raw.item["fusion-reactor"].pick_sound,
19 drop_sound = data.raw.item["fusion-reactor"].drop_sound,
20 place_result = "fusion-lab",
21 weight = 200 * kg,
22 stack_size = 5,
23 default_import_location = "aquilo"
24 },
25 {
26 type = "recipe",
27 name = "fusion-lab",
28 category = data.raw.recipe['fusion-reactor'].category,
29 subgroup = data.raw.recipe.lab.subgroup,
30 order = "x[fusion-lab]",
31 enabled = false,
32 energy_required = data.raw.recipe.biolab.energy_required,
33 ingredients =
34 {
35 {type = "item", name = "lab", amount = 1},
36 {type = "item", name = "refined-concrete", amount = 25},
37 {type = "item", name = "tungsten-plate", amount = 50},
38 {type = "item", name = "holmium-plate", amount = 50},
39 {type = "item", name = "quantum-processor", amount = 50},
40 },
41 results = {
42 {type = "item", name = "fusion-lab", amount = 1},
43 },
44 surface_conditions = table.deepcopy(data.raw.recipe['fusion-reactor'].surface_conditions),
45 allow_productivity = false,
46 },
47 {
48 type = "lab",
49 name = "fusion-lab",
50 selection_priority = 100,
51 icon = "__fusion-lab__/graphics/icons/photometric-lab-icon.png",
52 flags = {"placeable-player", "player-creation"},
53 minable = {mining_time = 0.2, result = "fusion-lab"},
54 max_health = 350,
55 corpse = "cargo-bay-remnants",
56 dying_explosion = "lab-explosion",
57 collision_box = data.raw.lab.biolab.collision_box, -- 5×5
58 selection_box = data.raw.lab.biolab.selection_box, -- 5×5
59 damaged_trigger_effect = data.raw.lab.lab.damaged_trigger_effect,
60 surface_conditions = table.deepcopy(data.raw.container['steel-chest'].surface_conditions),
61 on_animation =
62 {
63 layers =
64 {
65 util.sprite_load("__fusion-lab__/graphics/entity/fusion-lab/photometric-lab-hr-shadow", {
66 frame_count = 1,
67 scale = 0.5,
68 repeat_count = 80,
69 animation_speed = 0.4,
70 draw_as_shadow = true,
71 }),
72 util.sprite_load("__fusion-lab__/graphics/entity/fusion-lab/photometric-lab-hr-animation", {
73 frame_count = 80,
74 animation_speed = 0.4,
75 scale = 0.5
76 }),
77 util.sprite_load("__fusion-lab__/graphics/entity/fusion-lab/photometric-lab-hr-emission", {
78 frame_count = 80,
79 animation_speed = 0.4,
80 scale = 0.5,
81 blend_mode = "additive",
82 draw_as_glow = true,
83 }),
84 }
85 },
86 off_animation =
87 {
88 layers =
89 {
90 util.sprite_load("__fusion-lab__/graphics/entity/fusion-lab/photometric-lab-hr-shadow", {
91 frame_count = 1,
92 scale = 0.5,
93 repeat_count = 80,
94 animation_speed = 0.4,
95 draw_as_shadow = true,
96 }),
97 util.sprite_load("__fusion-lab__/graphics/entity/fusion-lab/photometric-lab-hr-animation", {
98 frame_count = 80,
99 animation_speed = 0.4,
100 scale = 0.5
101 }),
102 }
103 },
104 working_sound =
105 {
106 -- it's a space age ensemble!
107 sound =
108 {
109 -- filename = "__space-age__/sound/entity/fusion/fusion-reactor.ogg",
110 filename = "__space-age__/sound/entity/tesla-turret/tesla-turret-rotation-loop.ogg",
111 volume = 0.65,
112 max_sounds_per_prototype = 2,
113 },
114 fade_in_ticks = 4,
115 fade_out_ticks = 20,
116 sound_accents =
117 {
118 {sound = {filename = "__space-age__/sound/entity/foundry/foundry-slide-open.ogg", volume = 0.65, audible_distance_modifier = 0.3}, frame = 3},
119 {sound = {filename = "__space-age__/sound/entity/foundry/foundry-slide-close.ogg", volume = 0.65, audible_distance_modifier = 0.3}, frame = 34},
120 {sound = {variations = sound_variations("__quality__/sound/recycler/recycler-mechanic", 3, 0.85), audible_distance_modifier = 0.3}, frame = 16},
121 {sound = {variations = sound_variations("__quality__/sound/recycler/recycler-mechanic", 3, 0.85), audible_distance_modifier = 0.3}, frame = 41},
122 {sound = {variations = sound_variations("__quality__/sound/recycler/recycler-jaw-shut", 3, 0.35), audible_distance_modifier = 0.3}, frame = 24},
123 {sound = {variations = sound_variations("__quality__/sound/recycler/recycler-jaw-shut", 3, 0.45), audible_distance_modifier = 0.3}, frame = 64},
124 {sound = {variations = sound_variations("__space-age__/sound/entity/electromagnetic-plant/emp-electric", 5, 0.5), audible_distance_modifier = 0.4, }, frame = 6 - 5},
125 {sound = {variations = sound_variations("__space-age__/sound/entity/electromagnetic-plant/emp-electric", 5, 0.5), audible_distance_modifier = 0.4, }, frame = 56 - 5},
126 {sound = {filename = "__space-age__/sound/entity/tesla-turret/tesla-turret-rotation-stop.ogg", volume = 0.8, audible_distance_modifier = 0.6}, frame = 8},
127 {sound = {filename = "__space-age__/sound/entity/tesla-turret/tesla-turret-rotation-stop.ogg", volume = 0.8, audible_distance_modifier = 0.6}, frame = 44},
128 {sound = {variations = sound_variations("__space-age__/sound/entity/biolab/biolab-beaker", 7, 0.95), audible_distance_modifier = 0.6}, frame = 20},
129 },
130 max_sounds_per_prototype = 2
131 },
132 impact_category = "glass",
133 open_sound = { filename = "__base__/sound/open-close/lab-open.ogg", volume = 0.6 },
134 close_sound = { filename = "__base__/sound/open-close/lab-close.ogg", volume = 0.6 },
135 energy_source = table.deepcopy(data.raw['fusion-reactor']['fusion-reactor'].burner),
136 energy_usage = "1MW",
137 researching_speed = settings.startup["fusion-lab-researching-speed"].value,
138 module_slots = settings.startup["fusion-lab-module-slots"].value,
139 inputs = table.deepcopy(data.raw.lab.biolab.inputs),
140 science_pack_drain_rate_percent = settings.startup["fusion-lab-drain-rate-percent"].value,
141 icons_positioning = data.raw.lab.biolab.icons_positioning,
142 },
143 {
144 type = "heat-interface",
145 name = "fusion-lab-heat-interface",
146 icon = "__base__/graphics/icons/heat-interface.png",
147 flags = {"placeable-player", "not-on-map", "not-flammable", "not-blueprintable", "not-deconstructable"},
148 placeable_by = {item = "fusion-lab", count = 1},
149 collision_mask = {layers={}},
150 selection_priority = 150,
151 hidden = true,
152 factoriopedia_alternative = "fusion-lab",
153 max_health = 200,
154 corpse = "small-remnants",
155 collision_box = data.raw.lab.biolab.collision_box, -- 5×5
156 selection_box = data.raw.lab.lab.selection_box, -- 3×3
157 gui_mode = "none", -- all, none, admins
158 open_sound = data.raw["fusion-reactor"]["fusion-reactor"].open_sound,
159 close_sound = data.raw["fusion-reactor"]["fusion-reactor"].close_sound,
160 heat_buffer =
161 {
162 max_temperature = 1000,
163 specific_heat = "1MJ",
164 max_transfer = "1GW",
165 default_temperature = 15,
166 min_working_temperature = 15,
167 pipe_covers = data.raw.boiler["heat-exchanger"].energy_source.pipe_covers,
168 heat_pipe_covers = data.raw.boiler["heat-exchanger"].energy_source.heat_pipe_covers,
169 connections =
170 {
171 {position = { 2, -2}, direction = defines.direction.north},
172 {position = {-2, -2}, direction = defines.direction.north},
173 {position = { 2, 2}, direction = defines.direction.south},
174 {position = {-2, 2}, direction = defines.direction.south},
175 {position = { 2, -2}, direction = defines.direction.east},
176 {position = { 2, 2}, direction = defines.direction.east},
177 {position = {-2, -2}, direction = defines.direction.west},
178 {position = {-2, 2}, direction = defines.direction.west},
179 }
180 },
181 picture =
182 {
183 filename = "__base__/graphics/entity/nuclear-reactor/reactor-pipes.png",
184 height = 316,
185 width = 320,
186 scale = 0.5,
187 flags = {"no-crop"},
188 shift = util.by_pixel(-1, -5)
189 }
190 },
191 {
192 type = "item",
193 name = "fluoro-heat-exchanger",
194 icons = fluoro_heat_exchanger_icons,
195 subgroup = "energy",
196 order = "f[nuclear-energy]-d[fluoro-heat-exchanger]",
197 inventory_move_sound = data.raw.item["heat-exchanger"].inventory_move_sound,
198 pick_sound = data.raw.item["heat-exchanger"].pick_sound,
199 drop_sound = data.raw.item["heat-exchanger"].drop_sound,
200 place_result = "fluoro-heat-exchanger",
201 stack_size = 50,
202 weight = 40*kg,
203 random_tint_color = data.raw.item["heat-exchanger"].random_tint_color,
204 },
205 {
206 type = "technology",
207 name = "fusion-lab",
208 icon = "__fusion-lab__/graphics/technology/fusion-lab.png",
209 icon_size = 256,
210 effects =
211 {
212 {
213 type = "unlock-recipe",
214 recipe = "fusion-lab"
215 },
216 {
217 type = "unlock-recipe",
218 recipe = "fluoro-heat-exchanger"
219 },
220 },
221 prerequisites = {"fusion-reactor"},
222 unit =
223 {
224 count_formula = "1000",
225 ingredients = table.deepcopy(data.raw.technology["fusion-reactor"].unit.ingredients),
226 time = 60
227 }
228 },
229 {
230 type = "recipe",
231 name = "fluoro-heat-exchanger",
232 category = "crafting",
233 subgroup = data.raw.recipe["heat-exchanger"].subgroup,
234 order = "zzz[fluoro-heat-exchanger]",
235 enabled = false,
236 energy_required = data.raw.recipe["heat-exchanger"].energy_required,
237 ingredients = data.raw.recipe["heat-exchanger"].ingredients,
238 results = {
239 {type = "item", name = "fluoro-heat-exchanger", amount = 1},
240 },
241 allow_productivity = false,
242 },
243 }
244
245 local fluoro_heat_exchanger = table.deepcopy(data.raw.boiler["heat-exchanger"])
246 fluoro_heat_exchanger.name = "fluoro-heat-exchanger"
247 fluoro_heat_exchanger.icon = nil
248 fluoro_heat_exchanger.icons = fluoro_heat_exchanger_icons
249 fluoro_heat_exchanger.fluid_box.filter = "fluoroketone-cold"
250 fluoro_heat_exchanger.output_fluid_box.filter = "fluoroketone-hot"
251 fluoro_heat_exchanger.minable.result = "fluoro-heat-exchanger"
252 fluoro_heat_exchanger.energy_source.min_working_temperature = 180
253 fluoro_heat_exchanger.target_temperature = 180
254 data:extend{fluoro_heat_exchanger}
255
256 local smoke_source = table.deepcopy(data.raw["particle-source"]["nuclear-smouldering-smoke-source"])
257 smoke_source.name = "fusion-lab-smoke-source"
258 smoke_source.time_before_start = 0
259 smoke_source.time_before_start_deviation = 0
260 smoke_source.time_to_live = 31
261 smoke_source.time_to_live_deviation = 0
262 smoke_source.height = 0.8
263 smoke_source.smoke[1].frequency = 0.5
264 data:extend{smoke_source}
265
266 -- TODO: replace the fusion-lab-heat-interface with this, once I figure out how
267 -- to change its "consumption" (i.e. power output) during runtime...
268 --[[
269 local void_reactor = table.deepcopy(data.raw.reactor['nuclear-reactor'])
270 void_reactor.name = "void-reactor"
271 void_reactor.energy_source = {type = "void"}
272 void_reactor.minable = nil
273 void_reactor.consumption = "660kW"
274 void_reactor.neighbour_bonus = 0
275 void_reactor.surface_conditions = nil
276 void_reactor.picture = nil
277 void_reactor.light = nil
278 void_reactor.working_light_picture = nil
279 data:extend{void_reactor}
280 ]]--
281
282 local fusion_lab_menu_simulation = {
283 checkboard = false,
284 save = '__fusion-lab__/menu-simulations/menu-simulation-fusion-lab.zip',
285 length = 60 * 14,
286 init =
287 [[
288 local sim_planet = game.surfaces.fulgora
289 local logo = sim_planet.find_entities_filtered{name = "factorio-logo-11tiles", limit = 1}[1]
290 logo.destructible = false
291 local center = {logo.position.x, logo.position.y+9.75}
292 game.simulation.camera_surface_index = sim_planet.index
293 game.simulation.camera_position = center
294 game.simulation.camera_zoom = 1
295 game.tick_paused = false
296 require("__fusion-lab__.menu-simulations.menu-simulation-fusion-lab")
297 ]]
298 }
299
300 -- data.raw["utility-constants"]["default"].main_menu_simulations = {}
301 data.raw["utility-constants"]["default"].main_menu_simulations["fusion-lab"] = fusion_lab_menu_simulation

mercurial