tools.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. -- mods/default/tools.lua
  2. -- To stay simple tools don't use maxlevel.
  3. -- The engine assumes maxlevel=1, so we have to specify 0
  4. -- A bug adds + 1 to uses, so we subtract 1.
  5. --
  6. -- The Hand
  7. --
  8. minetest.register_item(":", {
  9. type = "none",
  10. wield_image = "wieldhand.png",
  11. wield_scale = {x=1,y=1,z=1.5},
  12. range = 4.0,
  13. tool_capabilities = {
  14. full_punch_interval = 0.5,
  15. groupcaps = {
  16. crumbly = {times={[2]=2.50, [3]=1.00}, uses=0, maxlevel=0},
  17. snappy = {times={[3]=0.60}, uses=0, maxlevel=0},
  18. oddly_breakable_by_hand = {times={[1]=1.80,[2]=1.20,[3]=0.40}, uses=0}
  19. },
  20. damage_groups = {fleshy=1},
  21. },
  22. })
  23. --
  24. -- Tool definition
  25. --
  26. -- Picks
  27. minetest.register_tool("default:pick_wood", {
  28. description = "Wooden Pickaxe",
  29. inventory_image = "default_tool_woodpick.png",
  30. tool_capabilities = {
  31. full_punch_interval = 0.5,
  32. groupcaps={
  33. cracky = {times={[3]=1.6}, uses=20-1, maxlevel=0},
  34. },
  35. damage_groups = {fleshy=1},
  36. },
  37. sound = {breaks = "default_tool_breaks"},
  38. })
  39. minetest.register_tool("default:pick_stone", {
  40. description = "Stone Pickaxe",
  41. inventory_image = "default_tool_stonepick.png",
  42. tool_capabilities = {
  43. full_punch_interval = 0.5,
  44. groupcaps={
  45. cracky = {times={[3]=1.00}, uses=80-1, maxlevel=0},
  46. },
  47. damage_groups = {fleshy=2},
  48. },
  49. sound = {breaks = "default_tool_breaks"},
  50. })
  51. minetest.register_tool("default:pick_copper", {
  52. description = "Copper Pickaxe",
  53. inventory_image = "default_tool_copperpick.png",
  54. tool_capabilities = {
  55. full_punch_interval = 0.5,
  56. groupcaps={
  57. cracky = {times={[2]=1.40, [3]=0.80}, uses=60-1, maxlevel=0},
  58. },
  59. damage_groups = {fleshy=3},
  60. },
  61. sound = {breaks = "default_tool_breaks"},
  62. })
  63. minetest.register_tool(":default:pick_bronze", {
  64. description = "Bronze Pickaxe",
  65. inventory_image = "default_tool_bronzepick.png",
  66. tool_capabilities = {
  67. full_punch_interval = 0.5,
  68. groupcaps={
  69. cracky = {times={[2]=1.10, [3]=0.60}, uses=80-1, maxlevel=0},
  70. },
  71. damage_groups = {fleshy=3},
  72. },
  73. sound = {breaks = "default_tool_breaks"},
  74. })
  75. minetest.register_tool("default:pick_steel", {
  76. description = "Steel Pickaxe",
  77. inventory_image = "default_tool_steelpick.png",
  78. tool_capabilities = {
  79. full_punch_interval = 0.5,
  80. groupcaps={
  81. cracky = {times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=120-1, maxlevel=0},
  82. },
  83. damage_groups = {fleshy=3},
  84. },
  85. sound = {breaks = "default_tool_breaks"},
  86. })
  87. minetest.register_tool("default:pick_mese", {
  88. description = "Mese Pickaxe",
  89. inventory_image = "default_tool_mesepick.png",
  90. tool_capabilities = {
  91. full_punch_interval = 0.5,
  92. groupcaps={
  93. cracky = {times={[1]=1.0, [2]=0.60, [3]=0.20}, uses=30-1, maxlevel=0},
  94. crumbly = {times={[1]=1.0, [2]=0.60, [3]=0.20}, uses=30-1, maxlevel=0},
  95. snappy = {times={[1]=1.0, [2]=0.60, [3]=0.20}, uses=30-1, maxlevel=0},
  96. choppy = {times={[1]=1.0, [2]=0.60, [3]=0.20}, uses=30-1, maxlevel=0}
  97. },
  98. damage_groups = {fleshy=3},
  99. },
  100. sound = {breaks = "default_tool_breaks"},
  101. })
  102. -- Shovels
  103. minetest.register_tool("default:shovel_wood", {
  104. description = "Wooden Shovel",
  105. inventory_image = "default_tool_woodshovel.png",
  106. tool_capabilities = {
  107. full_punch_interval = 0.5,
  108. groupcaps={
  109. crumbly = {times={[2]=2.0, [3]=0.80}, uses=20-1, maxlevel=0},
  110. },
  111. damage_groups = {fleshy=1},
  112. },
  113. sound = {breaks = "default_tool_breaks"},
  114. })
  115. minetest.register_tool("default:shovel_stone", {
  116. description = "Stone Shovel",
  117. inventory_image = "default_tool_stoneshovel.png",
  118. tool_capabilities = {
  119. full_punch_interval = 0.5,
  120. groupcaps={
  121. crumbly = {times={[1]=1.80, [2]=1.20, [3]=0.60}, uses=80-1, maxlevel=0},
  122. },
  123. damage_groups = {fleshy=1},
  124. },
  125. sound = {breaks = "default_tool_breaks"},
  126. })
  127. minetest.register_tool("default:shovel_copper", {
  128. description = "Copper Shovel",
  129. inventory_image = "default_tool_coppershovel.png",
  130. tool_capabilities = {
  131. full_punch_interval = 0.5,
  132. groupcaps={
  133. crumbly = {times={[1]=1.20, [2]=0.90, [3]=0.40}, uses=60-1, maxlevel=0},
  134. },
  135. damage_groups = {fleshy=2},
  136. },
  137. sound = {breaks = "default_tool_breaks"},
  138. })
  139. minetest.register_tool(":default:shovel_bronze", {
  140. description = "Bronze Shovel",
  141. inventory_image = "default_tool_bronzeshovel.png",
  142. wield_image = "default_tool_bronzeshovel.png^[transformR90",
  143. tool_capabilities = {
  144. full_punch_interval = 0.5,
  145. groupcaps={
  146. crumbly = {times={[1]=1.10, [2]=0.80, [3]=0.30}, uses=80-1, maxlevel=0},
  147. },
  148. damage_groups = {fleshy=2},
  149. },
  150. sound = {breaks = "default_tool_breaks"},
  151. })
  152. minetest.register_tool("default:shovel_steel", {
  153. description = "Steel Shovel",
  154. inventory_image = "default_tool_steelshovel.png",
  155. tool_capabilities = {
  156. full_punch_interval = 0.5,
  157. groupcaps={
  158. crumbly = {times={[1]=0.80, [2]=0.60, [3]=0.20}, uses=120-1, maxlevel=0},
  159. },
  160. damage_groups = {fleshy=2},
  161. },
  162. sound = {breaks = "default_tool_breaks"},
  163. })
  164. -- Axes
  165. minetest.register_tool("default:axe_wood", {
  166. description = "Wooden Axe",
  167. inventory_image = "default_tool_woodaxe.png",
  168. tool_capabilities = {
  169. full_punch_interval = 0.5,
  170. groupcaps={
  171. choppy = {times={[2]=2.00, [3]=1.50}, uses=20-1, maxlevel=0},
  172. },
  173. damage_groups = {fleshy=1},
  174. },
  175. sound = {breaks = "default_tool_breaks"},
  176. })
  177. minetest.register_tool("default:axe_stone", {
  178. description = "Stone Axe",
  179. inventory_image = "default_tool_stoneaxe.png",
  180. tool_capabilities = {
  181. full_punch_interval = 0.5,
  182. groupcaps={
  183. choppy={times={[1]=1.20, [2]=0.90, [3]=0.70}, uses=80-1, maxlevel=0},
  184. },
  185. damage_groups = {fleshy=2},
  186. },
  187. sound = {breaks = "default_tool_breaks"},
  188. })
  189. minetest.register_tool("default:axe_copper", {
  190. description = "Copper Axe",
  191. inventory_image = "default_tool_copperaxe.png",
  192. tool_capabilities = {
  193. full_punch_interval = 0.5,
  194. groupcaps={
  195. choppy={times={[1]=0.90, [2]=0.60, [3]=0.50}, uses=60-1, maxlevel=0},
  196. },
  197. damage_groups = {fleshy=3},
  198. },
  199. sound = {breaks = "default_tool_breaks"},
  200. })
  201. minetest.register_tool(":default:axe_bronze", {
  202. description = "Bronze Axe",
  203. inventory_image = "default_tool_bronzeaxe.png",
  204. tool_capabilities = {
  205. full_punch_interval = 0.5,
  206. groupcaps={
  207. choppy={times={[1]=0.70, [2]=0.40, [3]=0.30}, uses=80-1, maxlevel=0},
  208. },
  209. damage_groups = {fleshy=3},
  210. },
  211. sound = {breaks = "default_tool_breaks"},
  212. })
  213. minetest.register_tool("default:axe_steel", {
  214. description = "Steel Axe",
  215. inventory_image = "default_tool_steelaxe.png",
  216. tool_capabilities = {
  217. full_punch_interval = 0.5,
  218. groupcaps={
  219. choppy={times={[1]=0.60, [2]=0.30, [3]=0.20}, uses=120-1, maxlevel=0},
  220. },
  221. damage_groups = {fleshy=3},
  222. },
  223. sound = {breaks = "default_tool_breaks"},
  224. })
  225. -- Swords
  226. minetest.register_tool("default:sword_wood", {
  227. description = "Wooden Sword",
  228. inventory_image = "default_tool_woodsword.png",
  229. range = 3.0,
  230. tool_capabilities = {
  231. full_punch_interval = 0.5,
  232. groupcaps={
  233. snappy={times={[2]=2.8, [3]=0.60}, uses=60-1, maxlevel=0},
  234. },
  235. damage_groups = {fleshy=1},
  236. },
  237. sound = {breaks = "default_tool_breaks"},
  238. })
  239. minetest.register_tool("default:sword_stone", {
  240. description = "Stone Sword",
  241. inventory_image = "default_tool_stonesword.png",
  242. range = 3.0,
  243. tool_capabilities = {
  244. full_punch_interval = 0.5,
  245. groupcaps={
  246. snappy={times={[2]=1.20, [3]=0.50}, uses=240-1, maxlevel=0},
  247. },
  248. damage_groups = {fleshy=2},
  249. },
  250. sound = {breaks = "default_tool_breaks"},
  251. })
  252. minetest.register_tool("default:sword_copper", {
  253. description = "Copper Sword",
  254. inventory_image = "default_tool_coppersword.png",
  255. range = 3.0,
  256. tool_capabilities = {
  257. full_punch_interval = 0.5,
  258. groupcaps={
  259. snappy={times={[1]=2.8, [2]=1.10, [3]=0.40}, uses=160-1, maxlevel=0},
  260. },
  261. damage_groups = {fleshy=3},
  262. },
  263. sound = {breaks = "default_tool_breaks"},
  264. })
  265. minetest.register_tool(":default:sword_bronze", {
  266. description = "Bronze Sword",
  267. inventory_image = "default_tool_bronzesword.png",
  268. range = 3.0,
  269. tool_capabilities = {
  270. full_punch_interval = 0.5,
  271. groupcaps={
  272. snappy={times={[1]=2.6, [2]=1.00, [3]=0.30}, uses=240
  273. -1, maxlevel=0},
  274. },
  275. damage_groups = {fleshy=3},
  276. },
  277. sound = {breaks = "default_tool_breaks"},
  278. })
  279. minetest.register_tool("default:sword_steel", {
  280. description = "Steel Sword",
  281. inventory_image = "default_tool_steelsword.png",
  282. range = 3.0,
  283. tool_capabilities = {
  284. full_punch_interval = 0.5,
  285. groupcaps={
  286. snappy={times={[1]=2.4, [2]=0.90, [3]=0.20}, uses=360-1, maxlevel=0},
  287. },
  288. damage_groups = {fleshy=4},
  289. },
  290. sound = {breaks = "default_tool_breaks"},
  291. })