From 6787261505073a8c6c7ebe6548da95becfdd0f72 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Thu, 12 Nov 2015 18:14:13 -0800 Subject: [PATCH] Takes 3 hits to make stairs --- hammer.lua | 13 ++++++------- textures/mymasonhammer_hammer2.png | Bin 0 -> 276 bytes 2 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 textures/mymasonhammer_hammer2.png diff --git a/hammer.lua b/hammer.lua index 550ece1..de5247f 100644 --- a/hammer.lua +++ b/hammer.lua @@ -1,5 +1,6 @@ local USES = 200 local mode = {} +local count = 0 local function parti(pos) minetest.add_particlespawner(25, 0.3, pos, pos, @@ -15,12 +16,6 @@ minetest.register_tool( "mymasonhammer:hammer",{ inventory_image = "mymasonhammer_hammer.png", wield_image = "mymasonhammer_hammer.png", wield_scale = {x=1,y=1,z=3}, - tool_capabilities = { - max_drop_level=3, - groupcaps= { - cracky={times={[1]=4.00, [2]=1.50, [3]=1.00}, uses=70, maxlevel=1} - } - }, on_use = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return @@ -49,8 +44,12 @@ on_use = function(itemstack, user, pointed_thing) end if mode == "1" then if node.name == item then - minetest.set_node(pos,{name = stair, param2=minetest.dir_to_facedir(user:get_look_dir())}) + count = count + 1 parti(pos) + if count >= 3 then + minetest.set_node(pos,{name = stair, param2=minetest.dir_to_facedir(user:get_look_dir())}) + count = 0 + end end end if mode == "2" then diff --git a/textures/mymasonhammer_hammer2.png b/textures/mymasonhammer_hammer2.png new file mode 100644 index 0000000000000000000000000000000000000000..bc294e6a8a6eb22f071cf7596c1727adb67d6bb6 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP~H!l;f{6rNm2cXbGPZ!4!i_>o>?B+e>Ai$dboloeF zY9q6f_=65MnVBt06Xxs^(t5b#ypV*o38RNcM`zrI{CQgrO)kDayCWg3gQG*iL6h~l z?NX5&2pBNRcdaUES+