fireball.lua 1019 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. armor.notify_punch_reason({reason="fireball"})
  9. player:punch(self.object, 1.0, {
  10. full_punch_interval = 1.0,
  11. damage_groups = {fireball = 8*500},
  12. }, nil)
  13. end,
  14. hit_mob = function(self, target)
  15. local puncher
  16. if self.owner_obj and self.owner_obj:get_pos() then
  17. puncher = self.owner_obj
  18. else
  19. puncher = self.object
  20. end
  21. target:punch(puncher, 1.0, {
  22. full_punch_interval = 1.0,
  23. damage_groups = {fireball = 8*500},
  24. }, nil)
  25. end,
  26. -- Node hit, bursts into flame.
  27. hit_node = function(self, pos, node)
  28. -- The tnt explosion function respects protection perfectly (MustTest).
  29. tnt.boom(pos, {
  30. radius = 2,
  31. ignore_protection = false,
  32. ignore_on_blast = false,
  33. damage_radius = 3,
  34. disable_drops = true,
  35. mob = "griefer:elite_griefer",
  36. })
  37. end
  38. })