obsidianmonster.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. mobs.register_mob("obsidianmonster:obsidianmonster", {
  2. type = "monster",
  3. passive = false,
  4. damage = 3,
  5. attack_type = "shoot",
  6. shoot_interval = 1.0,
  7. arrow = "obsidianmonster:arrow",
  8. shoot_offset = 2,
  9. hp_min = 10,
  10. hp_max = 25,
  11. armor = 80,
  12. armor_level = 3,
  13. collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  14. visual = "mesh",
  15. mesh = "obsidianmonster_obsidianmonster.x",
  16. textures = {
  17. {"obsidianmonster_obsidianmonster.png"},
  18. },
  19. blood_texture = "default_obsidian_shard.png",
  20. makes_footstep_sound = false,
  21. sounds = {
  22. random = "obsidianmonster_obsidianmonster",
  23. },
  24. view_range = 16,
  25. walk_velocity = 0.5,
  26. run_velocity = 2,
  27. jump = false,
  28. fly = true,
  29. --jump_height = 8,
  30. fall_damage = 0,
  31. fall_speed = -6,
  32. stepheight = 2.1,
  33. drops = {
  34. {name = "default:obsidian", chance = 2, min = 1, max = 6},
  35. {name = "default:obsidian_shard", chance = 2, min = 1, max = 9},
  36. },
  37. water_damage = 1,
  38. lava_damage = 1,
  39. light_damage = 0,
  40. animation = {
  41. speed_normal = 15,
  42. speed_run = 15,
  43. stand_start = 0,
  44. stand_end = 14,
  45. walk_start = 15,
  46. walk_end = 38,
  47. run_start = 40,
  48. run_end = 63,
  49. punch_start = 40,
  50. punch_end = 63,
  51. },
  52. })
  53. mobs.register_egg("obsidianmonster:obsidianmonster", "Obsidian Monster", "default_obsidian.png", 1)
  54. mobs.alias_mob("mobs:mese_monster", "obsidianmonster:obsidianmonster")
  55. mobs.alias_mob("mobs_monster:mese_monster", "obsidianmonster:obsidianmonster")
  56. mobs.register_arrow("obsidianmonster:arrow", {
  57. visual = "sprite",
  58. visual_size = {x = 0.5, y = 0.5},
  59. textures = {"default_obsidian_shard.png"},
  60. velocity = 10,
  61. hit_player = function(self, player)
  62. player:punch(self.object, 1.0, {
  63. full_punch_interval = 1.0,
  64. damage_groups = {fleshy = 2},
  65. }, nil)
  66. ambiance.sound_play("default_punch", player:get_pos(), 1.0, 20)
  67. end,
  68. hit_mob = function(self, player)
  69. player:punch(self.object, 1.0, {
  70. full_punch_interval = 1.0,
  71. damage_groups = {fleshy = 2},
  72. }, nil)
  73. ambiance.sound_play("default_punch", player:get_pos(), 1.0, 20)
  74. end,
  75. hit_node = function(self, pos, node)
  76. pos = vector.round(pos)
  77. if minetest.test_protection(pos, "") then
  78. return
  79. end
  80. local realnode = minetest.get_node(pos)
  81. -- Do not destroy bones.
  82. if realnode.name == "bones:bones" or realnode.name == "ignore" then
  83. return
  84. end
  85. minetest.add_node(pos, {name="fire:basic_flame"})
  86. end
  87. })