tools.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. -- [[mods/cannabis/tools.lua]]
  2. --REGISTER TOOLS : PICKS SHOVELS AXES SWORDS
  3. --
  4. -- Picks______________________________________________________________________________
  5. --
  6. -- get Boilerplate for Translations
  7. local S = cannabis.S
  8. minetest.register_tool("cannabis:pick_hemp_steel", {
  9. description = S("Hemp Steel Pickaxe"),
  10. inventory_image = "cannabis_tool_steelpick.png",
  11. tool_capabilities = {
  12. full_punch_interval = 1.0,
  13. max_drop_level=1,
  14. groupcaps={
  15. cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
  16. },
  17. damage_groups = {fleshy=4},
  18. },
  19. })
  20. minetest.register_tool("cannabis:pick_hemp_bronze", {
  21. description = S("Hemp Bronze Pickaxe"),
  22. inventory_image = "cannabis_tool_bronzepick.png",
  23. tool_capabilities = {
  24. full_punch_interval = 1.0,
  25. max_drop_level=1,
  26. groupcaps={
  27. cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2},
  28. },
  29. damage_groups = {fleshy=4},
  30. },
  31. })
  32. minetest.register_tool("cannabis:pick_hemp_mese", {
  33. description = S("Hemp Mese Pickaxe"),
  34. inventory_image = "cannabis_tool_mesepick.png",
  35. tool_capabilities = {
  36. full_punch_interval = 0.9,
  37. max_drop_level=3,
  38. groupcaps={
  39. cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},
  40. },
  41. damage_groups = {fleshy=5},
  42. },
  43. })
  44. minetest.register_tool("cannabis:pick_hemp_diamond", {
  45. description = S("Hemp Diamond Pickaxe"),
  46. inventory_image = "cannabis_tool_diamondpick.png",
  47. tool_capabilities = {
  48. full_punch_interval = 0.9,
  49. max_drop_level=3,
  50. groupcaps={
  51. cracky = {times={[1]=0.5, [2]=0.4, [3]=0.3}, uses=30, maxlevel=3},
  52. },
  53. damage_groups = {fleshy=5},
  54. },
  55. })
  56. minetest.register_tool("cannabis:pick_hemp_high", {
  57. description = S("Hemp High Pickaxe"),
  58. inventory_image = "cannabis_tool_highpick.png",
  59. tool_capabilities = {
  60. full_punch_interval = 0.9,
  61. max_drop_level=3,
  62. groupcaps={
  63. cracky = {times={[1]=0.3, [2]=0.2, [3]=0.1}, uses=40, maxlevel=3},
  64. },
  65. damage_groups = {fleshy=5},
  66. },
  67. })
  68. minetest.register_tool("cannabis:pick_hemp_adminh", {
  69. description = S("Hemp Adminh Pickaxe"),
  70. inventory_image = "cannabis_tool_adminhpick.png",
  71. tool_capabilities = {
  72. full_punch_interval = 0.35,
  73. max_drop_level=3,
  74. groupcaps= {
  75. unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  76. fleshy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  77. choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  78. bendy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  79. cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  80. crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  81. snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
  82. },
  83. damage_groups = {fleshy=10000},
  84. },
  85. })
  86. minetest.register_on_punchnode(function(pos, node, puncher)
  87. if puncher:get_wielded_item():get_name() == "cannabis:pick_hemp_adminh"
  88. and minetest.get_node(pos).name ~= "air" then
  89. minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.")
  90. minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes.
  91. minetest.check_for_falling(pos) -- Run node update actions like falling nodes.
  92. end
  93. end)
  94. --
  95. -- Shovels___________________________________________________________________________________________________________
  96. --
  97. minetest.register_tool("cannabis:shovel_hemp_high", {
  98. description = S("Hemp High Shovel"),
  99. inventory_image = "cannabis_tool_highshovel.png",
  100. wield_image = "cannabis_tool_highshovel.png^[transformR90",
  101. tool_capabilities = {
  102. full_punch_interval = 1.2,
  103. max_drop_level=3,
  104. groupcaps={
  105. crumbly = {times={[1]=1.00, [2]=0.40, [3]=0.25}, uses=40, maxlevel=3},
  106. },
  107. damage_groups = {fleshy=2},
  108. },
  109. })
  110. minetest.register_tool("cannabis:shovel_hemp_steel", {
  111. description = S("Hemp Steel Shovel"),
  112. inventory_image = "cannabis_tool_steelshovel.png",
  113. wield_image = "cannabis_tool_steelshovel.png^[transformR90",
  114. tool_capabilities = {
  115. full_punch_interval = 1.1,
  116. max_drop_level=1,
  117. groupcaps={
  118. crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2},
  119. },
  120. damage_groups = {fleshy=3},
  121. },
  122. })
  123. minetest.register_tool("cannabis:shovel_hemp_bronze", {
  124. description = S("Hemp Bronze Shovel"),
  125. inventory_image = "cannabis_tool_bronzeshovel.png",
  126. wield_image = "cannabis_tool_bronzeshovel.png^[transformR90",
  127. tool_capabilities = {
  128. full_punch_interval = 1.1,
  129. max_drop_level=1,
  130. groupcaps={
  131. crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2},
  132. },
  133. damage_groups = {fleshy=3},
  134. },
  135. })
  136. minetest.register_tool("cannabis:shovel_hemp_mese", {
  137. description = S("Hemp Mese Shovel"),
  138. inventory_image = "cannabis_tool_meseshovel.png",
  139. wield_image = "cannabis_tool_meseshovel.png^[transformR90",
  140. tool_capabilities = {
  141. full_punch_interval = 1.0,
  142. max_drop_level=3,
  143. groupcaps={
  144. crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3},
  145. },
  146. damage_groups = {fleshy=4},
  147. },
  148. })
  149. minetest.register_tool("cannabis:shovel_hemp_diamond", {
  150. description = S("Hemp Diamond Shovel"),
  151. inventory_image = "cannabis_tool_diamondshovel.png",
  152. wield_image = "cannabis_tool_diamondshovel.png^[transformR90",
  153. tool_capabilities = {
  154. full_punch_interval = 1.0,
  155. max_drop_level=1,
  156. groupcaps={
  157. crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
  158. },
  159. damage_groups = {fleshy=4},
  160. },
  161. })
  162. -- Axes____________________________________________________________________________________________________
  163. --
  164. minetest.register_tool("cannabis:axe_hemp_steel", {
  165. description = S("Hemp Steel Axe"),
  166. inventory_image = "cannabis_tool_steelaxe.png",
  167. tool_capabilities = {
  168. full_punch_interval = 1.0,
  169. max_drop_level=1,
  170. groupcaps={
  171. choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2},
  172. },
  173. damage_groups = {fleshy=4},
  174. },
  175. })
  176. minetest.register_tool("cannabis:axe_hemp_bronze", {
  177. description = S("Hemp Bronze Axe"),
  178. inventory_image = "cannabis_tool_bronzeaxe.png",
  179. tool_capabilities = {
  180. full_punch_interval = 1.0,
  181. max_drop_level=1,
  182. groupcaps={
  183. choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2},
  184. },
  185. damage_groups = {fleshy=4},
  186. },
  187. })
  188. minetest.register_tool("cannabis:axe_hemp_mese", {
  189. description = S("Hemp Mese Axe"),
  190. inventory_image = "cannabis_tool_meseaxe.png",
  191. tool_capabilities = {
  192. full_punch_interval = 0.9,
  193. max_drop_level=1,
  194. groupcaps={
  195. choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3},
  196. },
  197. damage_groups = {fleshy=6},
  198. },
  199. })
  200. minetest.register_tool("cannabis:axe_hemp_diamond", {
  201. description = S("Hemp Diamond Axe"),
  202. inventory_image = "cannabis_tool_diamondaxe.png",
  203. tool_capabilities = {
  204. full_punch_interval = 0.9,
  205. max_drop_level=1,
  206. groupcaps={
  207. choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2},
  208. },
  209. damage_groups = {fleshy=7},
  210. },
  211. })
  212. minetest.register_tool("cannabis:axe_hemp_high", {
  213. description = S("Hemp High Performance Axe"),
  214. inventory_image = "cannabis_tool_highaxe.png",
  215. tool_capabilities = {
  216. full_punch_interval = 0.9,
  217. max_drop_level=1,
  218. groupcaps={
  219. choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=40, maxlevel=3},
  220. },
  221. damage_groups = {fleshy=8},
  222. },
  223. })
  224. --
  225. -- Swords___________________________________________________________________________________________________
  226. minetest.register_tool("cannabis:sword_hemp_steel", {
  227. description = S("Hemp Steel Sword"),
  228. inventory_image = "cannabis_tool_steelsword.png",
  229. tool_capabilities = {
  230. full_punch_interval = 0.8,
  231. max_drop_level=1,
  232. groupcaps={
  233. snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
  234. },
  235. damage_groups = {fleshy=6},
  236. }
  237. })
  238. minetest.register_tool("cannabis:sword_hemp_bronze", {
  239. description = S("Hemp Bronze Sword"),
  240. inventory_image = "cannabis_tool_bronzesword.png",
  241. tool_capabilities = {
  242. full_punch_interval = 0.8,
  243. max_drop_level=1,
  244. groupcaps={
  245. snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2},
  246. },
  247. damage_groups = {fleshy=6},
  248. }
  249. })
  250. minetest.register_tool("cannabis:sword_hemp_mese", {
  251. description = S("Hemp Mese Sword"),
  252. inventory_image = "cannabis_tool_mesesword.png",
  253. tool_capabilities = {
  254. full_punch_interval = 0.7,
  255. max_drop_level=1,
  256. groupcaps={
  257. snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
  258. },
  259. damage_groups = {fleshy=7},
  260. }
  261. })
  262. minetest.register_tool("cannabis:sword_hemp_diamond", {
  263. description = S("Hemp Diamond Sword"),
  264. inventory_image = "cannabis_tool_diamondsword.png",
  265. tool_capabilities = {
  266. full_punch_interval = 0.7,
  267. max_drop_level=1,
  268. groupcaps={
  269. snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
  270. },
  271. damage_groups = {fleshy=8},
  272. }
  273. })
  274. minetest.register_tool("cannabis:sword_hemp_high", {
  275. description = S("Hemp High Performance Sword"),
  276. inventory_image = "cannabis_tool_highsword.png",
  277. tool_capabilities = {
  278. full_punch_interval = 0.7,
  279. max_drop_level=1,
  280. groupcaps={
  281. snappy={times={[1]=0.8, [2]=0.8, [3]=0.25}, uses=50, maxlevel=3},
  282. },
  283. damage_groups = {fleshy=9},
  284. }
  285. })
  286. --pick:___________________________________________________________________
  287. minetest.register_craft({
  288. output = 'cannabis:pick_hemp_high',
  289. recipe = {
  290. {'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot'},
  291. {'', 'group:stick', ''},
  292. {'', 'group:stick', ''},
  293. }
  294. })
  295. minetest.register_craft({
  296. output = 'cannabis:pick_hemp_steel',
  297. recipe = {
  298. {'default:steel_ingot', 'cannabis:high_performance_ingot', 'default:steel_ingot'},
  299. {'', 'group:stick', ''},
  300. {'', 'group:stick', ''},
  301. }
  302. })
  303. minetest.register_craft({
  304. output = 'cannabis:pick_hemp_bronze',
  305. recipe = {
  306. {'default:bronze_ingot', 'cannabis:foglie_ingot', 'default:bronze_ingot'},
  307. {'', 'group:stick', ''},
  308. {'', 'group:stick', ''},
  309. }
  310. })
  311. minetest.register_craft({
  312. output = 'cannabis:pick_hemp_mese',
  313. recipe = {
  314. {'default:mese_crystal', 'cannabis:fibra_ingot', 'default:mese_crystal'},
  315. {'', 'group:stick', ''},
  316. {'', 'group:stick', ''},
  317. }
  318. })
  319. minetest.register_craft({
  320. output = 'cannabis:pick_hemp_diamond',
  321. recipe = {
  322. {'default:diamond', 'cannabis:tessuto_ingot', 'default:diamond'},
  323. {'', 'group:stick', ''},
  324. {'', 'group:stick', ''},
  325. }
  326. })
  327. --shovel__________________________________________________________________________________________
  328. minetest.register_craft({
  329. output = 'cannabis:shovel_hemp_high',
  330. recipe = {
  331. {'cannabis:mixed_hr_ingot'},
  332. {'group:stick'},
  333. {'group:stick'},
  334. }
  335. })
  336. minetest.register_craft({
  337. output = 'cannabis:shovel_hemp_steel',
  338. recipe = {
  339. {'default:steel_ingot'},
  340. {'group:stick'},
  341. {'cannabis:high_performance_ingot'},
  342. }
  343. })
  344. minetest.register_craft({
  345. output = 'cannabis:shovel_hemp_bronze',
  346. recipe = {
  347. {'default:bronze_ingot'},
  348. {'group:stick'},
  349. {'cannabis:foglie_ingot'},
  350. }
  351. })
  352. minetest.register_craft({
  353. output = 'cannabis:shovel_hemp_mese',
  354. recipe = {
  355. {'default:mese_crystal'},
  356. {'group:stick'},
  357. {'cannabis:fibra_ingot'},
  358. }
  359. })
  360. minetest.register_craft({
  361. output = 'cannabis:shovel_hemp_diamond',
  362. recipe = {
  363. {'default:diamond'},
  364. {'group:stick'},
  365. {'cannabis:tessuto_ingot'},
  366. }
  367. })
  368. --axe_______________________________________________________________________________________________
  369. minetest.register_craft({
  370. output = 'cannabis:axe_hemp_high',
  371. recipe = {
  372. {'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot'},
  373. {'group:stick', 'cannabis:mixed_hr_ingot'},
  374. {'group:stick',''},
  375. }
  376. })
  377. minetest.register_craft({
  378. output = 'cannabis:axe_hemp_steel',
  379. recipe = {
  380. {'cannabis:high_performance_ingot', 'default:steel_ingot'},
  381. {'group:stick', 'default:steel_ingot'},
  382. {'group:stick', ''},
  383. }
  384. })
  385. minetest.register_craft({
  386. output = 'cannabis:axe_hemp_bronze',
  387. recipe = {
  388. {'cannabis:foglie_ingot', 'default:bronze_ingot'},
  389. {'group:stick', 'default:bronze_ingot'},
  390. {'group:stick', ''},
  391. }
  392. })
  393. minetest.register_craft({
  394. output = 'cannabis:axe_hemp_mese',
  395. recipe = {
  396. {'cannabis:fibra_ingot', 'default:mese_crystal'},
  397. {'group:stick', 'default:mese_crystal'},
  398. {'group:stick', ''},
  399. }
  400. })
  401. minetest.register_craft({
  402. output = 'cannabis:axe_hemp_diamond',
  403. recipe = {
  404. {'cannabis:tessuto_ingot', 'default:diamond'},
  405. {'group:stick', 'default:diamond'},
  406. {'group:stick', ''},
  407. }
  408. })
  409. --sword_________________________________________________________________________________________________________
  410. minetest.register_craft({
  411. output = 'cannabis:sword_hemp_high',
  412. recipe = {
  413. {'cannabis:mixed_hr_ingot'},
  414. {'cannabis:mixed_hr_ingot'},
  415. {'group:stick'},
  416. }
  417. })
  418. minetest.register_craft({
  419. output = 'cannabis:sword_hemp_steel',
  420. recipe = {
  421. {'default:steel_ingot'},
  422. {'cannabis:high_performance_ingot'},
  423. {'group:stick'},
  424. }
  425. })
  426. minetest.register_craft({
  427. output = 'cannabis:sword_hemp_bronze',
  428. recipe = {
  429. {'default:bronze_ingot'},
  430. {'cannabis:foglie_ingot'},
  431. {'group:stick'},
  432. }
  433. })
  434. minetest.register_craft({
  435. output = 'cannabis:sword_hemp_mese',
  436. recipe = {
  437. {'default:mese_crystal'},
  438. {'cannabis:fibra_ingot'},
  439. {'group:stick'},
  440. }
  441. })
  442. minetest.register_craft({
  443. output = 'cannabis:sword_hemp_diamond',
  444. recipe = {
  445. {'default:diamond'},
  446. {'cannabis:tessuto_ingot'},
  447. {'group:stick'},
  448. }
  449. })