carp.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. local S = minetest.get_translator("animalworld")
  2. mobs:register_mob("animalworld:carp", {
  3. stepheight = 0.0,
  4. type = "animal",
  5. passive = true,
  6. attack_type = "dogfight",
  7. attack_animals = false,
  8. reach = 1,
  9. damage = 1,
  10. hp_min = 5,
  11. hp_max = 25,
  12. armor = 100,
  13. collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.5, 0.4},
  14. visual = "mesh",
  15. mesh = "Carp.b3d",
  16. visual_size = {x = 1.0, y = 1.0},
  17. textures = {
  18. {"texturecarp.png"},
  19. },
  20. sounds = {},
  21. makes_footstep_sound = false,
  22. walk_velocity = 2,
  23. run_velocity = 3,
  24. fly = true,
  25. fly_in = "default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing",
  26. fall_speed = 0,
  27. runaway = true,
  28. 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"},
  29. jump = false,
  30. stay_near = {{"marinara:sand_with_alage", "marinara:sand_with_seagrass", "default:sand_with_kelp", "marinara:sand_with_kelp", "marinara:reed_root", "flowers:waterlily_waving", "naturalbiomes:waterlily", "default:clay"}, 5},
  31. stepheight = 0.0,
  32. drops = {
  33. {name = "animalworld:rawfish", chance = 1, min = 1, max = 1},
  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 = 100,
  42. stand_start = 0,
  43. stand_end = 100,
  44. fly_start = 150, -- swim animation
  45. fly_end = 250,
  46. punch_start = 100,
  47. punch_end = 200,
  48. die_start = 100,
  49. die_end = 200,
  50. die_speed = 50,
  51. die_loop = false,
  52. die_rotate = true,
  53. },
  54. fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
  55. floats = 0,
  56. follow = {
  57. "ethereal:worm", "marinara:sand_with_seagrass", "marinara:sand_with_seagrass2", "seaweed", "fishing:bait_worm",
  58. "default:grass", "farming:cucumber", "farming:cabbage", "animalworld:ant", "animalworld:termite", "animalworld:fishfood", "animalworld:cockroach", "animalworld:anteggs_raw", "group:grass", "group:normal_grass"
  59. },
  60. view_range = 10,
  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, 5, 25, 0, false, nil) then return end
  66. end,
  67. })
  68. if not mobs.custom_spawn_animalworld then
  69. mobs:spawn({
  70. name = "animalworld:carp",
  71. nodes = {"default:water_source"}, {"default:river_water_source"},
  72. neighbors = {"marinara:sand_with_alage", "marinara:sand_with_seagrass", "default:sand_with_kelp", "marinara:sand_with_kelp", "marinara:reed_root", "flowers:waterlily_waving", "naturalbiomes:waterlily", "default:clay"},
  73. min_light = 14,
  74. interval = 60,
  75. chance = 2000, -- 15000
  76. active_object_count = 3,
  77. min_height = -10,
  78. max_height = 30,
  79. day_toggle = true,
  80. })
  81. end
  82. mobs:register_egg("animalworld:carp", S("Carp"), "acarp.png")
  83. -- raw fish
  84. minetest.register_craftitem(":animalworld:rawfish", {
  85. description = S("Raw Fish"),
  86. inventory_image = "animalworld_rawfish.png",
  87. on_use = minetest.item_eat(3),
  88. groups = {food_meat_raw = 1, flammable = 2},
  89. })
  90. -- cooked fish
  91. minetest.register_craftitem(":animalworld:cookedfish", {
  92. description = S("Cooked Fish"),
  93. inventory_image = "animalworld_cookedfish.png",
  94. on_use = minetest.item_eat(5),
  95. groups = {food_meat = 1, flammable = 2},
  96. })
  97. minetest.register_craft({
  98. type = "cooking",
  99. output = "animalworld:cookedfish",
  100. recipe = "animalworld:rawfish",
  101. cooktime = 5,
  102. })