Repository for the time_travel mod.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nodes.lua 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. --technical stuff
  2. minetest.register_node("time_travel:jungle_tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
  3. minetest.register_node("time_travel:snowy_pine_tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
  4. minetest.register_node("time_travel:tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
  5. --minetest.register_node("time_travel:coral_reef", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
  6. --australia nodes taken from the australia mod
  7. minetest.register_node("time_travel:australia_red_stone", {
  8. description = "Australian Red Stone",
  9. tiles = {"time_travel_aus_red_stone.png"},
  10. groups = {cracky=3, stone=1},
  11. drop = 'time_travel:australia_red_cobble',
  12. sounds = default.node_sound_stone_defaults(),
  13. })
  14. minetest.register_node("time_travel:australia_red_cobble", {
  15. description = "Australian Red cobblestone",
  16. tiles = {"time_travel_aus_red_cobble.png"},
  17. is_ground_content = false,
  18. groups = {cracky=3, stone=2},
  19. sounds = default.node_sound_stone_defaults(),
  20. })
  21. minetest.register_craft({
  22. type = "cooking",
  23. output = "time_travel:australia_red_stone",
  24. recipe = "time_travel:australia_red_cobble",
  25. --cooktime = 10,
  26. })
  27. minetest.register_node("time_travel:australia_red_gravel", {
  28. description = "Australian Red Gravel",
  29. tiles = {"time_travel_aus_red_gravel.png"},
  30. groups = {crumbly=2, falling_node=1},
  31. sounds = default.node_sound_dirt_defaults({
  32. footstep = {name="default_gravel_footstep", gain=0.5},
  33. dug = {name="default_gravel_footstep", gain=1.0},
  34. }),
  35. })
  36. minetest.register_node("time_travel:australia_red_stonebrick", {
  37. description = "Australian Red Stone Brick",
  38. tiles = {"time_travel_aus_red_stonebrick.png"},
  39. is_ground_content = false,
  40. groups = {cracky=2, stone=1},
  41. sounds = default.node_sound_stone_defaults(),
  42. })
  43. minetest.register_craft({
  44. output = 'time_travel:australia_red_stonebrick 4',
  45. recipe = {
  46. {'time_travel:australia_red_stone', 'time_travel:australia_red_stone'},
  47. {'time_travel:australia_red_stone', 'time_travel:australia_red_stone'},
  48. }
  49. })
  50. minetest.register_node("time_travel:australia_red_dirt", {
  51. description = "Australian Red Dirt",
  52. tiles = {"time_travel_aus_red_dirt.png"},
  53. groups = {crumbly=3,soil=1},
  54. sounds = default.node_sound_dirt_defaults(),
  55. })
  56. minetest.register_node("time_travel:australia_red_sand", {
  57. description = "Australian Red Sand",
  58. tiles = {"time_travel_aus_red_sand.png"},
  59. groups = {crumbly=3, falling_node=1, sand=1},
  60. sounds = default.node_sound_sand_defaults(),
  61. })
  62. --metamese stuff
  63. minetest.register_craftitem("time_travel:metamese_crystal", {
  64. description = "Metamese Crystal",
  65. inventory_image = "time_travel_metamese_crystal.png",
  66. })
  67. minetest.register_craftitem("time_travel:metamese_crystal_fragment", {
  68. description = "Metamese Crystal Fragment",
  69. inventory_image = "time_travel_metamese_crystal_fragment.png",
  70. })
  71. minetest.register_node("time_travel:stone_with_metamese", {
  72. description = "Metamese Ore",
  73. tiles = {"default_stone.png^time_travel_mineral_metamese.png"},
  74. paramtype = "light",
  75. groups = {cracky = 1},
  76. drop = "time_travel:metamese_crystal",
  77. sounds = default.node_sound_stone_defaults(),
  78. light_source = 6,
  79. })
  80. minetest.register_node("time_travel:metamese_block", {
  81. description = "Metamese Block",
  82. tiles = {"time_travel_metamese_block.png"},
  83. paramtype = "light",
  84. groups = {cracky = 1, level = 3},
  85. sounds = default.node_sound_stone_defaults(),
  86. light_source = 15,
  87. })
  88. minetest.register_craft({
  89. output = 'time_travel:metamese_block',
  90. recipe = {
  91. {'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
  92. {'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
  93. {'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
  94. }
  95. })
  96. minetest.register_craft({
  97. output = 'time_travel:metamese_crystal 9',
  98. recipe = {
  99. {'time_travel:metamese_block'},
  100. }
  101. })
  102. minetest.register_craft({
  103. output = 'time_travel:metamese_crystal_fragment 9',
  104. recipe = {
  105. {'time_travel:metamese_crystal'},
  106. }
  107. })
  108. minetest.register_craft({
  109. output = "time_travel:metamese_crystal",
  110. recipe = {
  111. {"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
  112. {"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
  113. {"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
  114. }
  115. })
  116. minetest.register_ore({
  117. ore_type = "scatter",
  118. ore = "time_travel:stone_with_metamese",
  119. wherein = "default:stone",
  120. clust_scarcity = 36 * 36 * 36,
  121. clust_num_ores = 3,
  122. clust_size = 2,
  123. y_min = -31000,
  124. y_max = -1024,
  125. })
  126. --time travel stuff
  127. minetest.register_craftitem("time_travel:time_core", {
  128. description = "Time Core",
  129. inventory_image = "time_travel_time_core.png",
  130. })
  131. minetest.register_craft({
  132. output = "time_travel:time_core",
  133. recipe = {
  134. {"default:gold_ingot", "", "default:gold_ingot"},
  135. {"", "time_travel:metamese_crystal", ""},
  136. {"", "default:gold_ingot", ""},
  137. }
  138. })
  139. minetest.register_node("time_travel:time_machine_inactive", {
  140. description = "Inactive Time Machine",
  141. tiles = {
  142. "time_travel_time_machine_top_inactive.png",
  143. "time_travel_time_machine_side.png",
  144. "time_travel_time_machine_side.png",
  145. "time_travel_time_machine_side.png",
  146. "time_travel_time_machine_side.png",
  147. "default_steel_block.png^time_travel_time_core.png",
  148. },
  149. --paramtype = "light",
  150. paramtype2 = "facedir",
  151. is_ground_content = false,
  152. groups = {cracky = 1, level = 2},
  153. sounds = default.node_sound_metal_defaults(),
  154. --light_source = 15,
  155. after_place_node = function(pos, placer, itemstack)
  156. local meta=minetest.get_meta(pos)
  157. meta:set_string("owner",placer:get_player_name())
  158. meta:set_string("infotext","Time Machine: Water Age")
  159. end,
  160. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  161. if itemstack:get_name() == "default:junglegrass" and itemstack:get_count() >= 1 then
  162. local taken = itemstack:take_item(1)
  163. local inv = player:get_inventory()
  164. local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
  165. local p = minetest.get_node(pos).param2
  166. minetest.swap_node(pos, {name = "time_travel:time_machine_dinosaur_age",param2=p})
  167. elseif itemstack:get_name() == "default:snow" and itemstack:get_count() >= 1 then
  168. local taken = itemstack:take_item(1)
  169. local inv = player:get_inventory()
  170. local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
  171. local p = minetest.get_node(pos).param2
  172. minetest.swap_node(pos, {name = "time_travel:time_machine_ice_age",param2=p})
  173. elseif itemstack:get_name() == "default:dry_shrub" and itemstack:get_count() >= 1 then
  174. local taken = itemstack:take_item(1)
  175. local inv = player:get_inventory()
  176. local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
  177. local p = minetest.get_node(pos).param2
  178. minetest.swap_node(pos, {name = "time_travel:time_machine_prehistoric_australia",param2=p})
  179. elseif itemstack:get_name() == "default:coral_skeleton" and itemstack:get_count() >= 1 then
  180. local taken = itemstack:take_item(1)
  181. local inv = player:get_inventory()
  182. local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
  183. local p = minetest.get_node(pos).param2
  184. minetest.swap_node(pos, {name = "time_travel:time_machine_water_age",param2=p})
  185. end
  186. end
  187. })
  188. minetest.register_craft({
  189. output = "time_travel:time_machine_inactive",
  190. recipe = {
  191. {"default:steelblock", "default:mese_crystal", "default:steelblock"},
  192. {"default:mese_crystal", "time_travel:time_core", "default:mese_crystal"},
  193. {"default:steelblock", "default:mese_crystal", "default:steelblock"},
  194. }
  195. })
  196. minetest.register_node("time_travel:time_machine_dinosaur_age", {
  197. description = "Time Machine: Dinosaur Age",
  198. tiles = {
  199. {
  200. name = "time_travel_time_machine_top_dinosaur_age_animated.png",
  201. animation = {
  202. type = "vertical_frames",
  203. aspect_w = 16,
  204. aspect_h = 16,
  205. length = 1.0,
  206. },
  207. },
  208. "time_travel_time_machine_side.png",
  209. "time_travel_time_machine_side.png",
  210. "time_travel_time_machine_side.png",
  211. "time_travel_time_machine_side.png",
  212. "default_steel_block.png^time_travel_time_core.png",
  213. },
  214. paramtype = "light",
  215. paramtype2 = "facedir",
  216. is_ground_content = false,
  217. groups = {cracky = 1, level = 2},
  218. sounds = default.node_sound_metal_defaults(),
  219. light_source = 15,
  220. after_place_node = function(pos, placer, itemstack)
  221. local meta=minetest.get_meta(pos)
  222. meta:set_string("owner",placer:get_player_name())
  223. meta:set_string("infotext","Time Machine: Dinosaur Age")
  224. end,
  225. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  226. local owner=minetest.get_meta(pos):get_string("owner")
  227. local pos2={x=pos.x,y=2000+501+1+2,z=pos.z}
  228. if not minetest.is_protected(pos2, owner) then
  229. multidimensions.move(player,pos2)
  230. end
  231. end,
  232. mesecons = {
  233. receptor = {state = "off"},
  234. effector={
  235. action_on=function(pos, node)
  236. local owner=minetest.get_meta(pos):get_string("owner")
  237. local pos2={x=pos.x,y=2000+501+1+2,z=pos.z}
  238. for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
  239. multidimensions.move(ob,pos2)
  240. end
  241. return false
  242. end
  243. }
  244. },
  245. drop = "time_travel:time_machine_inactive"
  246. })
  247. minetest.register_node("time_travel:time_machine_ice_age", {
  248. description = "Time Machine: Ice Age",
  249. tiles = {
  250. {
  251. name = "time_travel_time_machine_top_ice_age_animated.png",
  252. animation = {
  253. type = "vertical_frames",
  254. aspect_w = 16,
  255. aspect_h = 16,
  256. length = 1.0,
  257. },
  258. },
  259. "time_travel_time_machine_side.png",
  260. "time_travel_time_machine_side.png",
  261. "time_travel_time_machine_side.png",
  262. "time_travel_time_machine_side.png",
  263. "default_steel_block.png^time_travel_time_core.png",
  264. },
  265. paramtype = "light",
  266. paramtype2 = "facedir",
  267. is_ground_content = false,
  268. groups = {cracky = 1, level = 2},
  269. sounds = default.node_sound_metal_defaults(),
  270. light_source = 15,
  271. after_place_node = function(pos, placer, itemstack)
  272. local meta=minetest.get_meta(pos)
  273. meta:set_string("owner",placer:get_player_name())
  274. meta:set_string("infotext","Time Machine: Ice Age")
  275. end,
  276. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  277. local owner=minetest.get_meta(pos):get_string("owner")
  278. local pos2={x=pos.x,y=3000+501+1+2,z=pos.z}
  279. if not minetest.is_protected(pos2, owner) then
  280. multidimensions.move(player,pos2)
  281. end
  282. end,
  283. mesecons = {
  284. receptor = {state = "off"},
  285. effector={
  286. action_on=function(pos, node)
  287. local owner=minetest.get_meta(pos):get_string("owner")
  288. local pos2={x=pos.x,y=3000+501+1+2,z=pos.z}
  289. for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
  290. multidimensions.move(ob,pos2)
  291. end
  292. return false
  293. end
  294. }
  295. },
  296. drop = "time_travel:time_machine_inactive"
  297. })
  298. minetest.register_node("time_travel:time_machine_prehistoric_australia", {
  299. description = "Time Machine: Prehistoric Australia",
  300. tiles = {
  301. {
  302. name = "time_travel_time_machine_top_prehistoric_australia_animated.png",
  303. animation = {
  304. type = "vertical_frames",
  305. aspect_w = 16,
  306. aspect_h = 16,
  307. length = 1.0,
  308. },
  309. },
  310. "time_travel_time_machine_side.png",
  311. "time_travel_time_machine_side.png",
  312. "time_travel_time_machine_side.png",
  313. "time_travel_time_machine_side.png",
  314. "default_steel_block.png^time_travel_time_core.png",
  315. },
  316. paramtype = "light",
  317. paramtype2 = "facedir",
  318. is_ground_content = false,
  319. groups = {cracky = 1, level = 2},
  320. sounds = default.node_sound_metal_defaults(),
  321. light_source = 15,
  322. after_place_node = function(pos, placer, itemstack)
  323. local meta=minetest.get_meta(pos)
  324. meta:set_string("owner",placer:get_player_name())
  325. meta:set_string("infotext","Time Machine: Prehistoric Australia")
  326. end,
  327. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  328. local owner=minetest.get_meta(pos):get_string("owner")
  329. local pos2={x=pos.x,y=4000+501+1+2,z=pos.z}
  330. if not minetest.is_protected(pos2, owner) then
  331. multidimensions.move(player,pos2)
  332. end
  333. end,
  334. mesecons = {
  335. receptor = {state = "off"},
  336. effector={
  337. action_on=function(pos, node)
  338. local owner=minetest.get_meta(pos):get_string("owner")
  339. local pos2={x=pos.x,y=4000+501+1+2,z=pos.z}
  340. for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
  341. multidimensions.move(ob,pos2)
  342. end
  343. return false
  344. end
  345. }
  346. },
  347. drop = "time_travel:time_machine_inactive"
  348. })
  349. minetest.register_node("time_travel:time_machine_water_age", {
  350. description = "Time Machine: Water Age",
  351. tiles = {
  352. {
  353. name = "time_travel_time_machine_top_water_age_animated.png",
  354. animation = {
  355. type = "vertical_frames",
  356. aspect_w = 16,
  357. aspect_h = 16,
  358. length = 1.0,
  359. },
  360. },
  361. "time_travel_time_machine_side.png",
  362. "time_travel_time_machine_side.png",
  363. "time_travel_time_machine_side.png",
  364. "time_travel_time_machine_side.png",
  365. "default_steel_block.png^time_travel_time_core.png",
  366. },
  367. paramtype = "light",
  368. paramtype2 = "facedir",
  369. is_ground_content = false,
  370. groups = {cracky = 1, level = 2},
  371. sounds = default.node_sound_metal_defaults(),
  372. light_source = 15,
  373. after_place_node = function(pos, placer, itemstack)
  374. local meta=minetest.get_meta(pos)
  375. meta:set_string("owner",placer:get_player_name())
  376. meta:set_string("infotext","Time Machine: Water Age")
  377. end,
  378. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  379. local owner=minetest.get_meta(pos):get_string("owner")
  380. local pos2={x=pos.x,y=5000+511+1+2,z=pos.z}
  381. if not minetest.is_protected(pos2, owner) then
  382. multidimensions.move(player,pos2)
  383. end
  384. end,
  385. mesecons = {
  386. receptor = {state = "off"},
  387. effector={
  388. action_on=function(pos, node)
  389. local owner=minetest.get_meta(pos):get_string("owner")
  390. local pos2={x=pos.x,y=5000+511+1+2,z=pos.z}
  391. for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
  392. multidimensions.move(ob,pos2)
  393. end
  394. return false
  395. end
  396. }
  397. },
  398. drop = "time_travel:time_machine_inactive"
  399. })