Add teleport sounds
parent
04b7313a72
commit
e615a3794b
26
README.txt
26
README.txt
|
@ -16,12 +16,28 @@ Beware: If you dig a teleport, you only get 1 diamond back, so think before plac
|
|||
|
||||
Credits:
|
||||
========
|
||||
This mod code is licensed under the GNU LGPLv2.
|
||||
This mod code is licensed under the GNU LGPLv2
|
||||
<https://www.gnu.org/licenses/old-licenses/lgpl-2.0>.
|
||||
|
||||
lag01 and rnd for the original code.
|
||||
|
||||
Wuzzy for bugfixes and some gameplay tweaks.
|
||||
lag01 and rnd get credit for the original code.
|
||||
Wuzzy gets credit for bugfixes and some gameplay tweaks.
|
||||
|
||||
Texture license:
|
||||
(CC BY-SA 3.0) (from Zeg9 (CC BY-SA 3.0) )
|
||||
|
||||
teleports_teleport_top.png
|
||||
* License: CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>
|
||||
* Authors: Zeg9, lag01
|
||||
|
||||
Sound licenses:
|
||||
|
||||
teleports_charge.ogg
|
||||
* License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
|
||||
* Author: squidge316
|
||||
* Changes were made (slower speed)
|
||||
* Source: <https://freesound.org/people/squidge316/sounds/161336/>
|
||||
|
||||
teleports_teleport.ogg
|
||||
* License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
|
||||
* Author: tim.kahn
|
||||
* Changes were made (higher pitch)
|
||||
* Source: <https://freesound.org/people/tim.kahn/sounds/128590/>
|
||||
|
|
2
init.lua
2
init.lua
|
@ -119,6 +119,7 @@ function teleports.teleportate(parameters)
|
|||
if player and player:is_player() and playername~=teleports.lastplayername then
|
||||
local pos = player:getpos()
|
||||
if vector.distance(pos, {x=pos1.x,y=pos1.y+0.5,z=pos1.z}) < 0.52 then
|
||||
minetest.sound_play({name="teleports_teleport", gain=1.0}, {max_hear_distance=16}, true)
|
||||
if math.random(1, 100) > 5 then
|
||||
teleports.lastplayername = playername
|
||||
player:setpos({x=pos2.x,y=pos2.y+0.5,z=pos2.z})
|
||||
|
@ -132,6 +133,7 @@ function teleports.do_teleporting(pos1, pos2, playername, delay)
|
|||
if not delay then
|
||||
teleports.teleportate({pos1, pos2, playername})
|
||||
else
|
||||
minetest.sound_play({name="teleports_charge", gain=0.5}, {max_hear_distance=8}, true)
|
||||
teleports.animate(pos1, playername)
|
||||
minetest.after(delay, teleports.teleportate, {pos1, pos2, playername})
|
||||
end
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue