Skip to content

Commit c17881a

Browse files
reactor circuit connections
1 parent 330d1f0 commit c17881a

File tree

1 file changed

+56
-33
lines changed

1 file changed

+56
-33
lines changed

prototypes/entity/entities.lua

+56-33
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
require "util"
1+
require("util")
2+
require("circuit-connector-sprites")
23

34
data:extend({
45
{
5-
type = 'reactor',
6-
name = 'MOX-reactor',
7-
icon = '__PlutoniumEnergy__/graphics/icons/MOX-reactor.png',
8-
icon_size = 64,
9-
icon_mipmaps = 4,
10-
flags = { 'placeable-neutral', 'player-creation' },
11-
minable = { mining_time = 0.5, result = 'MOX-reactor' },
12-
max_health = 400,
13-
corpse = 'MOX-reactor-remnants',
14-
dying_explosion = 'nuclear-reactor-explosion',
15-
consumption = '20MW',
16-
neighbour_bonus = 1.5,
17-
energy_source = {
6+
type = 'reactor',
7+
name = 'MOX-reactor',
8+
icon = '__PlutoniumEnergy__/graphics/icons/MOX-reactor.png',
9+
flags = { 'placeable-neutral', 'player-creation' },
10+
minable = { mining_time = 0.5, result = 'MOX-reactor' },
11+
max_health = 400,
12+
corpse = 'MOX-reactor-remnants',
13+
dying_explosion = 'nuclear-reactor-explosion',
14+
consumption = '20MW',
15+
neighbour_bonus = 1.5,
16+
energy_source = {
1817
type = 'burner',
1918
fuel_categories = { 'MOX' },
2019
effectivity = 1,
@@ -26,25 +25,25 @@ data:extend({
2625
maximum_intensity = 0.95
2726
}
2827
},
29-
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
30-
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
31-
damaged_trigger_effect = data.raw['reactor']['nuclear-reactor'].damaged_trigger_effect,
32-
lower_layer_picture = {
28+
collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } },
29+
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
30+
damaged_trigger_effect = data.raw['reactor']['nuclear-reactor'].damaged_trigger_effect,
31+
lower_layer_picture = {
3332
filename = '__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-pipes.png',
3433
width = 192,
3534
height = 188,
3635
scale = 0.5,
3736
shift = util.by_pixel(-1, -5)
3837
},
39-
heat_lower_layer_picture = apply_heat_pipe_glow {
38+
heat_lower_layer_picture = apply_heat_pipe_glow {
4039
filename = '__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-pipes-heated.png',
4140
width = 192,
4241
height = 188,
4342
scale = 0.5,
4443
shift = util.by_pixel(-0.5, -4.5)
4544
},
4645

47-
picture = {
46+
picture = {
4847
layers = {
4948
{
5049
filename = '__base__/graphics/entity/nuclear-reactor/reactor.png',
@@ -64,7 +63,7 @@ data:extend({
6463
}
6564
},
6665

67-
working_light_picture = {
66+
working_light_picture = {
6867
filename = '__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-lights-color.png',
6968
blend_mode = 'additive',
7069
draw_as_glow = true,
@@ -74,7 +73,7 @@ data:extend({
7473
shift = { -0.03125, -0.1875 }
7574
},
7675

77-
heat_buffer = {
76+
heat_buffer = {
7877
max_temperature = 1000,
7978
specific_heat = '10MJ',
8079
max_transfer = '10GW',
@@ -121,7 +120,7 @@ data:extend({
121120
shift = util.by_pixel(-2, -16)
122121
}
123122
},
124-
connection_patches_connected = {
123+
connection_patches_connected = {
125124
sheet = {
126125
filename = '__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-connect-patches.png',
127126
width = 64,
@@ -130,7 +129,7 @@ data:extend({
130129
variation_count = 8,
131130
}
132131
},
133-
connection_patches_disconnected = {
132+
connection_patches_disconnected = {
134133
sheet = {
135134
filename = '__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-connect-patches.png',
136135
width = 64,
@@ -140,7 +139,7 @@ data:extend({
140139
scale = 0.5
141140
}
142141
},
143-
heat_connection_patches_connected = {
142+
heat_connection_patches_connected = {
144143
sheet = apply_heat_pipe_glow {
145144
filename =
146145
'__PlutoniumEnergy__/graphics/entity/MOX-reactor/MOX-reactor-connect-patches-heated.png',
@@ -162,18 +161,29 @@ data:extend({
162161
}
163162
},
164163

165-
vehicle_impact_sound = data.raw['reactor']['nuclear-reactor'].vehicle_impact_sound,
166-
open_sound = data.raw['reactor']['nuclear-reactor'].open_sound,
167-
close_sound = data.raw['reactor']['nuclear-reactor'].close_sound,
168-
working_sound = data.raw['reactor']['nuclear-reactor'].working_sound,
169-
meltdown_action = data.raw['reactor']['nuclear-reactor'].meltdown_action
164+
impact_category = "metal-large",
165+
vehicle_impact_sound = data.raw['reactor']['nuclear-reactor'].vehicle_impact_sound,
166+
open_sound = data.raw['reactor']['nuclear-reactor'].open_sound,
167+
close_sound = data.raw['reactor']['nuclear-reactor'].close_sound,
168+
working_sound = data.raw['reactor']['nuclear-reactor'].working_sound,
169+
meltdown_action = data.raw['reactor']['nuclear-reactor'].meltdown_action,
170+
171+
default_temperature_signal = data.raw['reactor']['nuclear-reactor'].default_temperature_signal,
172+
circuit_wire_max_distance = data.raw['reactor']['nuclear-reactor'].circuit_wire_max_distance,
173+
circuit_connector = circuit_connector_definitions.create_single(
174+
universal_connector_template,
175+
{
176+
variation = 27,
177+
main_offset = util.by_pixel(40 * 0.6, 40 * 0.6),
178+
shadow_offset = util.by_pixel(45 * 0.6, 54.5 * 0.6),
179+
show_shadow = false
180+
}
181+
)
170182
},
171183
{
172184
type = 'reactor',
173185
name = 'breeder-reactor',
174186
icon = '__PlutoniumEnergy__/graphics/icons/breeder-reactor.png',
175-
icon_size = 64,
176-
icon_mipmaps = 4,
177187
flags = { 'placeable-neutral', 'player-creation' },
178188
minable = { mining_time = 0.5, result = 'breeder-reactor' },
179189
max_health = 750,
@@ -364,10 +374,23 @@ data:extend({
364374
}
365375
},
366376

377+
impact_category = "metal-large",
367378
vehicle_impact_sound = data.raw['reactor']['nuclear-reactor'].vehicle_impact_sound,
368379
open_sound = data.raw['reactor']['nuclear-reactor'].open_sound,
369380
close_sound = data.raw['reactor']['nuclear-reactor'].close_sound,
370381
working_sound = data.raw['reactor']['nuclear-reactor'].working_sound,
371-
meltdown_action = data.raw['reactor']['nuclear-reactor'].meltdown_action
382+
meltdown_action = data.raw['reactor']['nuclear-reactor'].meltdown_action,
383+
384+
default_temperature_signal = data.raw['reactor']['nuclear-reactor'].default_temperature_signal,
385+
circuit_wire_max_distance = data.raw['reactor']['nuclear-reactor'].circuit_wire_max_distance,
386+
circuit_connector = circuit_connector_definitions.create_single(
387+
universal_connector_template,
388+
{
389+
variation = 27,
390+
main_offset = util.by_pixel(40 * 1.4, 40 * 1.4),
391+
shadow_offset = util.by_pixel(45 * 1.4, 54.5 * 1.4),
392+
show_shadow = false
393+
}
394+
)
372395
}
373396
})

0 commit comments

Comments
 (0)