tools.lua 8.2 KB

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