tools.lua 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. minetest.register_tool('epic:pick_titanium', {
  2. _doc_items_crafting = 'This tool is crafted in the Smithy Station.',
  3. description = 'Titanium Pickaxe',
  4. inventory_image = 'epic_tool_titanium_pick.png',
  5. tool_capabilities = {
  6. full_punch_interval = 0.8,
  7. max_drop_level=3,
  8. groupcaps={
  9. cracky = {times={[1]=1.9, [2]=0.90, [3]=0.40}, uses=50, maxlevel=4},
  10. },
  11. damage_groups = {fleshy=10, knockback=3},
  12. },
  13. sound = {breaks = 'default_tool_breaks'},
  14. groups = {pickaxe = 1}
  15. })
  16. minetest.register_tool('epic:shovel_titanium', {
  17. _doc_items_crafting = 'This tool is crafted in the Smithy Station.',
  18. description = 'Titanium Shovel',
  19. inventory_image = 'epic_tool_titanium_shovel.png',
  20. wield_image = 'epic_tool_titanium_shovel.png^[transformR90',
  21. tool_capabilities = {
  22. full_punch_interval = 0.9,
  23. max_drop_level=3,
  24. groupcaps={
  25. crumbly = {times={[1]=1.0, [2]=0.40, [3]=0.20}, uses=50, maxlevel=4},
  26. },
  27. damage_groups = {fleshy=6},
  28. },
  29. sound = {breaks = 'default_tool_breaks'},
  30. groups = {shovel = 1, knockback=2}
  31. })
  32. minetest.register_tool('epic:axe_titanium', {
  33. _doc_items_crafting = 'This tool is crafted in the Smithy Station.',
  34. description = 'Titanium Axe',
  35. inventory_image = 'epic_tool_titanium_axe.png',
  36. tool_capabilities = {
  37. full_punch_interval = 0.8,
  38. max_drop_level=3,
  39. groupcaps={
  40. choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=50, maxlevel=4},
  41. },
  42. damage_groups = {fleshy=9, knockback=3},
  43. },
  44. sound = {breaks = 'default_tool_breaks'},
  45. groups = {axe = 1}
  46. })
  47. minetest.register_tool('epic:sword_titanium', {
  48. _doc_items_crafting = 'This tool is crafted in the Smithy Station.',
  49. description = 'Titanium Sword',
  50. inventory_image = 'epic_tool_titanium_sword.png',
  51. tool_capabilities = {
  52. full_punch_interval = 0.6,
  53. max_drop_level=3,
  54. groupcaps={
  55. snappy={times={[1]=1.80, [2]=0.80, [3]=0.20}, uses=60, maxlevel=4},
  56. },
  57. damage_groups = {fleshy=12, knockback=4},
  58. },
  59. sound = {breaks = 'default_tool_breaks'},
  60. groups = {sword = 1}
  61. })
  62. minetest.register_tool('epic:shovel_soft', {
  63. description = 'Soft Touch Shovel',
  64. _doc_items_crafting = 'This tool is crafted in the Smithy Station.',
  65. _doc_items_durability = 111,
  66. _doc_items_longdesc = 'A special shovel that can pick up dirt blocks without disturbing the grass/moss.',
  67. _doc_items_usagehelp = "Punch a dirt block to pick it up.",
  68. inventory_image = 'epic_tool_shovel_soft.png',
  69. wield_image = 'epic_tool_shovel_soft.png^[transformR90',
  70. sound = {breaks = 'default_tool_breaks'},
  71. groups = {shovel = 1, knockback=2},
  72. on_use = function(itemstack, user, pointed_thing)
  73. if pointed_thing.type == "node" then
  74. if not minetest.is_protected(pointed_thing.under, user:get_player_name()) then
  75. local pos = pointed_thing.under
  76. local nn = minetest.get_node(pos).name
  77. local is_crumbly = minetest.get_item_group(nn, "crumbly")
  78. if is_crumbly == 1 or is_crumbly == 2 or is_crumbly == 3 then
  79. local inv = user:get_inventory()
  80. minetest.env:remove_node(pointed_thing.under)
  81. minetest.check_for_falling(pos)
  82. inv:add_item("main", {name = nn})
  83. itemstack:add_wear(65535/100) -- 111 uses
  84. minetest.sound_play("default_dirt_footstep", {pos = pos, gain = 0.35})
  85. return itemstack
  86. end
  87. end
  88. end
  89. end,
  90. })
  91. minetest.register_tool('epic:pick_glowingdiamond', {
  92. _doc_items_crafting = 'This tool is crafted in the Crystal Workshop.',
  93. description = 'Glowingdiamond Pickaxe',
  94. inventory_image = 'epic_tool_glowingdiamond_pick.png',
  95. light_source = 13,
  96. tool_capabilities = {
  97. full_punch_interval = 1.0,
  98. max_drop_level=2,
  99. groupcaps={
  100. cracky = {times={[1]=1.9, [2]=0.90, [3]=0.40}, uses=20, maxlevel=2},
  101. },
  102. damage_groups = {fleshy=4, knockback=3},
  103. },
  104. sound = {breaks = 'default_tool_breaks'},
  105. groups = {pickaxe = 1}
  106. })
  107. minetest.register_tool('epic:shovel_glowingdiamond', {
  108. _doc_items_crafting = 'This tool is crafted in the Crystal Workshop.',
  109. description = 'Glowingdiamond Shovel',
  110. inventory_image = 'epic_tool_glowingdiamond_shovel.png',
  111. light_source = 13,
  112. wield_image = 'epic_tool_glowingdiamond_shovel.png^[transformR90',
  113. tool_capabilities = {
  114. full_punch_interval = 1.1,
  115. max_drop_level=1,
  116. groupcaps={
  117. crumbly = {times={[1]=1.0, [2]=0.40, [3]=0.20}, uses=30, maxlevel=2},
  118. },
  119. damage_groups = {fleshy=3},
  120. },
  121. sound = {breaks = 'default_tool_breaks'},
  122. groups = {shovel = 1, knockback=2}
  123. })
  124. minetest.register_tool('epic:axe_glowingdiamond', {
  125. _doc_items_crafting = 'This tool is crafted in the Crystal Workshop.',
  126. description = 'Glowingdiamond Axe',
  127. inventory_image = 'epic_tool_glowingdiamond_axe.png',
  128. light_source = 13,
  129. tool_capabilities = {
  130. full_punch_interval = 1.0,
  131. max_drop_level=1,
  132. groupcaps={
  133. choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=20, maxlevel=2},
  134. },
  135. damage_groups = {fleshy=4},
  136. },
  137. sound = {breaks = 'default_tool_breaks'},
  138. groups = {axe = 1}
  139. })
  140. minetest.register_tool('epic:sword_glowingdiamond', {
  141. _doc_items_crafting = 'This tool is crafted in the Crystal Workshop.',
  142. description = 'Glowingdiamond Sword',
  143. inventory_image = 'epic_tool_glowingdiamond_sword.png',
  144. light_source = 13,
  145. tool_capabilities = {
  146. full_punch_interval = 0.8,
  147. max_drop_level=1,
  148. groupcaps={
  149. snappy={times={[1]=1.80, [2]=0.80, [3]=0.20}, uses=30, maxlevel=2},
  150. },
  151. damage_groups = {fleshy=7, knockback=4},
  152. },
  153. sound = {breaks = 'default_tool_breaks'},
  154. groups = {sword = 1}
  155. })
  156. ---RARE WEAPONS.
  157. minetest.register_tool('epic:trident', {
  158. _doc_items_durability = 55,
  159. _doc_items_crafting = "This weapon can't be crafted or repaired.",
  160. description = 'Trident',
  161. inventory_image = 'epic_trident.png',
  162. tool_capabilities = {
  163. full_punch_interval = .5,
  164. max_drop_level = 2,
  165. damage_groups = {fleshy = 25, knockback = 2, rare = 1},
  166. punch_attack_uses = 55,
  167. },
  168. groups = {not_in_creative_inventory=1}
  169. })
  170. minetest.register_tool('epic:slicer', {
  171. _doc_items_durability = 30,
  172. _doc_items_crafting = "This weapon can't be crafted or repaired.",
  173. description = 'Decapitating Obsidian Slicer',
  174. inventory_image = 'epic_slicer.png',
  175. tool_capabilities = {
  176. full_punch_interval = .8,
  177. max_drop_level = 3,
  178. damage_groups = {fleshy = 36, knockback = 4, rare = 1},
  179. punch_attack_uses = 30,
  180. },
  181. groups = {not_in_creative_inventory=1}
  182. })
  183. minetest.register_tool('epic:reaver', {
  184. _doc_items_durability = 50,
  185. _doc_items_crafting = "This weapon can't be crafted or repaired.",
  186. description = 'Skullforge Reaver',
  187. inventory_image = 'epic_reaver.png',
  188. tool_capabilities = {
  189. full_punch_interval = .2,
  190. max_drop_level = 2,
  191. damage_groups = {fleshy = 16, knockback = 3, rare = 1},
  192. punch_attack_uses = 50,
  193. },
  194. groups = {not_in_creative_inventory=1}
  195. })
  196. --[[
  197. --------------------------
  198. This code needs to be put into mobs_redo to handle the rare weapons wearing faster.
  199. -- toolrank support
  200. local wear = 0
  201. if tool_capabilities.damage_groups['rare'] then
  202. local uses = tool_capabilities.punch_attack_uses
  203. wear = floor(65535/uses)
  204. else
  205. wear = floor((punch_interval / 75) * 9000)
  206. end
  207. --]]