lava.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. mobs:register_mob("tmw_slimes:lava_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.strong_dmg,
  11. hp_min = 20,
  12. hp_max = 40,
  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["lava"],
  19. textures = {
  20. {"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["lava"],"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["lava"].."^[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 = {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"},
  30. drops = {
  31. {name = "tmw_slimes:lava_goo", chance = 1, min = 0, max = 2},
  32. },
  33. water_damage = 10,
  34. lava_damage = 0,
  35. light_damage = 0,
  36. replace_rate = 2,
  37. replace_what = {
  38. {"air", "fire:basic_flame", 0},
  39. },
  40. animation = {
  41. idle_start = 0,
  42. idle_end = 19,
  43. move_start = 21,
  44. move_end = 41,
  45. fall_start = 42,
  46. fall_end = 62,
  47. jump_start = 63,
  48. jump_end = 83
  49. },
  50. do_custom = function(self)
  51. tmw_slimes.animate(self)
  52. tmw_slimes.absorb_nearby_items(self)
  53. self.stomach = nil
  54. end,
  55. -- Nope, sorry. This is a lava slime. Your items are GONE.
  56. --[[on_die = function(self, pos)
  57. tmw_slimes.drop_items(self, pos)
  58. end]]
  59. })
  60. minetest.registered_entities["tmw_slimes:lava_slime"].glow = 10
  61. minetest.override_item("tmw_slimes:lava_goo", {on_use = minetest.item_eat(-20)})
  62. local g = table.copy(minetest.registered_nodes["tmw_slimes:lava_goo_block"].groups)
  63. g.harmful_slime = tmw_slimes.strong_dmg
  64. minetest.override_item("tmw_slimes:lava_goo_block", {groups=table.copy(g)})
  65. mobs:spawn({
  66. name = "tmw_slimes:lava_slime",
  67. nodes = {
  68. "group:lava",
  69. },
  70. min_light = 0,
  71. max_light = 16,
  72. chance = tmw_slimes.pervasive,
  73. active_object_count = tmw_slimes.pervasive_max,
  74. min_height = -31000,
  75. max_height = 31000,
  76. })