puffin.lua 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. local S = minetest.get_translator("animalworld")
  2. mobs:register_mob("animalworld:puffin", {
  3. stepheight = 3,
  4. type = "animal",
  5. passive = true,
  6. attack_type = "dogfight",
  7. attack_animals = false,
  8. reach = 2,
  9. damage = 1,
  10. hp_min = 5,
  11. hp_max = 35,
  12. armor = 100,
  13. collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.5, 0.3},
  14. visual = "mesh",
  15. mesh = "Puffin.b3d",
  16. visual_size = {x = 1.0, y = 1.0},
  17. textures = {
  18. {"texturepuffin.png"},
  19. },
  20. sounds = {
  21. },
  22. makes_footstep_sound = false,
  23. walk_velocity = 5,
  24. run_velocity = 6,
  25. runaway = true,
  26. runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:scorpion", "animalworld:polarbear", "animalworld:leopardseal", "animalworld:stellerseagle", "player", "animalworld:wolf", "animalworld:panda", "animalworld:stingray", "marinaramobs:jellyfish", "marinaramobs:octopus", "livingcavesmobs:biter", "livingcavesmobs:flesheatingbacteria"},
  27. fall_speed = 0,
  28. jump = true,
  29. jump_height = 6,
  30. fly = true,
  31. stepheight = 3,
  32. drops = {
  33. {name = "animalworld:chicken_raw", chance = 1, min = 1, max = 1},
  34. {name = "animalworld:chicken_feather", chance = 1, min = 1, max = 1},
  35. },
  36. water_damage = 0,
  37. lava_damage = 4,
  38. light_damage = 0,
  39. fear_height = 0,
  40. animation = {
  41. speed_normal = 130,
  42. stand_start = 0,
  43. stand_end = 100,
  44. fly_start = 150, -- swim animation
  45. fly_end = 250,
  46. die_start = 100,
  47. die_end = 200,
  48. die_speed = 50,
  49. die_loop = false,
  50. die_rotate = true,
  51. },
  52. fly_in = {"air", "default:water_source", "default:river_water_source"},
  53. floats = 0,
  54. follow = {
  55. "animalworld:rawfish", "mobs:clownfish_raw", "mobs:bluefish_raw", "fishing:bait_worm", "fishing:clownfish_raw", "fishing:bluewhite_raw", "fishing:exoticfish_raw", "fishing:fish_raw", "fishing:carp_raw", "fishing:perch_raw", "xocean:fish_edible"
  56. },
  57. view_range = 4,
  58. on_rightclick = function(self, clicker)
  59. -- feed or tame
  60. if mobs:feed_tame(self, clicker, 4, false, true) then return end
  61. if mobs:protect(self, clicker) then return end
  62. if mobs:capture_mob(self, clicker, 0, 25, 0, false, nil) then return end
  63. end,
  64. })
  65. if minetest.get_modpath("ethereal") then
  66. spawn_on = {"default:snowblock"}, {"default:ice"}, {"ethereal:crystal_dirt"}
  67. end
  68. if not mobs.custom_spawn_animalworld then
  69. mobs:spawn({
  70. name = "animalworld:puffin",
  71. nodes = {"default:snowblock"}, {"default:ice"},
  72. neighbors = {"default:water_source"},
  73. min_light = 0,
  74. interval = 60,
  75. chance = 2000, -- 15000
  76. active_object_count = 2,
  77. min_height = -1,
  78. max_height = 10,
  79. day_toggle = true,
  80. })
  81. end
  82. mobs:register_egg("animalworld:puffin", S("Puffin"), "apuffin.png")