animals.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. mobs:register_mob("lottmobs:chicken", {
  2. type = "animal",
  3. hp_min = 5,
  4. hp_max = 10,
  5. collisionbox = {-0.3,0,-0.3, 0.3,0.8,0.3},
  6. textures = {
  7. {"lottmobs_chicken.png"},
  8. },
  9. sounds = {
  10. random = "mobs_chicken",
  11. },
  12. visual = "mesh",
  13. mesh = "chicken_model.x",
  14. makes_footstep_sound = true,
  15. walk_velocity = 1,
  16. armor = 300,
  17. drops = {
  18. {name = "lottmobs:meat_raw",
  19. chance = 1,
  20. min = 1,
  21. max = 3,},
  22. },
  23. light_resistant = true,
  24. drawtype = "front",
  25. water_damage = 1,
  26. lava_damage = 10,
  27. light_damage = 0,
  28. animation = {
  29. speed_normal = 10,
  30. speed_run = 15,
  31. stand_start = 0,
  32. stand_end = 0,
  33. sit_start = 1,
  34. sit_end = 9,
  35. walk_start = 10,
  36. walk_end = 50,
  37. },
  38. jump = true,
  39. step=1,
  40. passive = true,
  41. sounds = {
  42. },
  43. })
  44. mobs:register_spawn("lottmobs:chicken",
  45. {"lottmapgen:gondor_grass", "lottmapgen:dunland_grass", "lottmapgen:rohan_grass",
  46. "lottmapgen:shire_grass", "lottmapgen:ithilien_grass", "lottmapgen:ironhill_grass"},
  47. 20, -1, 10000, 3, 31000)
  48. mobs:register_mob("lottmobs:sheep", {
  49. type = "animal",
  50. passive = true,
  51. hp_min = 8,
  52. hp_max = 10,
  53. armor = 200,
  54. collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
  55. visual = "mesh",
  56. mesh = "mobs_sheep.b3d",
  57. textures = {
  58. {"mobs_sheep_base.png^mobs_sheep_wool.png"}, --White
  59. {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:#663300a0)"}, --Black
  60. {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:#000000b0)"}, --Brown
  61. {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:#5b5b5bb0)"}, --Grey
  62. },
  63. gotten_texture = {"mobs_sheep_shaved.png"},
  64. gotten_mesh = "mobs_sheep_shaved.b3d",
  65. makes_footstep_sound = true,
  66. sounds = {
  67. random = "mobs_sheep",
  68. },
  69. walk_velocity = 1,
  70. run_velocity = 2,
  71. runaway = true,
  72. jump = true,
  73. drops = {
  74. {name = "lottmobs:meat_raw", chance = 1, min = 1, max = 2},
  75. {name = "wool:white", chance = 1, min = 1, max = 1},
  76. },
  77. water_damage = 1,
  78. lava_damage = 5,
  79. light_damage = 0,
  80. animation = {
  81. speed_normal = 15,
  82. speed_run = 15,
  83. stand_start = 0,
  84. stand_end = 80,
  85. walk_start = 81,
  86. walk_end = 100,
  87. },
  88. follow = {"farming:wheat", "default:grass_5"},
  89. view_range = 8,
  90. replace_rate = 10,
  91. replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
  92. replace_with = "air",
  93. replace_offset = -1,
  94. fear_height = 3,
  95. on_rightclick = function(self, clicker)
  96. if mobs:feed_tame(self, clicker, 8, true, true) then
  97. if self.gotten == false then
  98. self.object:set_properties({
  99. textures = {"mobs_sheep_base.png^mobs_sheep_wool.png"},
  100. mesh = "mobs_sheep.b3d",
  101. })
  102. end
  103. return
  104. end
  105. local item = clicker:get_wielded_item()
  106. local itemname = item:get_name()
  107. if itemname == "mobs:shears" then
  108. if self.gotten ~= false
  109. or self.child ~= false
  110. or not minetest.get_modpath("wool") then
  111. return
  112. end
  113. self.gotten = true -- shaved
  114. local obj = minetest.add_item(
  115. self.object:getpos(),
  116. ItemStack( "wool:" .. col[1] .. " " .. math.random(1, 3) )
  117. )
  118. if obj then
  119. obj:setvelocity({
  120. x = math.random(-1, 1),
  121. y = 5,
  122. z = math.random(-1, 1)
  123. })
  124. end
  125. item:add_wear(650) -- 100 uses
  126. clicker:set_wielded_item(item)
  127. self.object:set_properties({
  128. textures = {"mobs_sheep_shaved.png"},
  129. mesh = "mobs_sheep_shaved.b3d",
  130. })
  131. return
  132. end
  133. end
  134. })
  135. mobs:register_spawn("lottmobs:sheep",
  136. {"lottmapgen:shire_grass", "lottmapgen:gondor_grass", "lottmapgen:dunland_grass",
  137. "lottmapgen:ithilien_grass"},
  138. 20, 10, 10000, 1, 31000)
  139. mobs:register_mob("lottmobs:bunny", {
  140. type = "animal",
  141. passive = true,
  142. reach = 1,
  143. hp_min = 1,
  144. hp_max = 4,
  145. armor = 200,
  146. collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
  147. visual = "mesh",
  148. mesh = "mobs_bunny.b3d",
  149. drawtype = "front",
  150. textures = {
  151. {"mobs_bunny_grey.png"},
  152. {"mobs_bunny_brown.png"},
  153. {"mobs_bunny_white.png"},
  154. },
  155. sounds = {},
  156. makes_footstep_sound = false,
  157. walk_velocity = 1,
  158. run_velocity = 2,
  159. runaway = true,
  160. jump = true,
  161. drops = {
  162. {name = "lottmobs:meat_raw", chance = 1, min = 1, max = 1},
  163. },
  164. water_damage = 1,
  165. lava_damage = 4,
  166. light_damage = 0,
  167. fear_height = 2,
  168. animation = {
  169. speed_normal = 15,
  170. stand_start = 1,
  171. stand_end = 15,
  172. walk_start = 16,
  173. walk_end = 24,
  174. punch_start = 16,
  175. punch_end = 24,
  176. },
  177. follow = {"farming:carrot", "farming_plus:carrot_item"},
  178. view_range = 8,
  179. replace_rate = 10,
  180. replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"},
  181. replace_with = "air",
  182. })
  183. mobs:register_spawn("lottmobs:bunny",
  184. {"lottmapgen:shire_grass", "lottmapgen:gondor_grass", "lottmapgen:dunland_grass",
  185. "lottmapgen:ironhill_grass", "lottmapgen:fangorn_grass", "lottmapgen:rohan_grass",
  186. "lottmapgen:ithilien_grass", "lottmapgen:lorien_grass", "default:dirt_with_snow"},
  187. 20, 10, 10000, 1, 31000)
  188. mobs:register_mob("lottmobs:rat", {
  189. type = "animal",
  190. passive = true,
  191. hp_min = 1,
  192. hp_max = 4,
  193. armor = 200,
  194. collisionbox = {-0.2, -1, -0.2, 0.2, -0.8, 0.2},
  195. visual = "mesh",
  196. mesh = "mobs_rat.b3d",
  197. textures = {
  198. {"mobs_rat.png"},
  199. {"mobs_rat2.png"},
  200. },
  201. makes_footstep_sound = false,
  202. sounds = {
  203. random = "mobs_rat",
  204. },
  205. walk_velocity = 1,
  206. run_velocity = 2,
  207. runaway = true,
  208. jump = true,
  209. water_damage = 0,
  210. lava_damage = 4,
  211. light_damage = 0,
  212. fear_height = 2,
  213. })
  214. mobs:register_spawn("lottmobs:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
  215. mobs:register_mob("lottmobs:pumba", {
  216. type = "animal",
  217. passive = false,
  218. attack_type = "dogfight",
  219. group_attack = true,
  220. reach = 2,
  221. damage = 2,
  222. hp_min = 5,
  223. hp_max = 15,
  224. armor = 200,
  225. collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
  226. visual = "mesh",
  227. mesh = "mobs_pumba.x",
  228. textures = {
  229. {"mobs_pumba.png"},
  230. },
  231. makes_footstep_sound = true,
  232. sounds = {
  233. random = "mobs_pig",
  234. attack = "mobs_pig_angry",
  235. },
  236. walk_velocity = 2,
  237. run_velocity = 3,
  238. jump = true,
  239. follow = {"default:apple", "farming:potato"},
  240. view_range = 10,
  241. drops = {
  242. {name = "lottmobs:pork_raw", chance = 1, min = 1, max = 3},
  243. },
  244. water_damage = 1,
  245. lava_damage = 5,
  246. light_damage = 0,
  247. fear_height = 2,
  248. animation = {
  249. speed_normal = 15,
  250. stand_start = 25,
  251. stand_end = 55,
  252. walk_start = 70,
  253. walk_end = 100,
  254. punch_start = 70,
  255. punch_end = 100,
  256. },
  257. })
  258. mobs:register_spawn("lottmobs:pumba", {"lottmapgen:ironhill_grass"}, 20, 10, 10000, 2, 31000)
  259. minetest.register_craftitem("lottmobs:pork_raw", {
  260. description = "Raw Porkchop",
  261. inventory_image = "mobs_pork_raw.png",
  262. on_use = minetest.item_eat(4),
  263. })
  264. minetest.register_craftitem("lottmobs:pork_cooked", {
  265. description = "Cooked Porkchop",
  266. inventory_image = "mobs_pork_cooked.png",
  267. on_use = minetest.item_eat(8),
  268. })
  269. minetest.register_craft({
  270. type = "cooking",
  271. output = "lottmobs:pork_cooked",
  272. recipe = "lottmobs:pork_raw",
  273. cooktime = 5,
  274. })