Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. --Quick to use empty sprite
  2. local Proto = {}
  3. Proto.empty_sprite ={
  4. filename = "__Bottleneck__/graphics/off.png",
  5. priority = "extra-high",
  6. width = 1,
  7. height = 1
  8. }
  9.  
  10. --Quick to use empty animation
  11. Proto.empty_animation = {
  12. filename = Proto.empty_sprite.filename,
  13. width = Proto.empty_sprite.width,
  14. height = Proto.empty_sprite.height,
  15. line_length = 1,
  16. frame_count = 1,
  17. shift = { 0, 0},
  18. animation_speed = 1
  19. }
  20.  
  21. --off, green, red, yellow, blue
  22. local stoplight = {
  23. type = "storage-tank",
  24. name = "bottleneck-stoplight",
  25. icon = "__Bottleneck__/graphics/red.png",
  26. max_health = 1,
  27. selectable_in_game = false,
  28. collision_box = nil,
  29. selection_box = nil,
  30. collision_mask = {"floor-layer"},
  31. fluid_box = {
  32. base_area = 0,
  33. pipe_covers = nil,
  34. pipe_connections = {},
  35. },
  36. window_bounding_box = {{-0.0,-0.0}, {0.0, 0.0}},
  37. pictures = {
  38. picture = {
  39. north = {
  40. --off
  41. filename = "__Bottleneck__/graphics/stoplights.png",
  42. priority = "extra-high",
  43. x = 0,
  44. y = 0,
  45. width = 32,
  46. height = 32,
  47. scale = 0.6,
  48. frame_count = 1,
  49. shift = {-0.5, -0.3}
  50. },
  51. east = {
  52. --green
  53. filename = "__Bottleneck__/graphics/stoplights.png",
  54. x = 0,
  55. y = 32,
  56. priority = "extra-high",
  57. width = 32,
  58. height = 32,
  59. scale = 0.6,
  60. frame_count = 1,
  61. shift = {-0.5, -0.3}
  62. },
  63. south = {
  64. --red
  65. filename = "__Bottleneck__/graphics/stoplights.png",
  66. x = 0,
  67. y = 64,
  68. priority = "extra-high",
  69. width = 32,
  70. height = 32,
  71. scale = 0.6,
  72. frame_count = 1,
  73. shift = {-0.5, -0.3}
  74. },
  75. west = {
  76. --yellow
  77. x = 0,
  78. y = 96,
  79. filename = "__Bottleneck__/graphics/stoplights.png",
  80. priority = "extra-high",
  81. width = 32,
  82. height = 32,
  83. scale = 0.6,
  84. frame_count = 1,
  85. shift = {-0.5, -0.3}
  86. },
  87. },
  88. fluid_background = Proto.empty_sprite,
  89. window_background = Proto.empty_sprite,
  90. flow_sprite = Proto.empty_sprite,
  91. gas_flow = Proto.empty_animation,
  92. },
  93. flow_length_in_ticks = 360,
  94. vehicle_impact_sound = nil,
  95. working_sound = nil,
  96. }
  97.  
  98. local stoplight_high = table.deepcopy(stoplight)
  99. stoplight_high.name = "bottleneck-stoplight-high"
  100. stoplight_high.pictures.picture.west.x = 0
  101. stoplight_high.pictures.picture.west.y = 128
  102.  
  103.  
  104. local key1 = {
  105. type = "custom-input",
  106. name = "bottleneck-hotkey",
  107. key_sequence = "B",
  108. consuming = "script-only"
  109. }
  110. local key2 = {
  111. type = "custom-input",
  112. name = "bottleneck-highcontrast",
  113. key_sequence = "SHIFT + B",
  114. consuming = "script-only"
  115. }
  116. data:extend({stoplight, stoplight_high, key1, key2})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement