dark.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. damage = tmw_slimes.deadly_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_land.b3d",
  18. blood_texture = "tmw_slime_goo.png^[colorize:"..tmw_slimes.colors["dark"],
  19. textures = {
  20. {"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"]},
  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_in = {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"},
  29. drops = {
  30. {name = "tmw_slimes:dark_goo", chance = 1, min = 0, max = 2},
  31. },
  32. water_damage = 0,
  33. lava_damage = 0,
  34. light_damage = 1,
  35. animation = {
  36. idle_start = 0,
  37. idle_end = 20,
  38. move_start = 21,
  39. move_end = 41,
  40. fall_start = 42,
  41. fall_end = 62,
  42. jump_start = 63,
  43. jump_end = 83
  44. },
  45. do_custom = function(self)
  46. tmw_slimes.animate(self)
  47. tmw_slimes.absorb_nearby_items(self)
  48. end,
  49. on_die = function(self, pos)
  50. tmw_slimes.drop_items(self, pos)
  51. end
  52. })
  53. minetest.override_item("tmw_slimes:dark_goo", {on_use = function(item, player, ...)
  54. if tmw_slimes.poisoned_players then
  55. tmw_slimes.poisoned_players[player:get_player_name()] = 3
  56. minetest.item_eat(-5)(item, player,...)
  57. else
  58. minetest.item_eat(-20)(item, player,...)
  59. end
  60. end})
  61. if minetest.get_modpath("mythology") then
  62. minetest.register_craft({
  63. type = "cooking",
  64. output = "mythology:evil_matter",
  65. recipe = "tmw_slimes:dark_goo_block",
  66. cooktime = 40
  67. })
  68. end
  69. local g = table.copy(minetest.registered_nodes["tmw_slimes:dark_goo_block"].groups)
  70. g.harmful_slime = tmw_slimes.medium_dmg
  71. minetest.override_item("tmw_slimes:dark_goo_block", {groups=table.copy(g)})
  72. mobs:spawn({
  73. name = "tmw_slimes:dark_slime",
  74. nodes = {
  75. "default:stone"
  76. },
  77. min_light = 0,
  78. max_light = 16,
  79. chance = tmw_slimes.rare,
  80. active_object_count = tmw_slimes.rare_max,
  81. min_height = -31000,
  82. max_height = -1000,
  83. })