Advertisement
PLaSoft

intergalactic-transceiver.lua

Aug 25th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.39 KB | None | 0 0
  1. local hit_effects = require("__base__/prototypes/entity/hit-effects")
  2. local sounds = require("__base__/prototypes/entity/sounds")
  3.  
  4. data:extend(
  5. {
  6. {
  7. type = "recipe",
  8. name = "kee-intergalactic-transceiver-loading",
  9. energy_required = 1800,
  10. enabled = false,
  11. ingredients =
  12. {
  13. {"imersium-beam", 500},
  14. {"imersium-plate", 500},
  15. {"rare-metals", 1000},
  16. {"energy-control-unit", 500},
  17. {"ai-core", 300},
  18. {"concrete", 750}
  19. },
  20. result = "kee-intergalactic-transceiver-loading"
  21. }
  22. })
  23.  
  24. data:extend(
  25. {
  26. {
  27. type = "item",
  28. name = "kee-intergalactic-transceiver-loading",
  29. icon = "__Krastorio2Assets__/icons/entities/intergalactic-transceiver.png",
  30. icon_size = 64,
  31. subgroup = "radars-and-rockets",
  32. order = "zzz[rocket-silo]-zzzz[intergalactic-transceiver]",
  33. place_result = "kee-intergalactic-transceiver-loading",
  34. stack_size = 1
  35. }
  36. })
  37.  
  38. local intergalactic_transceiver_animation = {
  39. layers = {
  40. {
  41. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver.png",
  42. width = 400,
  43. height = 400,
  44. frame_count = 1,
  45. repeat_count = 60,
  46. shift = { 0, -0.8 },
  47. animation_speed = 0.3447,
  48. hr_version = {
  49. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver.png",
  50. width = 800,
  51. height = 800,
  52. scale = 0.5,
  53. frame_count = 1,
  54. repeat_count = 60,
  55. animation_speed = 0.3447,
  56. shift = { 0, -0.8 },
  57. },
  58. },
  59. {
  60. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-sh.png",
  61. priority = "low",
  62. width = 434,
  63. height = 313,
  64. frame_count = 1,
  65. repeat_count = 60,
  66. draw_as_shadow = true,
  67. animation_speed = 0.3447,
  68. shift = { 0.52, 0.5 },
  69. hr_version = {
  70. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-sh.png",
  71. priority = "low",
  72. width = 867,
  73. height = 626,
  74. scale = 0.5,
  75. frame_count = 1,
  76. repeat_count = 60,
  77. draw_as_shadow = true,
  78. animation_speed = 0.3447,
  79. shift = { 0.52, 0.5 },
  80. },
  81. },
  82. {
  83. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-charging.png",
  84. priority = "high",
  85. width = 400,
  86. height = 400,
  87. frame_count = 60,
  88. line_length = 10,
  89. animation_speed = 0.3447,
  90. shift = { 0, -0.8 },
  91. draw_as_glow = true,
  92. hr_version = {
  93. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-charging.png",
  94. priority = "high",
  95. width = 800,
  96. height = 800,
  97. scale = 0.5,
  98. frame_count = 60,
  99. line_length = 10,
  100. animation_speed = 0.3447,
  101. shift = { 0, -0.8 },
  102. draw_as_glow = true,
  103. },
  104. },
  105. {
  106. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-light.png",
  107. priority = "high",
  108. width = 400,
  109. height = 400,
  110. frame_count = 1,
  111. repeat_count = 60,
  112. shift = { 0, -0.8 },
  113. draw_as_light = true,
  114. animation_speed = 0.3447,
  115. hr_version = {
  116. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-light.png",
  117. priority = "high",
  118. width = 800,
  119. height = 800,
  120. scale = 0.5,
  121. frame_count = 1,
  122. repeat_count = 60,
  123. animation_speed = 0.3447,
  124. shift = { 0, -0.8 },
  125. draw_as_light = true,
  126. },
  127. },
  128. {
  129. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-charging-light.png",
  130. priority = "high",
  131. width = 400,
  132. height = 400,
  133. frame_count = 60,
  134. line_length = 10,
  135. animation_speed = 0.3447,
  136. shift = { 0, -0.8 },
  137. draw_as_light = true,
  138. hr_version = {
  139. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-charging-light.png",
  140. priority = "high",
  141. width = 800,
  142. height = 800,
  143. scale = 0.5,
  144. frame_count = 60,
  145. line_length = 10,
  146. animation_speed = 0.3447,
  147. shift = { 0, -0.8 },
  148. draw_as_light = true,
  149. },
  150. },
  151. },
  152. }
  153.  
  154. local activated_intergalactic_transceiver_animation = {
  155. layers = {
  156. {
  157. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver.png",
  158. width = 400,
  159. height = 400,
  160. frame_count = 1,
  161. repeat_count = 60,
  162. shift = { 0, -0.8 },
  163. animation_speed = 0.3447,
  164. hr_version = {
  165. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver.png",
  166. width = 800,
  167. height = 800,
  168. scale = 0.5,
  169. frame_count = 1,
  170. repeat_count = 60,
  171. animation_speed = 0.3447,
  172. shift = { 0, -0.8 },
  173. },
  174. },
  175. {
  176. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-sh.png",
  177. priority = "low",
  178. width = 434,
  179. height = 313,
  180. frame_count = 1,
  181. repeat_count = 60,
  182. draw_as_shadow = true,
  183. animation_speed = 0.3447,
  184. shift = { 0.52, 0.5 },
  185. hr_version = {
  186. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-sh.png",
  187. priority = "low",
  188. width = 867,
  189. height = 626,
  190. scale = 0.5,
  191. frame_count = 1,
  192. repeat_count = 60,
  193. draw_as_shadow = true,
  194. animation_speed = 0.3447,
  195. shift = { 0.52, 0.5 },
  196. },
  197. },
  198. {
  199. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-charge.png",
  200. priority = "high",
  201. width = 400,
  202. height = 400,
  203. frame_count = 60,
  204. line_length = 10,
  205. animation_speed = 0.3447,
  206. shift = { 0, -0.8 },
  207. draw_as_glow = true,
  208. hr_version = {
  209. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-charge.png",
  210. priority = "high",
  211. width = 800,
  212. height = 800,
  213. scale = 0.5,
  214. frame_count = 60,
  215. line_length = 10,
  216. animation_speed = 0.3447,
  217. shift = { 0, -0.8 },
  218. draw_as_glow = true,
  219. },
  220. },
  221. {
  222. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-light.png",
  223. priority = "high",
  224. width = 400,
  225. height = 400,
  226. frame_count = 1,
  227. repeat_count = 60,
  228. shift = { 0, -0.8 },
  229. draw_as_light = true,
  230. animation_speed = 0.3447,
  231. hr_version = {
  232. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-light.png",
  233. priority = "high",
  234. width = 800,
  235. height = 800,
  236. scale = 0.5,
  237. frame_count = 1,
  238. repeat_count = 60,
  239. animation_speed = 0.3447,
  240. shift = { 0, -0.8 },
  241. draw_as_light = true,
  242. },
  243. },
  244. {
  245. filename = kr_entities_path .. "intergalactic-transceiver/intergalactic-transceiver-charge-light.png",
  246. priority = "high",
  247. width = 400,
  248. height = 400,
  249. frame_count = 60,
  250. line_length = 10,
  251. animation_speed = 0.3447,
  252. shift = { 0, -0.8 },
  253. draw_as_light = true,
  254. hr_version = {
  255. filename = kr_entities_path .. "intergalactic-transceiver/hr-intergalactic-transceiver-charge-light.png",
  256. priority = "high",
  257. width = 800,
  258. height = 800,
  259. scale = 0.5,
  260. frame_count = 60,
  261. line_length = 10,
  262. animation_speed = 0.3447,
  263. shift = { 0, -0.8 },
  264. draw_as_light = true,
  265. },
  266. },
  267. },
  268. }
  269.  
  270.  
  271. local intergalactic_transceiver_working_sound =
  272. {
  273. sound =
  274. {
  275. variations =
  276. {
  277. {
  278. filename = "__Krastorio2Assets__/sounds/buildings/intergalactic-transceiver-charge.ogg",
  279. volume = 1.2
  280. },
  281. {
  282. filename = "__Krastorio2Assets__/sounds/buildings/intergalactic-transceiver-charge.ogg",
  283. volume = 1.2
  284. },
  285. {
  286. filename = "__Krastorio2Assets__/sounds/buildings/intergalactic-transceiver-charge-morse.ogg",
  287. volume = 1.2
  288. }
  289. }
  290. },
  291. idle_sound =
  292. {
  293. filename = "__Krastorio2Assets__/sounds/buildings/intergalactic-transceiver.ogg",
  294. volume = 1
  295. },
  296. max_sounds_per_type = 3,
  297. fade_in_ticks = 10,
  298. fade_out_ticks = 30
  299. }
  300.  
  301. -- Use the default gate oepn sound, just louder:
  302. local gate_open_sound = {}
  303. for _, sound in pairs(sounds.gate_open) do
  304. table.insert(gate_open_sound, {filename=sound.filename, volume=1})
  305. end
  306. local gate_close_sound = {}
  307. for _, sound in pairs(sounds.gate_close) do
  308. table.insert(gate_close_sound, {filename=sound.filename, volume=1})
  309. end
  310.  
  311. local blank_image = {
  312. filename = "__krastorio2_extended_endgame__/graphics/blank.png",
  313. width = 1,
  314. height = 1,
  315. frame_count = 1,
  316. line_length = 1,
  317. shift = { 0, 0 },
  318. }
  319.  
  320. data:extend(
  321. {
  322. -- Invisible combinator used to create custom signals:
  323. {
  324. type = "constant-combinator",
  325. name = "kee-intergalactic-transceiver-combinator",
  326. icon = "__Krastorio2Assets__/icons/entities/intergalactic-transceiver.png",
  327. icon_size = 64,
  328. flags = {"placeable-player", "player-creation", "placeable-off-grid", "not-deconstructable", "not-blueprintable"},
  329. order = "y",
  330. max_health = 10000,
  331. healing_per_tick = 10000,
  332. corpse = "small-remnants",
  333. collision_box = {{-0.0, -0.0}, {0.0, 0.0}},
  334. collision_mask = {"not-colliding-with-itself"},
  335. selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
  336. scale_info_icons = false,
  337. selectable_in_game = selectable,
  338. item_slot_count = 10,
  339. sprites =
  340. {
  341. north = blank_image,
  342. east = blank_image,
  343. south = blank_image,
  344. west = blank_image
  345. },
  346. activity_led_sprites =
  347. {
  348. north = blank_image,
  349. east = blank_image,
  350. south = blank_image,
  351. west = blank_image
  352. },
  353. activity_led_light =
  354. {
  355. intensity = 0.8,
  356. size = 1,
  357. },
  358. activity_led_light_offsets =
  359. {
  360. {0, 0},
  361. {0, 0},
  362. {0, 0},
  363. {0, 0}
  364. },
  365. circuit_wire_connection_points = {
  366. {
  367. shadow = { red = {0, 0}, green = {0, 0}, },
  368. wire = { red = {0, 0}, green = {0, 0}, }
  369. },
  370. {
  371. shadow = { red = {0, 0}, green = {0, 0}, },
  372. wire = { red = {0, 0}, green = {0, 0}, }
  373. },
  374. {
  375. shadow = { red = {0, 0}, green = {0, 0}, },
  376. wire = { red = {0, 0}, green = {0, 0}, }
  377. },
  378. {
  379. shadow = { red = {0, 0}, green = {0, 0}, },
  380. wire = { red = {0, 0}, green = {0, 0}, }
  381. }
  382. },
  383. circuit_connector_sprites = nil,
  384. circuit_wire_max_distance = 10
  385. },
  386. -- Loading stage before test-fire:
  387. {
  388. type = "container",
  389. name = "kee-intergalactic-transceiver-loading",
  390. order = "a",
  391. inventory_size = 80,
  392. open_sound = gate_open_sound,
  393. close_sound = gate_close_sound,
  394.  
  395. icon = "__Krastorio2Assets__/icons/entities/intergalactic-transceiver.png",
  396. icon_size = 64,
  397. flags = {"placeable-neutral","placeable-player", "player-creation", "not-rotatable"},
  398. map_color = {r=0.37, g=0.18, b=0.47},
  399. max_health = 20000,
  400. minable = {mining_time = 10, result = "kee-intergalactic-transceiver-loading"},
  401. corpse = "kr-big-random-pipes-remnant",
  402. dying_explosion = "massive-explosion",
  403. damaged_trigger_effect = hit_effects.entity(),
  404. collision_box = {{-5.75, -5.25}, {5.75, 5.25}},
  405. selection_box = {{-6, -5.5}, {6, 5.5}},
  406. drawing_box = {{-5.75, -5.25}, {5.75, 5.25}},
  407. resistances =
  408. {
  409. {type = "physical", percent = 75},
  410. {type = "fire", percent = 75},
  411. {type = "impact", percent = 75}
  412. },
  413. picture =
  414. {
  415. layers=
  416. {
  417. {
  418. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/intergalactic-transceiver.png",
  419. width = 400,
  420. height = 400,
  421. frame_count = 1,
  422. shift = {0, -0.8},
  423. hr_version =
  424. {
  425. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/hr-intergalactic-transceiver.png",
  426. width = 800,
  427. height = 800,
  428. scale = 0.5,
  429. frame_count = 1,
  430. shift = {0, -0.8}
  431. }
  432. },
  433. {
  434. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/intergalactic-transceiver-sh.png",
  435. width = 434,
  436. height = 313,
  437. frame_count = 1,
  438. draw_as_shadow = true,
  439. shift = {0.52, 0.5},
  440. hr_version =
  441. {
  442. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/hr-intergalactic-transceiver-sh.png",
  443. width = 867,
  444. height = 626,
  445. scale = 0.5,
  446. frame_count = 1,
  447. draw_as_shadow = true,
  448. shift = {0.52, 0.5}
  449. }
  450. }
  451.  
  452. }
  453. },
  454. vehicle_impact_sound = sounds.generic_impact,
  455. circuit_wire_connection_point = {
  456. shadow =
  457. {
  458. red = {4.3, 2.45},
  459. green = {4.3, 2.45},
  460. },
  461. wire =
  462. {
  463. red = {4.3, 2.45},
  464. green = {4.3, 2.45},
  465. }
  466. },
  467. circuit_connector_sprites = nil,
  468. circuit_wire_max_distance = default_circuit_wire_max_distance,
  469. default_output_signal = {type = "virtual", name = "signal-I"}
  470. },
  471. -- Test-fire stage:
  472. {
  473. type = "accumulator",
  474. name = "kee-intergalactic-transceiver-test-fire",
  475. order = "b",
  476. icon = "__Krastorio2Assets__/icons/entities/intergalactic-transceiver.png",
  477. icon_size = 64,
  478. flags = {"placeable-neutral","placeable-player", "player-creation", "not-rotatable"},
  479. map_color = {r=0.37, g=0.18, b=0.47},
  480. max_health = 20000,
  481. minable = {mining_time = 10, result = "kee-intergalactic-transceiver-loading"},
  482. corpse = "kr-big-random-pipes-remnant",
  483. dying_explosion = "nuclear-reactor-explosion",
  484. damaged_trigger_effect = hit_effects.entity(),
  485. collision_box = {{-5.75, -5.25}, {5.75, 5.25}},
  486. selection_box = {{-6, -5.5}, {6, 5.5}},
  487. drawing_box = {{-5.75, -5.25}, {5.75, 5.25}},
  488. resistances =
  489. {
  490. {type = "physical", percent = 75},
  491. {type = "fire", percent = 75},
  492. {type = "impact", percent = 75}
  493. },
  494. energy_source =
  495. {
  496. type = "electric",
  497. buffer_capacity = "30TJ",
  498. usage_priority = "tertiary",
  499. input_flow_limit = "60GW",
  500. output_flow_limit = "0W"
  501. },
  502. picture =
  503. {
  504. layers=
  505. {
  506. {
  507. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/intergalactic-transceiver.png",
  508. width = 400,
  509. height = 400,
  510. frame_count = 1,
  511. shift = {0, -0.8},
  512. hr_version =
  513. {
  514. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/hr-intergalactic-transceiver.png",
  515. width = 800,
  516. height = 800,
  517. scale = 0.5,
  518. frame_count = 1,
  519. shift = {0, -0.8}
  520. }
  521. },
  522. {
  523. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/intergalactic-transceiver-sh.png",
  524. width = 434,
  525. height = 313,
  526. frame_count = 1,
  527. draw_as_shadow = true,
  528. shift = {0.52, 0.5},
  529. hr_version =
  530. {
  531. filename = "__Krastorio2Assets__/entities/intergalactic-transceiver/hr-intergalactic-transceiver-sh.png",
  532. width = 867,
  533. height = 626,
  534. scale = 0.5,
  535. frame_count = 1,
  536. draw_as_shadow = true,
  537. shift = {0.52, 0.5}
  538. }
  539. }
  540.  
  541. }
  542. },
  543. charge_animation = intergalactic_transceiver_animation,
  544. discharge_animation = intergalactic_transceiver_animation,
  545. charge_cooldown = 240,
  546. discharge_cooldown = 240,
  547. charge_light =
  548. {
  549. intensity = 1.5,
  550. size = 50,
  551. shift = {0, 0},
  552. color = {r=1, g=0.5, b=0.75}
  553. },
  554. vehicle_impact_sound = sounds.generic_impact,
  555. working_sound = intergalactic_transceiver_working_sound,
  556. audible_distance_modifier = 30,
  557.  
  558. circuit_wire_connection_point = {
  559. shadow =
  560. {
  561. red = {4.3, 2.45},
  562. green = {4.3, 2.45},
  563. },
  564. wire =
  565. {
  566. red = {4.3, 2.45},
  567. green = {4.3, 2.45},
  568. }
  569. },
  570. circuit_connector_sprites = nil,
  571. circuit_wire_max_distance = default_circuit_wire_max_distance,
  572.  
  573. default_output_signal = {type = "virtual", name = "signal-I"}
  574. }
  575. })
  576.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement