masticone.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. mobs:register_mob("nssm:masticone", {
  2. type = "monster",
  3. hp_max = 25,
  4. hp_min = 24,
  5. collisionbox = {-0.45, 0.00, -0.45, 0.45, 0.40, 0.45},
  6. visual = "mesh",
  7. mesh = "masticone.x",
  8. textures = {
  9. {"masticone.png"}
  10. },
  11. visual_size = {x = 4, y = 4},
  12. makes_footstep_sound = true,
  13. view_range = 15,
  14. lifetimer = 500,
  15. fear_height = 4,
  16. rotate = 270,
  17. walk_velocity = 1.5,
  18. run_velocity = 2.5,
  19. sounds = {
  20. random = "masticone",
  21. },
  22. damage = 5,
  23. jump = true,
  24. drops = {
  25. {name = "nssm:life_energy", chance = 1, min = 7, max = 8},
  26. {name = "nssm:masticone_fang", chance = 1, min = 1, max = 2},
  27. {name = "nssm:masticone_skull_fragments", chance = 2, min = 1, max = 2},
  28. },
  29. armor = 60,
  30. drawtype = "front",
  31. water_damage = 0,
  32. lava_damage = 10,
  33. fire_damage = 10,
  34. floats = 0,
  35. light_damage = 0,
  36. group_attack = true,
  37. attack_animals = true,
  38. knock_back = 4,
  39. blood_texture = "nssm_blood_blue.png",
  40. stepheight = 1.1,
  41. attack_type = "dogfight",
  42. reach =1.5,
  43. animation = {
  44. speed_normal = 20,
  45. speed_run = 25,
  46. stand_start = 80,
  47. stand_end = 140,
  48. walk_start = 20,
  49. walk_end = 40,
  50. run_start = 20,
  51. run_end = 40,
  52. punch_start = 150,
  53. punch_end = 180,
  54. },
  55. on_die = function(self, pos)
  56. self.object:remove()
  57. core.after(2, function()
  58. minetest.add_particlespawner({
  59. amount = 200,
  60. time = 0.1,
  61. minpos = {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
  62. maxpos = {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
  63. minvel = {x = -0, y = -0, z = -0},
  64. maxvel = {x = 1, y = 1, z = 1},
  65. minacc = {x = -0.5, y = 5, z = -0.5},
  66. maxacc = {x = 0.5, y = 5, z = 0.5},
  67. minexptime = 0.1,
  68. maxexptime = 1,
  69. minsize = 3,
  70. maxsize = 4,
  71. collisiondetection = false,
  72. texture = "tnt_smoke.png"
  73. })
  74. for i = 1, 2 do
  75. local pos = {
  76. x = pos.x + math.random(-1, 1),
  77. y = pos.y + 0.5,
  78. z = pos.z + math.random(-1, 1)
  79. }
  80. local n = minetest.get_node(pos).name
  81. if n == "air" then
  82. minetest.add_entity(pos, "nssm:masticone")
  83. end
  84. end
  85. end)
  86. end,
  87. })