init.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. local mob_drops = {
  2. {name = 'default:mese_shard', chance = 3, min = 1, max = 2},
  3. {name = 'default:steel', chance = 4, min = 1, max = 2},
  4. {name = 'default:iron_lump', chance = 2, min = 1, max = 2},
  5. {name = 'default:meselamp', chance = 3, min = 1, max = 2},
  6. {name = 'default:mese_crystal', chance = 6, min = 1, max = 1},
  7. {name = 'default:diamond', chance = 5, min = 1, max = 1},
  8. {name = 'default:diamond_block', chance = 20, min = 1, max = 1},
  9. {name = 'stations:scroll_lifeforce_potion', chance = 15, min = 0, max = 1},
  10. {name = 'maxhp:lifeforce6', chance = 20, min = 1, max = 1},
  11. }
  12. local viron_queen_drops = {
  13. {name = 'default:mese_shard', chance = 3, min = 1, max = 2},
  14. {name = 'default:steel', chance = 4, min = 1, max = 2},
  15. {name = 'default:iron_lump', chance = 2, min = 1, max = 2},
  16. {name = 'default:meselamp', chance = 3, min = 1, max = 6},
  17. {name = 'default:mese_crystal', chance = 3, min = 1, max = 5},
  18. {name = 'default:diamond', chance = 2, min = 1, max = 2},
  19. {name = 'default:diamond_block', chance = 2, min = 1, max = 3},
  20. {name = 'stations:scroll_lifeforce_potion', chance = 5, min = 0, max = 1},
  21. {name = 'maxhp:lifeforce6', chance = 20, min = 1, max = 1},
  22. }
  23. local viron_selection_box = {-0.3, -0.3, -0.3, 0.3, 1.5, 0.3}
  24. local viron_visual_size = {x = 1, y = 1}
  25. mobs:register_mob('viron:viron_mob', {
  26. type = 'monster',
  27. hp_min = 25,
  28. hp_max = 80,
  29. armor = 75,
  30. passive = false,
  31. walk_velocity = 4,
  32. stand_chance = 60,
  33. walk_chance = 10,
  34. jump = true,
  35. jump_height = 8,
  36. run_velocity = 6,
  37. stepheight = 1.6,
  38. stay_near = {
  39. nodes = {'asteroid:diamondore', 'asteroid:meseore',},
  40. },
  41. pushable = true,
  42. view_range = 15,
  43. damage = 15,
  44. damage_max = 30,
  45. damage_chance = 120,
  46. knock_back = true,
  47. fear_height = 10,
  48. water_damage = 0,
  49. lava_damage = 0,
  50. light_damage = 0,
  51. suffocation = false,
  52. floats = false,
  53. follow = {
  54. 'default:diamond',
  55. 'default:mese_crystal',
  56. },
  57. reach = 2,
  58. attack_chance = 70,
  59. attack_monsters = false,
  60. attack_animals = true,
  61. attack_npcs = true,
  62. attack_players = true,
  63. group_attack = true,
  64. attack_type = 'dogfight',
  65. blood_texture = 'viron_blood.png',
  66. pathfinding = 1,
  67. makes_footstep_sound = false,
  68. sounds = {
  69. distance = 20,
  70. random = 'viron_viron_talk',
  71. war_cry = 'viron_viron_angry',
  72. attack = 'viron_viron_hit',
  73. damage = 'viron_viron_angry',
  74. death = 'viron_viron_die',
  75. jump = 'viron_viron_talk',
  76. },
  77. drops = mob_drops,
  78. visual = 'mesh',
  79. collisionbox = {-0.3, -0.5, -0.3, 0.3, 1.5, 0.3},
  80. mesh = 'viron_viron_mob.b3d',
  81. textures = {
  82. {'viron_viron_texture.png'}, {'viron_viron_texture1.png'}, {'viron_viron_texture2.png'},
  83. },
  84. glow = 10,
  85. animation = {
  86. stand_start = 40,
  87. stand_end = 85,
  88. stand_speed = 10,
  89. stand1_start = 87,
  90. stand1_end = 100,
  91. stand1_speed = 10,
  92. stand2_start = 103,
  93. stand2_end = 145,
  94. stand2_speed = 10,
  95. stand3_start = 140,
  96. stand3_end = 170,
  97. stand3_speed = 5,
  98. stand3_loop = false,
  99. walk_start = 0,
  100. walk_end = 30,
  101. walk_speed = 30,
  102. run_start = 0,
  103. run_end = 30,
  104. run_speed = 50,
  105. punch_start = 170,
  106. punch_end = 200,
  107. punch_speed = 27,
  108. },
  109. on_die = function(self, pos)
  110. local num = math.random(0, 2)
  111. for i=1,num do
  112. minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, 'viron:viron_larve')
  113. end
  114. end,
  115. })
  116. mobs:spawn({
  117. name = 'viron:viron_mob',
  118. nodes = {'asteroid:redstone', 'asteroid:stone', 'asteroid:gravel', 'asteroid:redgravel'},
  119. chance = 7,
  120. interval = 30,
  121. active_object_count = 3,
  122. min_height = 5000,
  123. max_height = 7000,
  124. })
  125. --mobs:register_egg('viron:viron_mob', 'Viron', 'viron_viron_egg.png', 1)
  126. --Queen
  127. mobs:register_mob('viron:viron_queen', {
  128. type = 'monster',
  129. hp_min = 100,
  130. hp_max = 600,
  131. armor = 80,
  132. passive = false,
  133. walk_velocity = 5,
  134. stand_chance = 60,
  135. walk_chance = 10,
  136. fall_speed = -4,
  137. jump = true,
  138. jump_height = 40,
  139. run_velocity = 10,
  140. stepheight = 20,
  141. stay_near = {
  142. nodes = {'asteroid:diamondore', 'asteroid:meseore',},
  143. },
  144. pushable = true,
  145. view_range = 15,
  146. damage = 10,
  147. damage_chance = 250,
  148. knock_back = true,
  149. fear_height = 20,
  150. water_damage = 0,
  151. lava_damage = 0,
  152. light_damage = 0,
  153. suffocation = false,
  154. floats = false,
  155. follow = {
  156. 'default:diamond',
  157. 'default:mese_crystal',
  158. },
  159. reach = 4,
  160. attack_chance = 70,
  161. attack_monsters = false,
  162. attack_animals = true,
  163. attack_npcs = true,
  164. attack_players = true,
  165. group_attack = true,
  166. attack_type = 'dogfight',
  167. blood_texture = 'viron_blood.png',
  168. pathfinding = 1,
  169. makes_footstep_sound = false,
  170. sounds = {
  171. distance = 25,
  172. random = 'viron_viron_talk',
  173. war_cry = 'viron_viron_angry',
  174. attack = 'viron_viron_hit',
  175. damage = 'viron_viron_angry',
  176. death = 'viron_viron_die',
  177. jump = 'viron_viron_talk',
  178. },
  179. drops = viron_queen_drops,
  180. visual = 'mesh',
  181. visual_size = {
  182. x = viron_visual_size.x * 4,
  183. y = viron_visual_size.y * 4,
  184. },
  185. collisionbox = {
  186. viron_selection_box[1] * 4,
  187. viron_selection_box[2] * 4,
  188. viron_selection_box[3] * 4,
  189. viron_selection_box[4] * 4,
  190. viron_selection_box[5] * 4,
  191. viron_selection_box[6] * 4,
  192. },
  193. selectionbox = {
  194. viron_selection_box[1] * 4,
  195. viron_selection_box[2] * 4,
  196. viron_selection_box[3] * 4,
  197. viron_selection_box[4] * 4,
  198. viron_selection_box[5] * 4,
  199. viron_selection_box[6] * 4,
  200. },
  201. mesh = 'viron_viron_mob.b3d',
  202. textures = {
  203. {'viron_viron_texture.png'}, {'viron_viron_texture1.png'}, {'viron_viron_texture2.png'},
  204. },
  205. glow = 12,
  206. animation = {
  207. stand_start = 40,
  208. stand_end = 85,
  209. stand_speed = 10,
  210. stand1_start = 87,
  211. stand1_end = 100,
  212. stand1_speed = 10,
  213. stand2_start = 103,
  214. stand2_end = 145,
  215. stand2_speed = 10,
  216. stand3_start = 140,
  217. stand3_end = 170,
  218. stand3_speed = 5,
  219. stand3_loop = false,
  220. walk_start = 0,
  221. walk_end = 30,
  222. walk_speed = 30,
  223. run_start = 0,
  224. run_end = 30,
  225. run_speed = 50,
  226. punch_start = 170,
  227. punch_end = 200,
  228. punch_speed = 27,
  229. },
  230. on_die = function(self, pos)
  231. local num = math.random(1, 5)
  232. for i=1,num do
  233. minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, 'viron:viron_mob')
  234. end
  235. end,
  236. })
  237. mobs:spawn({
  238. name = 'viron:viron_queen',
  239. nodes = {'asteroid:redstone', 'asteroid:stone', 'asteroid:gravel', 'asteroid:redgravel'},
  240. chance = 300,
  241. interval = 45,
  242. active_object_count = 2,
  243. min_height = 5000,
  244. max_height = 7000,
  245. })
  246. --mobs:register_egg('viron:viron_queen', 'Viron Queen', 'viron_viron_egg.png', 1)
  247. ------------------------------Larve-----------------------------------------
  248. mobs:register_mob('viron:viron_larve', {
  249. type = 'monster',
  250. hp_min = 10,
  251. hp_max = 40,
  252. armor = 80,
  253. passive = false,
  254. walk_velocity = 2,
  255. stand_chance = 10,
  256. walk_chance = 60,
  257. jump = true,
  258. jump_height = 10,
  259. run_velocity = 5,
  260. fall_speed = -3,
  261. stepheight = 10,
  262. pushable = true,
  263. view_range = 15,
  264. damage = 15,
  265. damage_max = 15,
  266. damage_chance = 80,
  267. knock_back = true,
  268. fear_height = 20,
  269. water_damage = 0,
  270. lava_damage = 0,
  271. light_damage = 0,
  272. suffocation = false,
  273. floats = false,
  274. follow = {
  275. 'default:diamond',
  276. 'default:mese_crystal',
  277. },
  278. reach = 1,
  279. attack_chance = 10,
  280. attack_monsters = false,
  281. attack_animals = true,
  282. attack_npcs = true,
  283. attack_players = false,
  284. runaway = true,
  285. group_attack = false,
  286. attack_type = 'dogfight',
  287. blood_texture = 'viron_blood.png',
  288. pathfinding = 1,
  289. makes_footstep_sound = false,
  290. sounds = {
  291. distance = 25,
  292. random = 'viron_viron_talk',
  293. war_cry = 'viron_viron_angry',
  294. attack = 'viron_viron_hit',
  295. damage = 'viron_viron_angry',
  296. death = 'viron_viron_die',
  297. jump = 'viron_viron_talk',
  298. },
  299. visual = 'mesh',
  300. visual_size = {
  301. x = viron_visual_size.x * .5,
  302. y = viron_visual_size.y * .5,
  303. },
  304. collisionbox = {
  305. viron_selection_box[1] * .5,
  306. viron_selection_box[2] * .5,
  307. viron_selection_box[3] * .5,
  308. viron_selection_box[4] * .5,
  309. viron_selection_box[5] * .5,
  310. viron_selection_box[6] * .5,
  311. },
  312. selectionbox = {
  313. viron_selection_box[1] * .5,
  314. viron_selection_box[2] * .5,
  315. viron_selection_box[3] * .5,
  316. viron_selection_box[4] * .5,
  317. viron_selection_box[5] * .5,
  318. viron_selection_box[6] * .5,
  319. },
  320. mesh = 'viron_viron_mob.b3d',
  321. textures = {
  322. {'viron_viron_texture.png'}, {'viron_viron_texture1.png'}, {'viron_viron_texture2.png'},
  323. },
  324. glow = 12,
  325. animation = {
  326. stand_start = 40,
  327. stand_end = 85,
  328. stand_speed = 10,
  329. stand1_start = 87,
  330. stand1_end = 100,
  331. stand1_speed = 10,
  332. stand2_start = 103,
  333. stand2_end = 145,
  334. stand2_speed = 10,
  335. stand3_start = 140,
  336. stand3_end = 170,
  337. stand3_speed = 5,
  338. stand3_loop = false,
  339. walk_start = 0,
  340. walk_end = 30,
  341. walk_speed = 30,
  342. run_start = 0,
  343. run_end = 30,
  344. run_speed = 50,
  345. punch_start = 170,
  346. punch_end = 200,
  347. punch_speed = 27,
  348. },
  349. do_custom = function(self,dtime)
  350. -- 20 sec timer, wait to grow the mob until it has been alive for 60 sec
  351. self.grow_timer = (self.grow_timer or 0) + dtime
  352. if self.grow_timer < 20 then
  353. return
  354. end
  355. local pos = self.object:get_pos()
  356. --if the code has gotten to here, the viron_larve has been alive for more than 60 second
  357. --so now we grow the mob by removing (killing) it and placing a viron.
  358. minetest.add_entity({x=pos.x, y=pos.y+1, z=pos.z}, 'viron:viron_mob')
  359. self.object:remove()
  360. return false
  361. end,
  362. })