mese_monster.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. mobs:spawn({
  54. name = "mobs_monster:mese_monster",
  55. nodes = {"default:stone"},
  56. max_light = 7,
  57. chance = 5000,
  58. active_object_count = 1,
  59. max_height = -20,
  60. })
  61. mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1)
  62. mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") -- compatiblity
  63. -- mese arrow (weapon)
  64. mobs:register_arrow("mobs_monster:mese_arrow", {
  65. visual = "sprite",
  66. -- visual = "wielditem",
  67. visual_size = {x = 0.5, y = 0.5},
  68. textures = {"default_mese_crystal_fragment.png"},
  69. --textures = {"default:mese_crystal_fragment"},
  70. velocity = 6,
  71. -- rotate = 180,
  72. hit_player = function(self, player)
  73. player:punch(self.object, 1.0, {
  74. full_punch_interval = 1.0,
  75. damage_groups = {fleshy = 2},
  76. }, nil)
  77. end,
  78. hit_mob = function(self, player)
  79. player:punch(self.object, 1.0, {
  80. full_punch_interval = 1.0,
  81. damage_groups = {fleshy = 2},
  82. }, nil)
  83. end,
  84. hit_node = function(self, pos, node)
  85. end
  86. })
  87. -- 9x mese crystal fragments = 1x mese crystal
  88. minetest.register_craft({
  89. output = "default:mese_crystal",
  90. recipe = {
  91. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  92. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  93. {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
  94. }
  95. })