spider.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. local S = mobs.intllib
  2. -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
  3. mobs:register_mob("mobs_monster:spider", {
  4. docile_by_day = true,
  5. group_attack = true,
  6. type = "monster",
  7. passive = false,
  8. attack_type = "dogfight",
  9. reach = 2,
  10. damage = 3,
  11. hp_min = 20,
  12. hp_max = 40,
  13. armor = 200,
  14. collisionbox = {-0.9, -0.01, -0.7, 0.7, 0.6, 0.7},
  15. visual = "mesh",
  16. mesh = "mobs_spider.x",
  17. textures = {
  18. {"mobs_spider.png"},
  19. },
  20. visual_size = {x = 7, y = 7},
  21. makes_footstep_sound = false,
  22. sounds = {
  23. random = "mobs_spider",
  24. attack = "mobs_spider",
  25. },
  26. walk_velocity = 1,
  27. run_velocity = 3,
  28. jump = true,
  29. view_range = 15,
  30. floats = 0,
  31. drops = {
  32. {name = "farming:string", chance = 1, min = 1, max = 2},
  33. {name = "ethereal:crystal_spike", chance = 15, min = 1, max = 2},
  34. },
  35. water_damage = 5,
  36. lava_damage = 5,
  37. light_damage = 0,
  38. animation = {
  39. speed_normal = 15,
  40. speed_run = 15,
  41. stand_start = 1,
  42. stand_end = 1,
  43. walk_start = 20,
  44. walk_end = 40,
  45. run_start = 20,
  46. run_end = 40,
  47. punch_start = 50,
  48. punch_end = 90,
  49. },
  50. })
  51. local spawn_on = "default:desert_stone"
  52. if minetest.get_modpath("ethereal") then
  53. spawn_on = "ethereal:crystal_dirt"
  54. else
  55. minetest.register_alias("ethereal:crystal_spike", "default:sandstone")
  56. end
  57. mobs:spawn({
  58. name = "mobs_monster:spider",
  59. nodes = {spawn_on},
  60. min_light = 0,
  61. max_light = 12,
  62. chance = 7000,
  63. active_object_count = 1,
  64. min_height = -50,
  65. max_height = 31000,
  66. })
  67. mobs:register_egg("mobs_monster:spider", S("Spider"), "mobs_cobweb.png", 1)
  68. mobs:alias_mob("mobs:spider", "mobs_monster:spider") -- compatibility
  69. -- cobweb
  70. minetest.register_node(":mobs:cobweb", {
  71. description = S("Cobweb"),
  72. drawtype = "plantlike",
  73. visual_scale = 1.2,
  74. tiles = {"mobs_cobweb.png"},
  75. inventory_image = "mobs_cobweb.png",
  76. paramtype = "light",
  77. sunlight_propagates = true,
  78. liquid_viscosity = 11,
  79. liquidtype = "source",
  80. liquid_alternative_flowing = "mobs:cobweb",
  81. liquid_alternative_source = "mobs:cobweb",
  82. liquid_renewable = false,
  83. liquid_range = 0,
  84. walkable = false,
  85. groups = {dig_immediate = 2, disable_jump = 1},
  86. drop = "farming:cotton",
  87. sounds = default.node_sound_leaves_defaults(),
  88. })
  89. minetest.register_craft({
  90. output = "mobs:cobweb",
  91. recipe = {
  92. {"farming:string", "", "farming:string"},
  93. {"", "farming:string", ""},
  94. {"farming:string", "", "farming:string"},
  95. }
  96. })