lava.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. fire_damage = 0,
  37. replace_rate = 2,
  38. replace_what = {
  39. {"air", "fire:basic_flame", 0},
  40. },
  41. animation = {
  42. idle_start = 0,
  43. idle_end = 19,
  44. move_start = 21,
  45. move_end = 41,
  46. fall_start = 42,
  47. fall_end = 62,
  48. jump_start = 63,
  49. jump_end = 83
  50. },
  51. do_custom = function(self)
  52. --tmw_slimes.animate(self)
  53. tmw_slimes.absorb_nearby_items(self)
  54. self.stomach = nil
  55. end,
  56. -- Nope, sorry. This is a lava slime. Your items are GONE.
  57. --[[on_die = function(self, pos)
  58. tmw_slimes.drop_items(self, pos)
  59. end]]
  60. })
  61. minetest.registered_entities["tmw_slimes:lava_slime"].glow = 10
  62. minetest.override_item("tmw_slimes:lava_goo", {on_use = minetest.item_eat(-20)})
  63. local g = table.copy(minetest.registered_nodes["tmw_slimes:lava_goo_block"].groups)
  64. g.harmful_slime = tmw_slimes.strong_dmg
  65. minetest.override_item("tmw_slimes:lava_goo_block", {groups=table.copy(g)})
  66. mobs:spawn({
  67. name = "tmw_slimes:lava_slime",
  68. nodes = {
  69. "group:lava",
  70. },
  71. min_light = 0,
  72. max_light = 16,
  73. chance = tmw_slimes.pervasive,
  74. active_object_count = tmw_slimes.pervasive_max,
  75. min_height = -31000,
  76. max_height = 31000,
  77. })