mese_monster.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. local S = mobs.intllib
  2. -- Mese Monster by Zeg9
  3. mobs:register_mob("mobs_monster:mese_monster", {
  4. type = "monster",
  5. passive = false,
  6. damage = 3,
  7. attack_type = "shoot",
  8. shoot_interval = 0.5,
  9. arrow = "mobs_monster:mese_arrow",
  10. shoot_offset = 2,
  11. hp_min = 10,
  12. hp_max = 25,
  13. armor = 80,
  14. collisionbox = {-0.5, -1.5, -0.5, 0.5, 0.5, 0.5},
  15. visual = "mesh",
  16. mesh = "zmobs_mese_monster.x",
  17. textures = {
  18. {"zmobs_mese_monster.png"},
  19. },
  20. blood_texture = "default_mese_crystal_fragment.png",
  21. makes_footstep_sound = false,
  22. sounds = {
  23. random = "mobs_mesemonster",
  24. },
  25. view_range = 10,
  26. walk_velocity = 0.5,
  27. run_velocity = 2,
  28. jump = true,
  29. jump_height = 8,
  30. fall_damage = 0,
  31. fall_speed = -6,
  32. stepheight = 2.1,
  33. drops = {
  34. {name = "default:mese_crystal", chance = 9, min = 0, max = 2},
  35. {name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 2},
  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. if not mobs.custom_spawn_monster then
  54. mobs:spawn({
  55. name = "mobs_monster:mese_monster",
  56. nodes = {"default:stone"},
  57. max_light = 7,
  58. chance = 5000,
  59. active_object_count = 1,
  60. max_height = -20,
  61. })
  62. end
  63. mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1)
  64. mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") -- compatiblity
  65. -- mese arrow (weapon)
  66. mobs:register_arrow("mobs_monster:mese_arrow", {
  67. visual = "sprite",
  68. -- visual = "wielditem",
  69. visual_size = {x = 0.5, y = 0.5},
  70. textures = {"default_mese_crystal_fragment.png"},
  71. --textures = {"default:mese_crystal_fragment"},
  72. velocity = 6,
  73. -- rotate = 180,
  74. hit_player = function(self, player)
  75. player:punch(self.object, 1.0, {
  76. full_punch_interval = 1.0,
  77. damage_groups = {fleshy = 2},
  78. }, nil)
  79. end,
  80. hit_mob = function(self, player)
  81. player:punch(self.object, 1.0, {
  82. full_punch_interval = 1.0,
  83. damage_groups = {fleshy = 2},
  84. }, nil)
  85. end,
  86. hit_node = function(self, pos, node)
  87. end
  88. })
  89. -- 9x mese crystal fragments = 1x mese crystal
  90. minetest.register_craft({
  91. output = "default:mese_crystal",
  92. recipe = {
  93. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  94. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  95. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  96. }
  97. })