make boom more organic

This commit is contained in:
tai 2016-10-29 17:44:39 +01:00
parent fdce3368ae
commit f4af2f0cf4

View File

@ -423,7 +423,10 @@ minetest.register_tool("staffmagic:staff_boom", {
if string.match("fire:",targetnode) then -- stop fire sound at same time.
minetest.dig_node(fpos)
else
minetest.swap_node(fpos, {name = "air" })
local amp = vector.distance(pos,fpos) -- make the hole more "organic" :-P
if (1-amp/radius)*math.random(1,radius) > amp then
minetest.swap_node(fpos, {name = "air" })
end
end
end
return itemstack