mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Add portal teleportation sound
This commit is contained in:
parent
657851125f
commit
bcee6a0c6a
4 changed files with 18 additions and 6 deletions
|
@ -6,4 +6,10 @@ End portal: Build an upright frame of red nether brick blocks, 4 blocks wide and
|
|||
|
||||
## Credits
|
||||
Created by maikerumine and Wuzzy.
|
||||
License: MIT License (see `LICENSE`).
|
||||
Code license: MIT License (see `LICENSE`).
|
||||
|
||||
Texture license: See main MineClone 2 directory.
|
||||
|
||||
License of sound: [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/)
|
||||
Authors: [FreqMan](https://freesound.org/people/FreqMan/) and Wuzzy
|
||||
Source: <https://freesound.org/people/FreqMan/sounds/32541/>
|
||||
|
|
|
@ -278,9 +278,7 @@ minetest.register_abm({
|
|||
return
|
||||
end
|
||||
|
||||
obj:setpos(target3)
|
||||
minetest.sound_play("tng_transporter1", {pos=target3,gain=0.5,max_hear_distance = 8,}) -- maikerumine added sound when travel
|
||||
|
||||
-- Build destination
|
||||
local function check_and_build_end_portal(pos, target3)
|
||||
local n = minetest.get_node_or_nil(target3)
|
||||
if n and n.name ~= "mcl_portals:portal_end" then
|
||||
|
@ -294,6 +292,10 @@ minetest.register_abm({
|
|||
|
||||
minetest.after(1, check_and_build_end_portal, pos, target3)
|
||||
|
||||
-- Teleport
|
||||
obj:setpos(target3)
|
||||
minetest.sound_play("mcl_portals_teleport", {pos=target3, gain=0.5, max_hear_distance = 16})
|
||||
|
||||
end, obj, pos, target3)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -297,8 +297,7 @@ minetest.register_abm({
|
|||
return
|
||||
end
|
||||
|
||||
obj:setpos(target)
|
||||
minetest.sound_play("tng_transporter1", {pos=target,gain=0.5,max_hear_distance = 8,}) --maikerumine added sound when travel
|
||||
-- Build target portal
|
||||
local function check_and_build_portal(pos, target)
|
||||
local n = minetest.get_node_or_nil(target)
|
||||
if n and n.name ~= "mcl_portals:portal" then
|
||||
|
@ -312,6 +311,11 @@ minetest.register_abm({
|
|||
|
||||
minetest.after(1, check_and_build_portal, pos, target)
|
||||
|
||||
-- Teleport
|
||||
obj:setpos(target)
|
||||
minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16})
|
||||
|
||||
|
||||
end, obj, pos, target)
|
||||
end
|
||||
end
|
||||
|
|
BIN
mods/MAPGEN/mcl_portals/sounds/mcl_portals_teleport.ogg
Normal file
BIN
mods/MAPGEN/mcl_portals/sounds/mcl_portals_teleport.ogg
Normal file
Binary file not shown.
Loading…
Reference in a new issue