panda.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. local S = minetest.get_translator("animalworld")
  2. mobs:register_mob("animalworld:panda", {
  3. stepheight = 1,
  4. type = "monster",
  5. passive = false,
  6. attack_type = "dogfight",
  7. attack_animals = true,
  8. reach = 2,
  9. damage = 5,
  10. hp_min = 35,
  11. hp_max = 50,
  12. armor = 100,
  13. collisionbox = {-0.6, -0.01, -0.6, 0.6, 0.95, 0.6},
  14. visual = "mesh",
  15. mesh = "Panda.b3d",
  16. visual_size = {x = 1.0, y = 1.0},
  17. textures = {
  18. {"texturepanda.png"},
  19. },
  20. sounds = {
  21. random = "animalworld_bear",
  22. },
  23. makes_footstep_sound = true,
  24. walk_velocity = 1,
  25. run_velocity = 3,
  26. runaway = false,
  27. jump = false,
  28. jump_height = 6,
  29. stepheight = 6,
  30. stay_near = {{"naturalbiomes:bamboo_leaves", "naturalbiomes:bambooforest_groundgrass"}, 5},
  31. drops = {
  32. {name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
  33. {name = "mobs:leather", chance = 1, min = 0, max = 2},
  34. },
  35. water_damage = 0,
  36. lava_damage = 4,
  37. light_damage = 0,
  38. fear_height = 7,
  39. animation = {
  40. speed_normal = 30,
  41. stand_start = 0,
  42. stand_end = 100,
  43. stand1_start = 100,
  44. stand1_end = 200,
  45. stand2_start = 450,
  46. stand2_end = 550,
  47. walk_start = 200,
  48. walk_end = 300,
  49. punch_speed = 100,
  50. punch_start = 300,
  51. punch_end = 400,
  52. die_start = 300,
  53. die_end = 400,
  54. die_speed = 50,
  55. die_loop = false,
  56. die_rotate = true,
  57. },
  58. follow = {
  59. "naturalbiomes:bamboo_leaves", "naturalbiomes:bamboo_sapling"},
  60. view_range = 4,
  61. on_rightclick = function(self, clicker)
  62. -- feed or tame
  63. if mobs:feed_tame(self, clicker, 4, false, true) then return end
  64. if mobs:protect(self, clicker) then return end
  65. if mobs:capture_mob(self, clicker, 0, 0, 25, false, nil) then return end
  66. end,
  67. })
  68. if minetest.get_modpath("ethereal") then
  69. spawn_on = {"ethereal:bamboo_dirt"}
  70. end
  71. if not mobs.custom_spawn_animalworld then
  72. mobs:spawn({
  73. name = "animalworld:panda",
  74. nodes = {"naturalbiomes:bambooforest_litter"},
  75. neighbors = {"naturalbiomes:bambooforest_groundgrass", "naturalbiomes:bambooforest_groundgrass2", "naturalbiomes:bamboo_leaves"},
  76. min_light = 0,
  77. interval = 60,
  78. chance = 2000, -- 15000
  79. min_height = 30,
  80. max_height = 1000,
  81. })
  82. end
  83. mobs:register_egg("animalworld:panda", S("Panda"), "apanda.png")