dm.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. mobs.register_mob("dm:dm", {
  2. description = "Dungeon Master",
  3. type = "monster",
  4. passive = false,
  5. damage = 4,
  6. armor_level = 3,
  7. attack_type = "dogshoot",
  8. dogshoot_switch = 1,
  9. dogshoot_count_max = 10,
  10. reach = 3,
  11. shoot_interval = 2.5,
  12. attack_animals = true,
  13. arrow = "dm:fireball",
  14. shoot_offset = 1,
  15. hp_min = 12,
  16. hp_max = 32,
  17. armor = 60,
  18. collisionbox = {-0.7, -1, -0.7, 0.7, 1.6, 0.7},
  19. visual = "mesh",
  20. mesh = "dm_dm.b3d",
  21. textures = {
  22. {"dm_dm1.png"},
  23. {"dm_dm2.png"},
  24. {"dm_dm3.png"},
  25. },
  26. makes_footstep_sound = true,
  27. sounds = {
  28. random = "dm_dm",
  29. shoot_attack = "dm_fireball",
  30. },
  31. walk_velocity = 1,
  32. run_velocity = 3,
  33. jump = true,
  34. view_range = 30,
  35. drops = {
  36. {name = "default:mese_crystal_fragment", chance = 1, min = 1, max = 5},
  37. {name = "default:diamond", chance = 5, min = 1, max = 5},
  38. {name = "default:mese_crystal", chance = 4, min = 1, max = 3},
  39. {name = "default:diamondblock", chance = 30, min = 1, max = 3},
  40. {name = "default:mese", chance = 30, min = 1, max = 4},
  41. },
  42. water_damage = 5,
  43. lava_damage = 1,
  44. light_damage = 0,
  45. fear_height = 3,
  46. animation = {
  47. stand_start = 0,
  48. stand_end = 19,
  49. walk_start = 20,
  50. walk_end = 35,
  51. punch_start = 36,
  52. punch_end = 48,
  53. shoot_start = 36,
  54. shoot_end = 48,
  55. speed_normal = 15,
  56. speed_run = 15,
  57. },
  58. makes_bones_in_lava = false,
  59. })
  60. mobs.register_arrow("dm:fireball", {
  61. visual = "sprite",
  62. visual_size = {x = 1, y = 1},
  63. textures = {"dm_fireball.png"},
  64. velocity = 8,
  65. -- Direct hit, no fire ... just plenty of pain.
  66. hit_player = function(self, player)
  67. player:punch(self.object, 1.0, {
  68. full_punch_interval = 1.0,
  69. damage_groups = {fleshy = 8},
  70. }, nil)
  71. end,
  72. hit_mob = function(self, player)
  73. local puncher
  74. if self.owner_obj and self.owner_obj:get_pos() then
  75. puncher = self.owner_obj
  76. else
  77. puncher = self.object
  78. end
  79. player:punch(puncher, 1.0, {
  80. full_punch_interval = 1.0,
  81. damage_groups = {fleshy = 8},
  82. }, nil)
  83. end,
  84. -- Node hit, bursts into flame.
  85. hit_node = function(self, pos, node)
  86. -- The tnt explosion function respects protection perfectly (MustTest).
  87. tnt.boom(pos, {
  88. radius = 2,
  89. ignore_protection = false,
  90. ignore_on_blast = false,
  91. damage_radius = 3,
  92. disable_drops = true,
  93. mob = "dm:dm", -- Launched by this mob type. Thus blast will not damage mobs of this type.
  94. })
  95. end
  96. })
  97. mobs.register_egg("dm:dm", "Dungeon Master", "fire_basic_flame.png", 1, true)
  98. mobs.alias_mob("mobs:dungeon_master", "dm:dm")
  99. mobs.alias_mob("mobs_monster:dungeon_master", "dm:dm")