alien.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. mobs:register_mob("tmw_slimes:alien_slime", {
  2. group_attack = true,
  3. type = "monster",
  4. passive = false,
  5. attack_animals = true,
  6. attack_npcs = true,
  7. attack_monsters = false,
  8. attack_type = "dogfight",
  9. reach = 2,
  10. damage = tmw_slimes.deadly_dmg,
  11. hp_min = 40,
  12. hp_max = 80,
  13. armor = 180,
  14. collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.4, 0.2},
  15. visual_size = {x = 2, y = 2},
  16. visual = "mesh",
  17. mesh = "slime_liquid.b3d",
  18. blood_texture = "tmw_slime_goo.png^[colorize:"..tmw_slimes.colors["alien"],
  19. textures = {
  20. {"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["alien"],"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["alien"].."^[colorize:#FFF:96"},
  21. },
  22. makes_footstep_sound = false,
  23. walk_velocity = 0.5,
  24. run_velocity = 1.25,
  25. jump_height = 7,
  26. jump = true,
  27. view_range = 15,
  28. fly = true,
  29. fly_in = {"air", "asteroid:atmos", "default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"},
  30. drops = {
  31. {name = "tmw_slimes:alien_goo", chance = 1, min = 0, max = 2},
  32. },
  33. water_damage = 0,
  34. lava_damage = 0,
  35. light_damage = 0,
  36. animation = {
  37. idle_start = 0,
  38. idle_end = 20,
  39. move_start = 21,
  40. move_end = 41,
  41. fall_start = 42,
  42. fall_end = 62,
  43. jump_start = 63,
  44. jump_end = 83
  45. },
  46. do_custom = function(self)
  47. --tmw_slimes.animate(self)
  48. tmw_slimes.absorb_nearby_items(self)
  49. end,
  50. on_die = function(self, pos)
  51. tmw_slimes.drop_items(self, pos)
  52. end
  53. })
  54. minetest.override_item("tmw_slimes:alien_goo", {on_use = function(item, player, ...)
  55. if tmw_slimes.poisoned_players then
  56. tmw_slimes.poisoned_players[player:get_player_name()] = 3
  57. minetest.item_eat(-5)(item, player,...)
  58. else
  59. minetest.item_eat(-20)(item, player,...)
  60. end
  61. end})
  62. local g = table.copy(minetest.registered_nodes["tmw_slimes:alien_goo_block"].groups)
  63. g.harmful_slime = tmw_slimes.weak_dmg
  64. minetest.override_item("tmw_slimes:alien_goo_block", {groups=table.copy(g)})
  65. mobs:spawn({
  66. name = "tmw_slimes:alien_slime",
  67. nodes = {
  68. "asteroid:reddust",
  69. "asteroid:dust",
  70. },
  71. min_light = 0,
  72. max_light = 16,
  73. chance = tmw_slimes.common,
  74. active_object_count = tmw_slimes.common_max,
  75. min_height = 20000,
  76. max_height = 31000,
  77. })