init.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. -- local variables
  2. local l_spawn_chance_gull = 24000
  3. local l_spawn_chance_bird = 36000
  4. -- load settings
  5. dofile(minetest.get_modpath("mobs_birds").."/SETTINGS.txt")
  6. if not ENABLE_LARGE_BIRDS then
  7. l_spawn_chance_bird = l_spawn_chance_bird - 18000
  8. end
  9. if not ENABLE_SMALL_BIRDS then
  10. l_spawn_chance_bird = l_spawn_chance_bird - 18000
  11. end
  12. -- gulls
  13. if ENABLE_GULLS then
  14. mobs:register_mob("mobs_birds:gull", {
  15. type = "animal",
  16. passive = true,
  17. hp_min = 5,
  18. hp_max = 10,
  19. armor = 100,
  20. collisionbox = {-1, -0.3, -1, 1, 0.3, 1},
  21. visual = "mesh",
  22. mesh = "animal_gull.b3d",
  23. textures = {
  24. {"animal_gull_mesh.png"},
  25. {"gull_black.png"},
  26. {"gull_gray.png"},
  27. {"gull_grayblue.png"}
  28. },
  29. rotate = 270,
  30. walk_velocity = 4,
  31. run_velocity = 6,
  32. fall_speed = 0,
  33. stepheight = 3,
  34. fly = true,
  35. keep_flying = true,
  36. water_damage = 0,
  37. lava_damage = 10,
  38. light_damage = 0,
  39. view_range = 14,
  40. animation = {
  41. speed_normal = 24, speed_run = 24,
  42. stand_start = 1, stand_end = 95,
  43. walk_start = 1, walk_end = 95,
  44. run_start = 1, run_end = 95
  45. },
  46. on_rightclick = function(self, clicker)
  47. mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
  48. end
  49. })
  50. mobs:spawn({
  51. name = "mobs_birds:gull",
  52. nodes = {"air"},
  53. neighbors = {"default:water_source", "default:water_flowing"},
  54. max_light = 5,
  55. interval = 30,
  56. chance = l_spawn_chance_gull,
  57. min_height = 0,
  58. max_height = 200
  59. })
  60. mobs:register_egg("mobs_birds:gull", "Gull", "default_cloud.png", 1)
  61. end
  62. -- large birds
  63. if ENABLE_LARGE_BIRDS then
  64. mobs:register_mob("mobs_birds:bird_lg", {
  65. type = "animal",
  66. passive = true,
  67. hp_min = 5,
  68. hp_max = 10,
  69. armor = 100,
  70. collisionbox = {-0.5, -0.3, -0.5, 0.5, 0.3, 0.5},
  71. visual = "mesh",
  72. mesh = "animal_gull.b3d",
  73. textures = {
  74. {"bird_blueish.png"},
  75. {"bird_brown.png"},
  76. {"bird_gray.png"},
  77. {"bird_grayblue.png"},
  78. {"bird_red.png"},
  79. {"bird_redish.png"}
  80. },
  81. visual_size = {x = .5, y = .5},
  82. rotate = 270,
  83. walk_velocity = 4,
  84. run_velocity = 6,
  85. fall_speed = 0,
  86. stepheight = 3,
  87. fly = true,
  88. keep_flying = true,
  89. water_damage = 0,
  90. lava_damage = 10,
  91. light_damage = 0,
  92. view_range = 12,
  93. animation = {
  94. speed_normal = 24, speed_run = 24,
  95. stand_start = 1, stand_end = 95,
  96. walk_start = 1, walk_end = 95,
  97. run_start = 1, run_end = 95
  98. },
  99. on_rightclick = function(self, clicker)
  100. mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
  101. end
  102. })
  103. mobs:spawn({
  104. name = "mobs_birds:bird_lg",
  105. nodes = {"air"},
  106. neighbors = {
  107. "default:leaves", "default:pine_needles",
  108. "default:jungleleaves", "default:cactus"
  109. },
  110. max_light = 5,
  111. interval = 30,
  112. chance = l_spawn_chance_bird,
  113. min_height = 0,
  114. max_height = 200
  115. })
  116. mobs:register_egg("mobs_birds:bird_lg", "Large bird", "default_cloud.png", 1)
  117. end
  118. -- small birds
  119. if ENABLE_SMALL_BIRDS then
  120. mobs:register_mob("mobs_birds:bird_sm", {
  121. type = "animal",
  122. passive = true,
  123. hp_min = 2,
  124. hp_max = 5,
  125. armor = 100,
  126. collisionbox = {-0.25, -0.3, -0.25, 0.25, 0.3, 0.25},
  127. visual = "mesh",
  128. mesh = "animal_gull.b3d",
  129. textures = {
  130. {"bird_blueish.png"},
  131. {"bird_brown.png"},
  132. {"bird_gray.png"},
  133. {"bird_grayblue.png"},
  134. {"bird_red.png"},
  135. {"bird_redish.png"}
  136. },
  137. visual_size = {x = .25, y = .25},
  138. rotate = 270,
  139. walk_velocity = 4,
  140. run_velocity = 6,
  141. fall_speed = 0,
  142. stepheight = 3,
  143. fly = true,
  144. keep_flying = true,
  145. water_damage = 0,
  146. lava_damage = 10,
  147. light_damage = 0,
  148. view_range = 10,
  149. animation = {
  150. speed_normal = 24, speed_run = 24,
  151. stand_start = 1, stand_end = 95,
  152. walk_start = 1, walk_end = 95,
  153. run_start = 1, run_end = 95
  154. },
  155. on_rightclick = function(self, clicker)
  156. mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
  157. end
  158. })
  159. mobs:spawn({
  160. name = "mobs_birds:bird_sm",
  161. nodes = {"air"},
  162. neighbors = {
  163. "default:leaves", "default:pine_needles",
  164. "default:jungleleaves", "default:cactus"
  165. },
  166. max_light = 5,
  167. interval = 30,
  168. chance = l_spawn_chance_bird,
  169. min_height = 0,
  170. max_height = 200
  171. })
  172. mobs:register_egg("mobs_birds:bird_sm", "Small bird", "default_cloud.png", 1)
  173. end