1
0
Fork 0

Add portal teleportation sound

This commit is contained in:
Wuzzy 2017-08-17 01:01:09 +02:00
parent 657851125f
commit bcee6a0c6a
4 changed files with 18 additions and 6 deletions

View File

@ -6,4 +6,10 @@ End portal: Build an upright frame of red nether brick blocks, 4 blocks wide and
## Credits ## Credits
Created by maikerumine and Wuzzy. 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/>

View File

@ -278,9 +278,7 @@ minetest.register_abm({
return return
end end
obj:setpos(target3) -- Build destination
minetest.sound_play("tng_transporter1", {pos=target3,gain=0.5,max_hear_distance = 8,}) -- maikerumine added sound when travel
local function check_and_build_end_portal(pos, target3) local function check_and_build_end_portal(pos, target3)
local n = minetest.get_node_or_nil(target3) local n = minetest.get_node_or_nil(target3)
if n and n.name ~= "mcl_portals:portal_end" then 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) 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, obj, pos, target3)
end end
end end

View File

@ -297,8 +297,7 @@ minetest.register_abm({
return return
end end
obj:setpos(target) -- Build target portal
minetest.sound_play("tng_transporter1", {pos=target,gain=0.5,max_hear_distance = 8,}) --maikerumine added sound when travel
local function check_and_build_portal(pos, target) local function check_and_build_portal(pos, target)
local n = minetest.get_node_or_nil(target) local n = minetest.get_node_or_nil(target)
if n and n.name ~= "mcl_portals:portal" then 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) 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, obj, pos, target)
end end
end end