Animal mobs for Mobs Redo on Minetest https://content.minetest.net/packages/TenPlus1/mobs_animal/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.5KB

  1. local S = mobs.intllib
  2. -- Warthog originally by KrupnoPavel, B3D model by sirrobzeroone
  3. mobs:register_mob("mobs_animal:pumba", {
  4. stepheight = 0.6,
  5. type = "animal",
  6. passive = false,
  7. attack_type = "dogfight",
  8. group_attack = true,
  9. owner_loyal = true,
  10. attack_npcs = false,
  11. reach = 2,
  12. damage = 2,
  13. hp_min = 5,
  14. hp_max = 15,
  15. armor = 200,
  16. collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.95, 0.4},
  17. visual = "mesh",
  18. mesh = "mobs_pumba.b3d",
  19. textures = {
  20. {"mobs_pumba.png"},
  21. },
  22. makes_footstep_sound = true,
  23. sounds = {
  24. random = "mobs_pig",
  25. attack = "mobs_pig_angry",
  26. },
  27. walk_velocity = 2,
  28. run_velocity = 3,
  29. jump = true,
  30. jump_height = 6,
  31. pushable = true,
  32. follow = {"default:apple", "farming:potato"},
  33. view_range = 10,
  34. drops = {
  35. {name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
  36. },
  37. water_damage = 0,
  38. lava_damage = 5,
  39. light_damage = 0,
  40. fear_height = 2,
  41. animation = {
  42. speed_normal = 15,
  43. stand_start = 25,
  44. stand_end = 55,
  45. walk_start = 70,
  46. walk_end = 100,
  47. punch_start = 70,
  48. punch_end = 100,
  49. },
  50. on_rightclick = function(self, clicker)
  51. if mobs:feed_tame(self, clicker, 8, true, true) then return end
  52. if mobs:protect(self, clicker) then return end
  53. if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end
  54. end,
  55. })
  56. local spawn_on = {"default:dirt_with_grass"}
  57. local spawn_by = {"group:grass"}
  58. if minetest.get_mapgen_setting("mg_name") ~= "v6" then
  59. spawn_on = {"default:dirt_with_dry_grass"}
  60. spawn_by = {"group:dry_grass"}
  61. end
  62. if minetest.get_modpath("ethereal") then
  63. spawn_on = {"ethereal:mushroom_dirt"}
  64. spawn_by = {"flowers:mushroom_brown", "flowers:mushroom_brown"}
  65. end
  66. mobs:spawn({
  67. name = "mobs_animal:pumba",
  68. nodes = spawn_on,
  69. neighbors = spawn_by,
  70. min_light = 14,
  71. interval = 60,
  72. chance = 8000, -- 15000
  73. min_height = 0,
  74. max_height = 200,
  75. day_toggle = true,
  76. })
  77. mobs:register_egg("mobs_animal:pumba", S("Warthog"), "mobs_pumba_inv.png")
  78. mobs:alias_mob("mobs:pumba", "mobs_animal:pumba") -- compatibility
  79. -- raw porkchop
  80. minetest.register_craftitem(":mobs:pork_raw", {
  81. description = S("Raw Porkchop"),
  82. inventory_image = "mobs_pork_raw.png",
  83. on_use = minetest.item_eat(4),
  84. groups = {food_meat_raw = 1, food_pork_raw = 1, flammable = 2},
  85. })
  86. -- cooked porkchop
  87. minetest.register_craftitem(":mobs:pork_cooked", {
  88. description = S("Cooked Porkchop"),
  89. inventory_image = "mobs_pork_cooked.png",
  90. on_use = minetest.item_eat(8),
  91. groups = {food_meat = 1, food_pork = 1, flammable = 2},
  92. })
  93. minetest.register_craft({
  94. type = "cooking",
  95. output = "mobs:pork_cooked",
  96. recipe = "mobs:pork_raw",
  97. cooktime = 5,
  98. })