init.lua 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. local modpath = minetest.get_modpath(minetest.get_current_modname())
  2. dofile(modpath.."/nodes.lua")
  3. dofile(modpath.."/invader.lua")
  4. dofile(modpath.."/engine.lua")
  5. --dofile(modpath.."/tools.lua") these are technic tools
  6. dofile(modpath.."/miniufo.lua")
  7. dofile(modpath.."/lighter.lua")
  8. dofile(modpath.."/base.lua")
  9. dofile(modpath.."/antigrav.lua")
  10. dofile(modpath.."/teleport.lua")
  11. local _ = {
  12. name = "air",
  13. prob = 0,
  14. }
  15. local A = {
  16. name = "air",
  17. prob = 0,
  18. force_place = true,
  19. }
  20. local M = {
  21. name = "ufowreck:alien_metal",
  22. force_place = true,
  23. }
  24. local M1 = {
  25. name = "ufowreck:alien_metal",
  26. }
  27. local L = {
  28. name = "ufowreck:alien_light",
  29. }
  30. local G = {
  31. name = "ufowreck:alien_glass",
  32. force_place = true,
  33. }
  34. local D1 = {
  35. name = "ufowreck:alien_door_closed", param2=3,
  36. force_place = true,
  37. }
  38. local D2 = {
  39. name = "ufowreck:alien_door_closed", param2=1,
  40. force_place = true,
  41. }
  42. local D3 = {
  43. name = "ufowreck:alien_door_closed_top", param2=3,
  44. force_place = true,
  45. }
  46. local D4 = {
  47. name = "ufowreck:alien_door_closed_top", param2=1,
  48. force_place = true,
  49. }
  50. local C = {
  51. name = "ufowreck:alien_control",
  52. }
  53. local E = {
  54. name = "ufowreck:alien_engine", prob = 200,
  55. }
  56. local H = {
  57. name = "ufowreck:alien_health_charger8", param2=3, prob = 200,
  58. }
  59. F1 = {name = "default:mese", force_place = true,}
  60. F2 = {name = "default:stone_with_mese", force_place = true,}
  61. local P1 = {name = "ufowreck:locked_crate",
  62. force_place = true,}
  63. local P2 = {name = "air", prob = 0,}
  64. local P3 = {name = "air", prob = 0,}
  65. local i = math.random(3)
  66. if i == 1 then
  67. P2 = {name = "ufowreck:bar_light", prob = 100,}
  68. elseif i == 2 then
  69. P2 = {name = "ufowreck:crate", prob = 100,}
  70. end;
  71. local j = math.random(4)
  72. if j == 1 then
  73. P3 = {name = "ufowreck:eye_tree", prob = 100,}
  74. elseif j == 2 then
  75. P3 = {name = "ufowreck:predatory_plant", prob = 100,}
  76. elseif j == 3 then
  77. P3 = {name = "ufowreck:alien_egg", prob = 100,}
  78. else
  79. P3 = {name = "ufowreck:glow_plant", prob = 100,}
  80. end
  81. local S = {
  82. name = "ufowreck:floob_spawner",
  83. force_place = true,
  84. }
  85. -- make schematic
  86. ufowreck_schematic_1 = {
  87. size = {x = 10, y = 5, z = 10},
  88. data = {
  89. --1
  90. _, _, _, _, _, _, _, _, _, _,
  91. _, _, _, M, M, M, M, _, _, _,
  92. _, _, _, M, M, M, G, _, _, _,
  93. _, _, _, _, _, _, _, _, _, _,
  94. _, _, _, _, _, _, _, _, _, _,
  95. --2
  96. _, _, _, M1, M, M1, M1, _, _, _,
  97. _, M, M, _, _, M, _, M, M1, _,
  98. _, M, M, _, _, H, _, G, G, _,
  99. _, _, _, M, M, M, M, _, _, _,
  100. _, _, _, _, _, _, _, _, _, _,
  101. --3
  102. _, _, M, M, M, M1, M, M, _, _,
  103. _, M, _, E, _, _, _, _, M, _,
  104. _, M, _, _, _, _, _, _, G, _,
  105. _, _, M, _, _, _, _, M1, _, _,
  106. _, _, _, M, M, M, M1, _, _, _,
  107. --4
  108. _, M, M, M1, M, M, M1, M, M, _,
  109. M, M, M, L, L, M, _, _, _, M,
  110. S, M, M, L, L, M, _, _, _, G,
  111. _, M, M, L, L, M, _, _, M, _,
  112. _, _, M, M1, M, M, M1, M1, _, _,
  113. --5
  114. _, M, M, M1, M, M, S, M, M, _,
  115. _, D1, _, _, _, _, _, _, C, M,
  116. _, D3, _, _, _, _, _, _, _, G,
  117. _, M, _, _, _, _, _, _, M, _,
  118. _, _, M, M1, M, M, M, M1, _, _,
  119. --6
  120. _, M, M, S, M, M1, M, M, M1, _,
  121. _, D2, _, _, _, _, _, _, C, M,
  122. _, D4, _, _, _, _, _, _, _, G,
  123. _, M, _, _, _, _, _, _, M, _,
  124. _, _, M1, M, M, M, M, M, _, _,
  125. --7
  126. _, M, M, M, M, M, M1, M, M, _,
  127. M, M, M, L, L, M, _, _, _, M,
  128. M, M, M, L, L, M, _, _, _, G,
  129. _, M, M, L, L, M, _, _, M, _,
  130. _, _, M, M, M, M1, M1, M, _, _,
  131. --8
  132. _, _, M, M, M, M, M, M, _, _,
  133. _, M, P2, _, _, _, _, _, M, _,
  134. _, M, P2, _, _, _, _, _, G, _,
  135. _, _, M, _, _, _, _, M, _, _,
  136. _, _, _, M1, M, M, M1, _, _, _,
  137. --9
  138. _, _, _, M, M, M, M1, _, _, _,
  139. _, M, M, P3, P1, M, _, M, M, _,
  140. _, M, M, _, _, M, _, G, G, _,
  141. _, _, _, M, M, M, M, _, _, _,
  142. _, _, _, _, _, _, _, _, _, _,
  143. --10
  144. _, _, _, _, _, _, _, _, _, _,
  145. _, _, _, M, M, M1, M1, _, _, _,
  146. _, _, _, M, M, M, G, _, _, _,
  147. _, _, _, _, _, _, _, _, _, _,
  148. _, _, _, _, _, _, _, _, _, _,
  149. }
  150. }
  151. ufowreck_schematic_2 = {
  152. size = {x = 10, y = 5, z = 10},
  153. data = {
  154. --1
  155. _, _, _, _, _, _, _, _, _, _,
  156. _, _, _, M, M, M, M, _, _, _,
  157. _, _, _, M, M, M, G, _, _, _,
  158. _, _, _, _, _, _, _, _, _, _,
  159. _, _, _, _, _, _, _, _, _, _,
  160. --2
  161. _, _, _, M1, M, M1, M1, _, _, _,
  162. _, M, M, F1, _, M, _, M, M1, _,
  163. _, M, M, _, _, H, _, G, G, _,
  164. _, _, _, M, M, M, M, _, _, _,
  165. _, _, _, _, _, _, _, _, _, _,
  166. --3
  167. _, _, M, M, M, M1, M, M, _, _,
  168. _, M, F1, F1, F1, _, _, _, M, _,
  169. _, M, _, F1, _, _, _, _, G, _,
  170. _, _, M, _, _, _, _, M1, _, _,
  171. _, _, _, M, M, M, M1, _, _, _,
  172. --4
  173. _, M, M, M1, M, M, M1, M, M, _,
  174. M, M, M, L, L, M, _, _, _, M,
  175. S, M, M, L, L, M, _, _, _, G,
  176. _, M, M, L, L, M, _, _, M, _,
  177. _, _, M, M1, M, M, M1, M1, _, _,
  178. --5
  179. _, M, M, M1, M, M, M, M, M, _,
  180. _, D1, _, _, _, _, _, _, C, M,
  181. _, D3, _, _, _, _, _, _, _, G,
  182. _, M, _, _, _, _, _, _, M, _,
  183. _, _, M, M1, M, M, M, M1, _, _,
  184. --6
  185. _, M, M, S, M, M, M, M, M1, _,
  186. _, D2, _, _, _, _, _, _, C, M,
  187. _, D4, _, _, _, _, _, _, _, G,
  188. _, M, _, _, _, _, _, _, M, _,
  189. _, _, M1, M, M, M, M, M, _, _,
  190. --7
  191. _, M, M, M, M, M, M1, M, M, _,
  192. M, M, M, L, L, M, _, _, _, M,
  193. M, M, M, L, L, M, _, _, _, G,
  194. _, M, M, L, L, M, _, _, M, _,
  195. _, _, M, M, M, M1, M1, M, _, _,
  196. --8
  197. _, _, M, M, M, M, M, M, _, _,
  198. _, M, P1, _, _, _, _, _, M, _,
  199. _, M, P2, _, _, _, _, _, G, _,
  200. _, _, M, _, _, _, _, M, _, _,
  201. _, _, _, M, M, M, M1, _, _, _,
  202. --9
  203. _, _, _, M, M, M, M1, _, _, _,
  204. _, M, M, P2, P2, M, _, M, M, _,
  205. _, M, M, _, _, M, _, G, G, _,
  206. _, _, _, M, M, M, M, _, _, _,
  207. _, _, _, _, _, _, _, _, _, _,
  208. --10
  209. _, _, _, _, _, _, _, _, _, _,
  210. _, _, _, M, M, M1, M1, _, _, _,
  211. _, _, _, M, M, M, G, _, _, _,
  212. _, _, _, _, _, _, _, _, _, _,
  213. _, _, _, _, _, _, _, _, _, _,
  214. }
  215. }
  216. ufowreck_schematic_3 = {
  217. size = {x = 10, y = 5, z = 10},
  218. data = {
  219. --1
  220. _, _, _, _, _, _, _, _, _, _,
  221. _, _, _, M, M, M, M, _, _, _,
  222. _, _, _, M, M, M, G, _, _, _,
  223. _, _, _, _, _, _, _, _, _, _,
  224. _, _, _, _, _, _, _, _, _, _,
  225. --2
  226. _, _, _, M1, M, M1, M1, _, _, _,
  227. _, M, M, F2, _, M, _, M, M1, _,
  228. _, M, M, _, _, H, _, G, G, _,
  229. _, _, _, M, M, M, M, _, _, _,
  230. _, _, _, _, _, _, _, _, _, _,
  231. --3
  232. _, _, M, M, M, M1, M, M, _, _,
  233. _, M, F2, F2, F2, _, _, _, M, _,
  234. _, M, _, F2, _, _, _, _, G, _,
  235. _, _, M, _, _, _, _, M1, _, _,
  236. _, _, _, M, M, M, M1, _, _, _,
  237. --4
  238. _, M, M, M1, M, M, M1, M, M, _,
  239. M, M, M, L, L, M, _, _, _, M,
  240. S, M, M, L, L, M, _, _, _, G,
  241. _, M, M, L, L, M, _, _, M, _,
  242. _, _, M, M1, M, M, M1, M1, _, _,
  243. --5
  244. _, M, M, M1, M, M, M, M, M, _,
  245. _, D1, _, _, _, _, _, _, C, M,
  246. _, D3, _, _, _, _, _, _, _, G,
  247. _, M, _, _, _, _, _, _, M, _,
  248. _, _, M, M1, M, M, M, M1, _, _,
  249. --6
  250. _, M, M, S, M, M, M, M, M1, _,
  251. _, D2, _, _, _, _, _, _, C, M,
  252. _, D4, _, _, _, _, _, _, _, G,
  253. _, M, _, _, _, _, _, _, M, _,
  254. _, _, M1, M, M, M, M, M, _, _,
  255. --7
  256. _, M, M, M, M, M, M1, M, M, _,
  257. M, M, M, L, L, M, _, _, _, M,
  258. M, M, M, L, L, M, _, _, _, G,
  259. _, M, M, L, L, M, _, _, M, _,
  260. _, _, M, M, M, M1, M1, M, _, _,
  261. --8
  262. _, _, M, M, M, M, M, M, _, _,
  263. _, M, P1, _, _, _, _, _, M, _,
  264. _, M, _, _, _, _, _, _, G, _,
  265. _, _, M, _, _, _, _, M, _, _,
  266. _, _, _, M, M, M, M1, _, _, _,
  267. --9
  268. _, _, _, M, M, M, M1, _, _, _,
  269. _, M, M, P3, P3, M, _, M, M, _,
  270. _, M, M, _, _, M, _, G, G, _,
  271. _, _, _, M, M, M, M, _, _, _,
  272. _, _, _, _, _, _, _, _, _, _,
  273. --10
  274. _, _, _, _, _, _, _, _, _, _,
  275. _, _, _, M, M, M1, M1, _, _, _,
  276. _, _, _, M, M, M, G, _, _, _,
  277. _, _, _, _, _, _, _, _, _, _,
  278. _, _, _, _, _, _, _, _, _, _,
  279. }
  280. }
  281. if math.random(2) == 1 then rotx = '180'
  282. else rotx = '0'
  283. end
  284. --with engine
  285. minetest.register_decoration({
  286. deco_type = "schematic",
  287. place_on = {"default:stone", "default:dirt_with_coniferous_litter", "default:dirt_with_rainforest_litter", "default:dirt_with_snow", "default:snow",
  288. "default:permafrost_with_stones", "default:sand", "default:dirt_with_grass"},
  289. biomes = {"rainforest", "rainforest_swamp", "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"},
  290. sidelen = 5,
  291. fill_ratio = 0.0000000000000001,
  292. schematic = ufowreck_schematic_1,
  293. rotation = rotx,
  294. y_min = -20,
  295. y_max = 31000,
  296. flags = {place_center_z = true, place_center_x = true},
  297. })
  298. minetest.register_decoration({
  299. deco_type = "schematic",
  300. place_on = {"default:stone", "default:dirt_with_coniferous_litter", "default:dirt_with_rainforest_litter", "default:dirt_with_snow", "default:snow",
  301. "default:permafrost_with_stones", "default:sand", "default:dirt_with_grass"},
  302. biomes = {"icesheet_ocean", "tundra", "tundra_ocean", "taiga", "rainforest_ocean",
  303. --"taiga_ocean", "coniferous_forest", "coniferous_forest_ocean", "cold_desert_ocean",
  304. "underground"},
  305. sidelen = 5,
  306. fill_ratio = 0.0000000000000001,
  307. schematic = ufowreck_schematic_2,
  308. rotation = rotx,
  309. y_min = -20,
  310. y_max = 31000,
  311. flags = {place_center_z = true, place_center_x = true},
  312. })
  313. minetest.register_decoration({
  314. deco_type = "schematic",
  315. place_on = {"default:stone", "default:dirt_with_coniferous_litter", "default:dirt_with_rainforest_litter", "default:dirt_with_snow", "default:snow",
  316. "default:permafrost_with_stones", "default:sand", "default:dirt_with_grass"},
  317. biomes = {--"icesheet_ocean", "tundra", "tundra_ocean", "taiga",
  318. "taiga_ocean", "coniferous_forest", "coniferous_forest_ocean", "cold_desert_ocean",
  319. "underground"},
  320. sidelen = 5,
  321. fill_ratio = 0.0000000000000001,
  322. schematic = ufowreck_schematic_3,
  323. rotation = rotx,
  324. y_min = -20,
  325. y_max = 31000,
  326. flags = {place_center_z = true, place_center_x = true},
  327. })