Use ephemeral sounds
This commit is contained in:
parent
58177b1086
commit
b01b2989a2
18
init.lua
18
init.lua
@ -6,6 +6,8 @@ else
|
||||
S = function(s) return s end
|
||||
end
|
||||
|
||||
local REACH = 20.0
|
||||
|
||||
teletool = {}
|
||||
|
||||
--[[ Load settings, apply default settings ]]
|
||||
@ -64,7 +66,7 @@ function teletool.teleport(player, pointed_thing)
|
||||
maxsize=1.25,
|
||||
texture = "teletool_particle_departure.png",
|
||||
})
|
||||
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12})
|
||||
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12}, false)
|
||||
|
||||
player:setpos(dest)
|
||||
minetest.add_particlespawner({
|
||||
@ -80,7 +82,7 @@ function teletool.teleport(player, pointed_thing)
|
||||
maxsize=1.25,
|
||||
texture = "teletool_particle_arrival.png",
|
||||
})
|
||||
minetest.after(0.5, function(dest) minetest.sound_play( {name="teletool_teleport2", gain=1}, {pos=dest, max_hear_distance=12}) end, dest)
|
||||
minetest.after(0.5, function(dest) minetest.sound_play( {name="teletool_teleport2", gain=1}, {pos=dest, max_hear_distance=12}, false) end, dest)
|
||||
|
||||
return true
|
||||
end
|
||||
@ -96,7 +98,7 @@ minetest.register_tool("teletool:teletool_infinite", {
|
||||
description = S("Infinite point teleporter"),
|
||||
_doc_items_longdesc = desc_inf,
|
||||
_doc_items_usagehelp = use_inf,
|
||||
range = 20.0,
|
||||
range = REACH,
|
||||
tool_capabilities = {},
|
||||
wield_image = "teletool_teletool_infinite.png",
|
||||
inventory_image = "teletool_teletool_infinite.png",
|
||||
@ -108,7 +110,7 @@ minetest.register_tool("teletool:teletool_infinite", {
|
||||
failure = true
|
||||
end
|
||||
if failure then
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, false)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
@ -128,7 +130,7 @@ if(minetest.get_modpath("technic")) then
|
||||
description = S("Electronic point teleporter"),
|
||||
_doc_items_longdesc = desc_technic,
|
||||
_doc_items_usagehelp = use_technic,
|
||||
range = 20.0,
|
||||
range = REACH,
|
||||
tool_capabilities = {},
|
||||
wield_image = "teletool_teletool_technic.png",
|
||||
inventory_image = "teletool_teletool_technic.png",
|
||||
@ -152,7 +154,7 @@ if(minetest.get_modpath("technic")) then
|
||||
failure = true
|
||||
end
|
||||
if failure then
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, false)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
@ -174,7 +176,7 @@ if(minetest.get_modpath("mana") ~= nil) then
|
||||
description = S("Magical point teleporter"),
|
||||
_doc_items_longdesc = desc_mana,
|
||||
_doc_items_usagehelp = use_mana,
|
||||
range = 20.0,
|
||||
range = REACH,
|
||||
tool_capabilities = {},
|
||||
wield_image = "teletool_teletool_mana.png",
|
||||
inventory_image = "teletool_teletool_mana.png",
|
||||
@ -193,7 +195,7 @@ if(minetest.get_modpath("mana") ~= nil) then
|
||||
failure = true
|
||||
end
|
||||
if failure then
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4})
|
||||
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, false)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user