init.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. if mobs.mod and mobs.mod == "redo" then
  2. local l_colors = {
  3. "#604000:175", --brown
  4. "#604000:100", --brown2
  5. "#ffffff:150", --white
  6. "#404040:150", --dark_grey
  7. "#a0a0a0:150", --grey
  8. "#808000:150", --olive
  9. "#ff0000:150" --red
  10. }
  11. local l_skins = {
  12. {"turtle1.png^turtle2.png^turtle3.png^turtle4.png^turtle5.png^turtle6.png^turtle7.png"},
  13. {"turtle1.png^(turtle2.png^[colorize:"..l_colors[5]..")^(turtle3.png^[colorize:"..l_colors[4]..")^(turtle4.png^[colorize:"..l_colors[1]..")^(turtle5.png^[colorize:"..l_colors[2]..")^(turtle6.png^[colorize:"..l_colors[6]..")^turtle7.png"}
  14. }
  15. local l_anims = {
  16. speed_normal = 24, speed_run = 24,
  17. stand_start = 1, stand_end = 50,
  18. walk_start = 60, walk_end = 90,
  19. run_start = 60, run_end = 90,
  20. hide_start = 95, hide_end = 100
  21. }
  22. local l_model = "mobf_turtle.x"
  23. local l_spawn_chance = 30000
  24. -- land turtle
  25. mobs:register_mob("mobs_turtles:turtle", {
  26. type = "animal",
  27. passive = true,
  28. hp_min = 15,
  29. hp_max = 20,
  30. armor = 200,
  31. collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.35, 0.4},
  32. visual = "mesh",
  33. mesh = l_model,
  34. textures = l_skins,
  35. makes_footstep_sound = false,
  36. view_range = 8,
  37. rotate = 270,
  38. walk_velocity = 0.1,
  39. run_velocity = 0.3,
  40. jump = false,
  41. fly = false,
  42. floats = 1,
  43. water_damage = 0,
  44. lava_damage = 5,
  45. light_damage = 0,
  46. fall_damage = 1,
  47. animation = l_anims,
  48. drops = {
  49. {name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
  50. },
  51. follow = "farming:carrot",
  52. on_rightclick = function(self, clicker)
  53. self.state = ""
  54. mobs:set_velocity(self, 0)
  55. self.object:set_animation({x=self.animation.hide_start, y=self.animation.hide_end}, self.animation.speed_normal, 0)
  56. minetest.after(5, function()
  57. self.state = "stand"
  58. end)
  59. mobs:capture_mob(self, clicker, 0, 80, 100, true, nil)
  60. end
  61. })
  62. --name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
  63. mobs:spawn_specific("mobs_turtles:turtle",
  64. {"default:dirt_with_grass","default:jungle_grass","default:sand","default:desert_sand"},
  65. {"default:dirt_with_grass","default:jungle_grass","default:sand","default:desert_sand","default:papyrus","default:cactus","dryplants:juncus","dryplants:reedmace"},
  66. 5, 20, 30, l_spawn_chance, 1, 1, 31000)
  67. mobs:register_egg("mobs_turtles:turtle", "Turtle", "default_grass.png", 1)
  68. -- sea turtle
  69. mobs:register_mob("mobs_turtles:seaturtle", {
  70. type = "animal",
  71. passive = true,
  72. hp_min = 20,
  73. hp_max = 30,
  74. armor = 250,
  75. collisionbox = {-0.8, 0.0, -0.8, 0.8, 0.7, 0.8},
  76. visual = "mesh",
  77. visual_size = {x=2,y=2},
  78. mesh = l_model,
  79. textures = l_skins,
  80. makes_footstep_sound = false,
  81. view_range = 10,
  82. rotate = 270,
  83. walk_velocity = 1,
  84. run_velocity = 1.5,
  85. stepheight = 1,
  86. jump = false,
  87. fly = true,
  88. fly_in = "default:water_source",
  89. fall_speed = 0,
  90. floats = 1,
  91. water_damage = 0,
  92. lava_damage = 5,
  93. light_damage = 0,
  94. fall_damage = 0,
  95. animation = l_anims,
  96. drops = {
  97. {name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
  98. },
  99. on_rightclick = function(self, clicker)
  100. mobs:capture_mob(self, clicker, 0, 0, 80, true, nil)
  101. end
  102. })
  103. --name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
  104. mobs:spawn_specific("mobs_turtles:seaturtle",
  105. {"default:water_flowing","default:water_source"},
  106. {"default:water_flowing","default:water_source","group:seaplants","seawrecks:woodship","seawrecks:uboot"},
  107. 5, 20, 30, l_spawn_chance, 1, -31000, 0)
  108. mobs:register_egg("mobs_turtles:seaturtle", "Sea Turtle", "default_water.png", 1)
  109. end