dark.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. mobs:register_mob("tmw_slimes:dark_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. sounds = {random = "steps_in_the_mud_shorter",},
  11. damage = tmw_slimes.stronger_dmg,
  12. hp_min = 20,
  13. hp_max = 40,
  14. armor = 180,
  15. collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.4, 0.2},
  16. visual_size = {x = 2, y = 2},
  17. visual = "mesh",
  18. mesh = "slime_land.b3d",
  19. blood_texture = "tmw_slime_goo.png^[colorize:"..tmw_slimes.colors["dark"],
  20. textures = {
  21. {"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["dark"],"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["dark"],"tmw_slime_goo_block.png^[colorize:"..tmw_slimes.colors["dark"]},
  22. },
  23. makes_footstep_sound = false,
  24. walk_velocity = 0.5,
  25. run_velocity = 1.25,
  26. jump_height = 7,
  27. jump = true,
  28. view_range = 15,
  29. --fly_in = {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"},
  30. drops = {
  31. {name = "tmw_slimes:dark_goo", chance = 1, min = 0, max = 2},
  32. },
  33. water_damage = 0,
  34. lava_damage = 0,
  35. light_damage = 1,
  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:dark_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. if minetest.get_modpath("mythology") then
  63. minetest.register_craft({
  64. type = "cooking",
  65. output = "mythology:evil_matter",
  66. recipe = "tmw_slimes:dark_goo_block",
  67. cooktime = 40
  68. })
  69. end
  70. local g = table.copy(minetest.registered_nodes["tmw_slimes:dark_goo_block"].groups)
  71. g.harmful_slime = tmw_slimes.medium_dmg
  72. minetest.override_item("tmw_slimes:dark_goo_block", {groups=table.copy(g)})
  73. mobs:spawn({
  74. name = "tmw_slimes:dark_slime",
  75. nodes = {
  76. "default:stone"
  77. },
  78. min_light = 0,
  79. max_light = 7,
  80. chance = tmw_slimes.rare,
  81. active_object_count = tmw_slimes.rare_max,
  82. min_height = -31000,
  83. max_height = -1000,
  84. })