lava_titan.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. mobs:register_mob("nssm:lava_titan", {
  2. type = "monster",
  3. hp_max = 180,
  4. hp_min = 180,
  5. collisionbox = {-0.45, -0.05, -0.45, 0.45, 1.8, 0.45},
  6. visual = "mesh",
  7. mesh = "lava_titan.x",
  8. textures = {
  9. {"lava_titan.png"}
  10. },
  11. visual_size = {x = 2.7, y = 2.7},
  12. makes_footstep_sound = true,
  13. view_range = 20,
  14. fear_height = 4,
  15. lifetimer = 500,
  16. walk_velocity = 0.5,
  17. run_velocity = 1.3,
  18. floats = 1,
  19. sounds = {
  20. random = "lava_titan",
  21. },
  22. damage = 8,
  23. jump = false,
  24. jump_height = 0,
  25. drops = {
  26. {name = "nssm:life_energy", chance = 1, min = 7, max = 9},
  27. {name = "nssm:lava_titan_eye", chance = 1, min = 1, max = 1},
  28. {name = "bucket:bucket_lava", chance = 2, min = 1, max = 3},
  29. },
  30. armor = 20,
  31. drawtype = "front",
  32. water_damage = 25,
  33. rotate = 270,
  34. light_damage = 0,
  35. lava_damage = 0,
  36. fire_damage = 0,
  37. floats = 0,
  38. blood_texture = "stone_blood.png",
  39. blood_amount = 50,
  40. knock_back = 0,
  41. attack_type = "dogshoot",
  42. dogshoot_switch = true,
  43. arrow = "nssm:lava_arrow",
  44. shoot_interval = 2,
  45. shoot_offset = 0,
  46. --[[
  47. on_dist_attack = function(self, player)
  48. local pos = player:get_pos()
  49. for dy=-1, 6, 1 do
  50. for dx=-1, 1, 2 do
  51. for dz=-1, 1, 2 do
  52. local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
  53. local n = minetest.get_node(p).name
  54. if n~="default:lava_flowing" and not minetest.is_protected(p, "") then
  55. minetest.set_node(p, {name="default:lava_flowing"})
  56. end
  57. end
  58. end
  59. end
  60. end,
  61. ]]
  62. animation = {
  63. speed_normal = 25,
  64. speed_run = 45,
  65. stand_start = 120,
  66. stand_end = 300,
  67. walk_start = 10,
  68. walk_end = 110,
  69. run_start = 10,
  70. run_end = 110,
  71. punch_start = 301,
  72. punch_end = 340,
  73. shoot_start =340,
  74. shoot_end=400,
  75. },
  76. do_custom = function (self)
  77. digging_attack(self, nil, self.run_velocity, {x = 0, y = 4, z = 0})
  78. --digging_ability(self, nil, self.run_velocity, {x=0, y=5, z=0})
  79. --putting_ability(self, "default:lava_source", self.run_velocity)
  80. end,
  81. --[[
  82. custom_attack = function (self)
  83. digging_attack
  84. mobs:set_animation(self, "punch")
  85. local p2 = p
  86. local s2 = s
  87. p2.y = p2.y + 1.5
  88. s2.y = s2.y + 1.5
  89. if mobs:line_of_sight(self, p2, s2) == true then
  90. -- play attack sound
  91. if self.sounds.attack then
  92. minetest.sound_play(self.sounds.attack, {
  93. object = self.object,
  94. max_hear_distance = self.sounds.distance
  95. })
  96. end
  97. -- punch player
  98. self.attack:punch(self.object, 1.0, {
  99. full_punch_interval = 1.0,
  100. damage_groups = {fleshy = self.damage}
  101. }, nil)
  102. end
  103. end,
  104. ]]--
  105. })