diff --git a/init.lua b/init.lua index 0ab585d..601c414 100644 --- a/init.lua +++ b/init.lua @@ -61,6 +61,7 @@ local dogs = { }, } +local randm = 1 for dog,data in pairs(dogs) do local s = data.name or string.lower(string.sub(dog, 1, 1)) local name = "dogblocks:dog_"..s @@ -88,6 +89,15 @@ for dog,data in pairs(dogs) do tiles = {"dogblocks_dog_"..s..".png"}, light_source = 15, groups = {oddly_breakable_by_hand=3,snappy=2,choppy=2}, + on_punch = function(pos) + if math.random(randm) == math.random(2) then + --minetest.sound_play({name="dogblocks_"..s, pos=pos}) + minetest.sound_play({name="dogblocks_whine", pos=pos}) + randm = randm+1 + else + randm = math.max(randm-1, 1) + end + end, }) minetest.register_craft({ output = name.." 6", diff --git a/sounds/dogblocks_whine.ogg b/sounds/dogblocks_whine.ogg new file mode 100644 index 0000000..00bb3a5 Binary files /dev/null and b/sounds/dogblocks_whine.ogg differ diff --git a/sounds/whine.ogg b/sounds/whine.ogg deleted file mode 100644 index 2889591..0000000 Binary files a/sounds/whine.ogg and /dev/null differ