invader.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. mobs:spawn({name = "ufowreck:floob",
  2. nodes = {"ufowreck:floob_spawner"},
  3. active_object_count = 2,
  4. chance = 1,
  5. interval = 1,
  6. })
  7. mobs:register_mob("ufowreck:floob", {
  8. type = "monster",
  9. passive = false,
  10. attack_type = "shoot",
  11. attack_animals = true;
  12. attack_players = true;
  13. shoot_interval = 2.5,
  14. arrow = "ufowreck:rayray",
  15. shoot_offset = 0.5,
  16. damage = 2.5,
  17. hp_min = 12,
  18. hp_max = 50,
  19. armor = 100,
  20. collisionbox = {-0.5, -0.01, -0.5, 0.5, 2.2, 0.5},
  21. rotate = 180,
  22. visual = "mesh",
  23. mesh = "amcaw_floob.b3d",
  24. textures = {
  25. {"amcaw_floob.png"},
  26. },
  27. visual_size = {x=4, y=4},
  28. makes_footstep_sound = true,
  29. sounds = {
  30. shoot_attack = "blaster_long",
  31. death = "amcaw_floobdeath",
  32. },
  33. walk_velocity = 1,
  34. run_velocity = 1.5,
  35. jump = true,
  36. floats = 1,
  37. view_range = 20,
  38. drops = {
  39. {name = "ufowreck:broken_raygun",
  40. chance = 3, min = 0, max = 1,},
  41. },
  42. water_damage = 0,
  43. fear_height = 6,
  44. lava_damage = 1,
  45. light_damage = 0,
  46. animation = {
  47. speed_normal = 25, speed_run = 30,
  48. stand_start = 40, stand_end = 80,
  49. walk_start = 0, walk_end = 40,
  50. run_start = 0, run_end = 40,
  51. },
  52. })
  53. -- raygun arrow (weapon)
  54. mobs:register_arrow("ufowreck:rayray", {
  55. visual = "sprite",
  56. visual_size = {x = 0.5, y = 0.5},
  57. textures = {"amcaw_rayray.png"},
  58. velocity = 6,
  59. hit_player = function(self, player)
  60. player:punch(self.object, 1.0, {
  61. full_punch_interval = 1.0,
  62. damage_groups = {fleshy = 2},
  63. }, nil)
  64. end,
  65. hit_mob = function(self, player)
  66. player:punch(self.object, 1.0, {
  67. full_punch_interval = 1.0,
  68. damage_groups = {fleshy = 2},
  69. }, nil)
  70. end,
  71. hit_node = function(self, pos, node)
  72. end
  73. })
  74. mobs:register_egg("ufowreck:floob", "floob", "amcaw_a_floob_inv.png", 0)
  75. minetest.register_node("ufowreck:floob_spawner", {
  76. description = "Alien Metal Block",
  77. tiles = {"scifi_nodes_lighttop.png"},
  78. drawtype = "nodebox",
  79. paramtype2 = "facedir",
  80. paramtype = "light",
  81. sunlight_propagates = true,
  82. is_ground_content = false,
  83. groups = {cracky = 2, not_in_creative_inventory = 1},
  84. drop = {
  85. items = {
  86. {items = {'ufowreck:alien_metal'}},
  87. }
  88. },
  89. sounds = default.node_sound_metal_defaults(),
  90. })
  91. minetest.register_craft({
  92. output = "ufowreck:floob_spawner",
  93. recipe = {
  94. {"ufowreck:alien_metal", "", ""},
  95. {"", "", ""},
  96. {"", "", "ufowreck:eye"}
  97. }
  98. })