tools.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --Register Candy Cane Pickaxe
  2. minetest.register_tool("christmas_holiday_pack:candy_cane_pickaxe", {
  3. description = "Candy Cane Pickaxe",
  4. inventory_image = "christmas_holiday_pack_candy_cane_pickaxe.png",
  5. tool_capabilities = {
  6. full_punch_interval = 0.9,
  7. max_drop_level=3,
  8. groupcaps={
  9. cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},
  10. },
  11. damage_groups = {fleshy=5},
  12. },
  13. })
  14. --Register Candy Cane Axe
  15. minetest.register_tool("christmas_holiday_pack:candy_cane_axe", {
  16. description = "Candy Cane Axe",
  17. inventory_image = "christmas_holiday_pack_candy_cane_axe.png",
  18. tool_capabilities = {
  19. full_punch_interval = 0.9,
  20. max_drop_level=1,
  21. groupcaps={
  22. choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3},
  23. },
  24. damage_groups = {fleshy=6},
  25. }
  26. })
  27. --Register Candy Cane Sword
  28. minetest.register_tool("christmas_holiday_pack:candy_cane_sword", {
  29. description = "Candy Cane Sword",
  30. inventory_image = "christmas_holiday_pack_candy_cane_sword.png",
  31. tool_capabilities = {
  32. full_punch_interval = 0.7,
  33. max_drop_level=1,
  34. groupcaps={
  35. snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
  36. },
  37. damage_groups = {fleshy=7},
  38. }
  39. })
  40. -- Add toolranks support
  41. if minetest.get_modpath("toolranks") then
  42. -- Helper function
  43. local function add_tool(name, desc, afteruse)
  44. minetest.override_item(name, {
  45. original_description = desc,
  46. description = toolranks.create_description(desc, 0, 1),
  47. after_use = afteruse and toolranks.new_afteruse
  48. })
  49. end
  50. add_tool("christmas_holiday_pack:candy_cane_pickaxe", "Candy Cane Pickaxe", true)
  51. add_tool("christmas_holiday_pack:candy_cane_axe", "Candy Cane Axe", true)
  52. add_tool("christmas_holiday_pack:candy_cane_sword", "Candy Cane Sword", true)
  53. end