dm.lua 2.3 KB

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