Bomf staff

This commit is contained in:
Tai @ Flex 2016-08-18 19:35:08 +01:00
parent afb576bfad
commit b574d865e7
2 changed files with 60 additions and 0 deletions

BIN
sounds/vivarium_pom.ogg Normal file

Binary file not shown.

View File

@ -92,6 +92,66 @@ minetest.register_tool("vivarium:staff_clone", { -- this will be the floor staff
end,
})
minetest.register_tool("vivarium:staff_boom", { -- this will be the floor staff
description = "Bomf Staff (remove nodes of pointed type)",
inventory_image = "water_staff.png^[colorize:black:90",
wield_image = "water_staff.png^[colorize:black:90",
range = 10,
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
local pos = pointed_thing.under
local pname = user:get_player_name()
if minetest.is_protected(pos, pname) then
minetest.record_protection_violation(pos, pname)
return
end
local radius = 3
local targetnode = minetest.get_node(pos).name
local userpos = user:getpos()
local targetnodes = minetest.find_nodes_in_area(
{x = pos.x - radius, y = pos.y-radius, z = pos.z - radius},
{x = pos.x + radius, y = pos.y+radius, z = pos.z + radius},
{targetnode}
)
minetest.add_particlespawner(
200, --amount
0.1, --time
{x=pos.x-radius/2, y=pos.y-radius/2, z=pos.z-radius/2}, --minpos
{x=pos.x+radius/2, y=pos.y+radius/2, z=pos.z+radius/2}, --maxpos
{x=-0, y=-0, z=-0}, --minvel
{x=1, y=1, z=1}, --maxvel
{x=-0.5,y=5,z=-0.5}, --minacc
{x=0.5,y=5,z=0.5}, --maxacc
0.1, --minexptime
1, --maxexptime
3, --minsize
4, --maxsize
false, --collisiondetection
"tnt_smoke.png" --texture
)
minetest.sound_play("vivarium_pom", {
pos = pos,
max_hear_distance = 10
})
for _,fpos in pairs(targetnodes) do
minetest.swap_node(fpos, {name = "air" })
end
return itemstack
end,
})
-- quick and dirty tool to repair carnage caused by NSSM ice mobs
minetest.register_tool("vivarium:staff_melt", {
description = "Staff of Melting (replace snow/ice with node under it, or above it)",