kalite_torch.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. minetest.register_node("torches:kalite_torch_floor", {
  2. description = "Kalite Torch",
  3. drawtype = "mesh",
  4. mesh = "torch_floor.obj",
  5. inventory_image = "gloopores_kalite_torch_on_floor.png",
  6. wield_image = "gloopores_kalite_torch_on_floor.png",
  7. tiles = {{
  8. name = "gloopores_kalite_torch_on_floor_animated.png",
  9. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  10. }},
  11. paramtype = "light",
  12. paramtype2 = "wallmounted",
  13. sunlight_propagates = true,
  14. walkable = false,
  15. liquids_pointable = false,
  16. light_source = 12,
  17. groups = utility.dig_groups("item", {
  18. flammable=1,
  19. attached_node=1,
  20. torch=1,
  21. torch_craftitem=1,
  22. melt_around=2,
  23. notify_construct=1,
  24. want_notify=1,
  25. }),
  26. drop = "torches:kalite_torch_floor",
  27. damage_per_second = 1*500, -- Torches damage if you stand on top of them.
  28. _damage_per_second_type = "heat",
  29. _death_message = {
  30. "<player> stepped on a red torch.",
  31. "<player> stepped on burning kalite.",
  32. },
  33. selection_box = {
  34. type = "wallmounted",
  35. wall_bottom = {-1/16, -0.5, -1/16, 1/16, 2/16, 1/16},
  36. },
  37. sounds = default.node_sound_wood_defaults(),
  38. _torches_node_floor = "torches:kalite_torch_floor",
  39. _torches_node_wall = "torches:kalite_torch_wall",
  40. _torches_node_ceiling = "torches:kalite_torch_ceiling",
  41. on_place = function(...)
  42. return torches.put_torch(...)
  43. end,
  44. --[[
  45. on_use = function(...)
  46. return torches.on_use(...)
  47. end,
  48. --]]
  49. floodable = true,
  50. on_rotate = false,
  51. on_flood = function(pos, oldnode, newnode)
  52. minetest.add_node(pos, {name="air"})
  53. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  54. return true
  55. end,
  56. on_construct = function(pos)
  57. breath.ignite_nearby_gas(pos)
  58. flowers.create_lilyspawner_near(pos)
  59. torchmelt.start_melting(pos)
  60. real_torch.start_kalite_timer(pos)
  61. end,
  62. on_notify = function(pos, other)
  63. torchmelt.start_melting(pos)
  64. end,
  65. on_destruct = function(pos)
  66. end,
  67. })
  68. minetest.register_node("torches:kalite_torch_wall", {
  69. drawtype = "mesh",
  70. mesh = "torch_wall.obj",
  71. tiles = {{
  72. name = "gloopores_kalite_torch_on_floor_animated.png",
  73. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  74. }},
  75. paramtype = "light",
  76. paramtype2 = "wallmounted",
  77. sunlight_propagates = true,
  78. walkable = false,
  79. light_source = 12,
  80. groups = utility.dig_groups("item", {
  81. flammable=1,
  82. not_in_creative_inventory=1,
  83. attached_node=1,
  84. torch=1,
  85. melt_around=2,
  86. notify_construct=1,
  87. want_notify=1,
  88. }),
  89. drop = "torches:kalite_torch_floor",
  90. selection_box = {
  91. type = "wallmounted",
  92. wall_side = {-0.5, -0.3, -0.1, -0.2, 0.3, 0.1},
  93. },
  94. sounds = default.node_sound_wood_defaults(),
  95. floodable = true,
  96. on_rotate = false,
  97. on_flood = function(pos, oldnode, newnode)
  98. minetest.add_node(pos, {name="air"})
  99. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  100. return true
  101. end,
  102. on_construct = function(pos)
  103. breath.ignite_nearby_gas(pos)
  104. flowers.create_lilyspawner_near(pos)
  105. torchmelt.start_melting(pos)
  106. real_torch.start_kalite_timer(pos)
  107. end,
  108. on_notify = function(pos, other)
  109. torchmelt.start_melting(pos)
  110. end,
  111. on_destruct = function(pos)
  112. end,
  113. })
  114. minetest.register_node("torches:kalite_torch_ceiling", {
  115. drawtype = "mesh",
  116. mesh = "torch_ceiling.obj",
  117. tiles = {{
  118. name = "gloopores_kalite_torch_on_floor_animated.png",
  119. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
  120. }},
  121. paramtype = "light",
  122. paramtype2 = "wallmounted",
  123. sunlight_propagates = true,
  124. walkable = false,
  125. light_source = 12,
  126. groups = utility.dig_groups("item", {
  127. flammable=1,
  128. not_in_creative_inventory=1,
  129. attached_node=1,
  130. torch=1,
  131. melt_around=2,
  132. notify_construct=1,
  133. want_notify=1,
  134. }),
  135. drop = "torches:kalite_torch_floor",
  136. selection_box = {
  137. type = "wallmounted",
  138. wall_top = {-0.1, -0.1, -0.25, 0.1, 0.5, 0.1},
  139. },
  140. sounds = default.node_sound_wood_defaults(),
  141. floodable = true,
  142. on_rotate = false,
  143. on_flood = function(pos, oldnode, newnode)
  144. minetest.add_node(pos, {name="air"})
  145. minetest.sound_play("real_torch_extinguish", {pos=pos, max_hear_distance=16, gain=1}, true)
  146. return true
  147. end,
  148. on_construct = function(pos)
  149. breath.ignite_nearby_gas(pos)
  150. flowers.create_lilyspawner_near(pos)
  151. torchmelt.start_melting(pos)
  152. real_torch.start_kalite_timer(pos)
  153. end,
  154. on_notify = function(pos, other)
  155. torchmelt.start_melting(pos)
  156. end,
  157. on_destruct = function(pos)
  158. end,
  159. })
  160. minetest.register_craft({
  161. output = 'torches:kalite_torch_floor 4',
  162. recipe = {
  163. {'kalite:lump'},
  164. {'group:stick'},
  165. }
  166. })
  167. minetest.register_craft({
  168. type = "fuel",
  169. recipe = "torches:kalite_torch_floor",
  170. burntime = 4,
  171. })