fusion-lab/data.lua

changeset 19
adbc5c74f279
parent 10
101603241531
--- a/fusion-lab/data.lua	Wed Jul 23 16:08:55 2025 +0300
+++ b/fusion-lab/data.lua	Wed Aug 27 10:26:12 2025 +0300
@@ -7,6 +7,8 @@
 	},
 }
 
+local nuclear_reactor = data.raw.reactor["nuclear-reactor"]
+
 data:extend{
 	{
 		type = "item",
@@ -14,9 +16,9 @@
 		icon = "__fusion-lab__/graphics/icons/photometric-lab-icon.png",
 		subgroup = "production-machine",
 		order = "z[lab]b[fusion-lab]",
-		inventory_move_sound = data.raw.lab.lab.inventory_move_sound,
-		pick_sound = data.raw.item["fusion-reactor"].pick_sound,
-		drop_sound = data.raw.item["fusion-reactor"].drop_sound,
+		inventory_move_sound = table.deepcopy(data.raw.item.lab.inventory_move_sound),
+		pick_sound = table.deepcopy(data.raw.item.lab.pick_sound),
+		drop_sound = table.deepcopy(data.raw.item.lab.drop_sound),
 		place_result = "fusion-lab",
 		weight = 200 * kg,
 		stack_size = 5,
@@ -106,7 +108,6 @@
 			-- it's a space age ensemble!
 			sound =
 			{
-				-- filename = "__space-age__/sound/entity/fusion/fusion-reactor.ogg",
 				filename = "__space-age__/sound/entity/tesla-turret/tesla-turret-rotation-loop.ogg",
 				volume = 0.65,
 				max_sounds_per_prototype = 2,
@@ -134,59 +135,54 @@
 		close_sound = { filename = "__base__/sound/open-close/lab-close.ogg", volume = 0.6 },
 		energy_source = table.deepcopy(data.raw['fusion-reactor']['fusion-reactor'].burner),
 		energy_usage = "1MW",
-		researching_speed = settings.startup["fusion-lab-researching-speed"].value,
-		module_slots = settings.startup["fusion-lab-module-slots"].value,
+		researching_speed = tonumber(settings.startup["fusion-lab-researching-speed"].value),
+		module_slots = tonumber(settings.startup["fusion-lab-module-slots"].value),
 		inputs = table.deepcopy(data.raw.lab.biolab.inputs),
-		science_pack_drain_rate_percent = settings.startup["fusion-lab-drain-rate-percent"].value,
+		science_pack_drain_rate_percent = tonumber(settings.startup["fusion-lab-drain-rate-percent"].value),
 		icons_positioning = data.raw.lab.biolab.icons_positioning,
 	},
 	{
-		type = "heat-interface",
+		type = "reactor",
 		name = "fusion-lab-heat-interface",
 		icon = "__base__/graphics/icons/heat-interface.png",
-		flags = {"placeable-player", "not-on-map", "not-flammable", "not-blueprintable", "not-deconstructable"},
+		flags = {
+			"placeable-player",
+			"not-on-map",
+			"not-flammable",
+			"not-blueprintable",
+			"not-deconstructable",
+			"no-automated-item-insertion",
+		},
 		placeable_by = {item = "fusion-lab", count = 1},
 		collision_mask = {layers={}},
 		selection_priority = 150,
 		hidden = true,
+		energy_source = {type="void"},
+		consumption = "0.001W",
 		factoriopedia_alternative = "fusion-lab",
 		max_health = 200,
 		corpse = "small-remnants",
-		collision_box = data.raw.lab.biolab.collision_box, -- 5×5
-		selection_box = data.raw.lab.lab.selection_box, -- 3×3
-		gui_mode = "none", -- all, none, admins
+		collision_box = table.deepcopy(data.raw.lab.biolab.collision_box),
+		selection_box = {{-2.5, 0.5}, {-0.5, 2.5}},
 		open_sound = data.raw["fusion-reactor"]["fusion-reactor"].open_sound,
 		close_sound = data.raw["fusion-reactor"]["fusion-reactor"].close_sound,
+		lower_layer_picture = table.deepcopy(nuclear_reactor.lower_layer_picture),
+		heat_lower_layer_picture = table.deepcopy(nuclear_reactor.heat_lower_layer_picture),
+		connection_patches_connected = table.deepcopy(nuclear_reactor.connection_patches_connected),
+		connection_patches_disconnected = table.deepcopy(nuclear_reactor.connection_patches_disconnected),
+		heat_connection_patches_connected = table.deepcopy(nuclear_reactor.heat_connection_patches_connected),
+		heat_connection_patches_disconnected = table.deepcopy(nuclear_reactor.heat_connection_patches_disconnected),
+		--circuit_connector = table.deepcopy(data.raw["rocket-silo"]["rocket-silo"].circuit_connector),
+		circuit_wire_max_distance = nuclear_reactor.circuit_wire_max_distance,
 		heat_buffer =
 		{
 			max_temperature = 1000,
-			specific_heat = "1MJ",
+			specific_heat = "10MJ",
 			max_transfer = "1GW",
 			default_temperature = 15,
 			min_working_temperature = 15,
-			pipe_covers = data.raw.boiler["heat-exchanger"].energy_source.pipe_covers,
-			heat_pipe_covers = data.raw.boiler["heat-exchanger"].energy_source.heat_pipe_covers,
-			connections =
-			{
-				{position = { 2, -2}, direction = defines.direction.north},
-				{position = {-2, -2}, direction = defines.direction.north},
-				{position = { 2,	2}, direction = defines.direction.south},
-				{position = {-2,	2}, direction = defines.direction.south},
-				{position = { 2, -2}, direction = defines.direction.east},
-				{position = { 2,	2}, direction = defines.direction.east},
-				{position = {-2, -2}, direction = defines.direction.west},
-				{position = {-2,	2}, direction = defines.direction.west},
-			}
+			connections = table.deepcopy(nuclear_reactor.heat_buffer.connections),
 		},
-		picture =
-		{
-			filename = "__base__/graphics/entity/nuclear-reactor/reactor-pipes.png",
-			height = 316,
-			width = 320,
-			scale = 0.5,
-			flags = {"no-crop"},
-			shift = util.by_pixel(-1, -5)
-		}
 	},
 	{
 		type = "item",

mercurial