fireball.lua 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. mobs.register_arrow(":griefer:fireball", {
  2. visual = "sprite",
  3. visual_size = {x = 1, y = 1},
  4. textures = {"dm_fireball.png"},
  5. velocity = 8,
  6. -- Direct hit, no fire ... just plenty of pain.
  7. hit_player = function(self, player)
  8. player:punch(self.object, 1.0, {
  9. full_punch_interval = 1.0,
  10. damage_groups = {fleshy = 8},
  11. }, nil)
  12. end,
  13. hit_mob = function(self, target)
  14. local puncher
  15. if self.owner_obj and self.owner_obj:get_pos() then
  16. puncher = self.owner_obj
  17. else
  18. puncher = self.object
  19. end
  20. target:punch(puncher, 1.0, {
  21. full_punch_interval = 1.0,
  22. damage_groups = {fleshy = 8},
  23. }, nil)
  24. end,
  25. -- Node hit, bursts into flame.
  26. hit_node = function(self, pos, node)
  27. -- The tnt explosion function respects protection perfectly (MustTest).
  28. tnt.boom(pos, {
  29. radius = 2,
  30. ignore_protection = false,
  31. ignore_on_blast = false,
  32. damage_radius = 3,
  33. disable_drops = true,
  34. mob = "griefer:elite_griefer",
  35. })
  36. end
  37. })