seahorse.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. local S = minetest.get_translator("animalworld")
  2. mobs:register_mob("animalworld:seahorse", {
  3. stepheight = 0.0,
  4. type = "animal",
  5. passive = true,
  6. attack_type = "dogfight",
  7. attack_animals = false,
  8. reach = 1,
  9. damage = 0,
  10. hp_min = 5,
  11. hp_max = 5,
  12. armor = 100,
  13. collisionbox = {-0.1, 0, -0.1, 0.1, 0.6, 0.1},
  14. visual = "mesh",
  15. mesh = "Seahorse.b3d",
  16. visual_size = {x = 1.0, y = 1.0},
  17. textures = {
  18. {"textureseahorse.png"},
  19. {"textureseahorse2.png"},
  20. },
  21. sounds = {},
  22. makes_footstep_sound = false,
  23. walk_velocity = 0.25,
  24. run_velocity = 0.5,
  25. fly = true,
  26. fly_in = "default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing",
  27. fall_speed = 0,
  28. runaway = true,
  29. 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:divingbeetle", "animalworld:scorpion", "animalworld:polarbear", "animalworld:leopardseal", "animalworld:stellerseagle", "player", "animalworld:wolf", "animalworld:panda", "animalworld:stingray", "marinaramobs:jellyfish", "marinaramobs:octopus", "livingcavesmobs:biter", "livingcavesmobs:flesheatingbacteria"},
  30. jump = false,
  31. stay_near = {{"default:sand_with_kelp", "marinara:sand_with_kelp", "default:softcoral_yellow", "marinara:sand_with_seagrass2", "default_clay"}, 5},
  32. stepheight = 0.0,
  33. drops = {
  34. },
  35. water_damage = 0,
  36. air_damage = 1,
  37. lava_damage = 4,
  38. light_damage = 0,
  39. fear_height = 2,
  40. animation = {
  41. speed_normal = 50,
  42. stand_start = 0,
  43. stand_end = 100,
  44. stand2_start = 0,
  45. stand2_end = 1,
  46. fly_speed = 30,
  47. fly_start = 100, -- swim animation
  48. fly_end = 200,
  49. die_start = 200,
  50. die_end = 300,
  51. die_speed = 50,
  52. die_loop = false,
  53. die_rotate = true,
  54. },
  55. fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
  56. floats = 0,
  57. follow = {
  58. "animalworld:fishfood"
  59. },
  60. view_range = 5,
  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, 25, 0, false, nil) then return end
  66. end,
  67. })
  68. if not mobs.custom_spawn_animalworld then
  69. mobs:spawn({
  70. name = "animalworld:seahorse",
  71. nodes = {"default:water_source"},
  72. neighbors = {"default:sand_with_kelp"},
  73. min_light = 0,
  74. interval = 30,
  75. chance = 2000, -- 15000
  76. active_object_count = 4,
  77. min_height = -15,
  78. max_height = 0,
  79. })
  80. end
  81. mobs:register_egg("animalworld:seahorse", S("Seahorse"), "aseahorse.png")