Use TRUE ephemeral sounds

This commit is contained in:
Wuzzy 2020-04-06 00:44:24 +02:00
parent 5462fba560
commit ae1b85f1a0
1 changed files with 8 additions and 8 deletions

View File

@ -46,10 +46,10 @@ returnmirror.set_position_inactive = function(itemstack, user, pointed_thing)
if returnmirror.mana_check(user, returnmirror.cost_set) then
local newitem = ItemStack("returnmirror:mirror_active")
newitem:set_metadata(minetest.pos_to_string(pos))
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, false)
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, true)
return newitem
else
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, false)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, true)
end
end
@ -67,10 +67,10 @@ returnmirror.set_position_active = function(itemstack, user, pointed_thing)
local pos = user:getpos()
if returnmirror.mana_check(user, returnmirror.cost_set) then
itemstack:set_metadata(minetest.pos_to_string(pos))
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, false)
minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}, true)
return itemstack
else
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, false)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}, true)
end
end
@ -95,7 +95,7 @@ minetest.register_tool("returnmirror:mirror_inactive", {
groups = { disable_repair = 1 },
range = 2,
on_use = function(itemstack, user, pointed_thing)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=user:getpos(), max_hear_distance=18}, false)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=user:getpos(), max_hear_distance=18}, true)
end,
on_place = returnmirror.set_position_inactive,
on_secondary_use = returnmirror.set_position_inactive,
@ -118,7 +118,7 @@ minetest.register_tool("returnmirror:mirror_active", {
if dest ~= nil then
if returnmirror.mana_check(user, returnmirror.cost_teleport) then
fail = false
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30}, false)
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30}, true)
minetest.add_particlespawner({
amount = 50,
time = 0.1,
@ -133,7 +133,7 @@ minetest.register_tool("returnmirror:mirror_active", {
texture = "returnmirror_particle_departure.png",
})
user:setpos(dest)
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=dest, max_hear_distance=30}, false)
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=dest, max_hear_distance=30}, true)
minetest.add_particlespawner({
amount = 100,
time = 0.1,
@ -150,7 +150,7 @@ minetest.register_tool("returnmirror:mirror_active", {
end
end
if fail then
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=src, max_hear_distance=18}, false)
minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=src, max_hear_distance=18}, true)
end
end,
on_place = returnmirror.set_position_active,