Add flag take sounds
This commit is contained in:
parent
d273457d99
commit
9804ec7518
@ -14,6 +14,9 @@ Copyright (c) 2013 - 2015
|
|||||||
**Code:** LGPL 2.1 or later.
|
**Code:** LGPL 2.1 or later.
|
||||||
**Textures:** CC-BY-SA 3.0
|
**Textures:** CC-BY-SA 3.0
|
||||||
|
|
||||||
|
ctf_flag/sounds/trumpet* by tobyk, license: CC-BY 3.0
|
||||||
|
from: http://freesound.org/people/tobyk/sounds/26198/
|
||||||
|
|
||||||
Modules
|
Modules
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
@ -83,3 +83,22 @@ function minetest.is_protected(pos, name)
|
|||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Play sound
|
||||||
|
ctf_flag.register_on_pick_up(function(attname, flag)
|
||||||
|
local vteam = ctf.team(flag.team)
|
||||||
|
for name, player in pairs(vteam.players) do
|
||||||
|
minetest.sound_play({name="trumpet_lose"}, {
|
||||||
|
to_player = name,
|
||||||
|
gain = 1.0, -- default
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local ateam = ctf.team(ctf.player(attname).team)
|
||||||
|
for name, player in pairs(ateam.players) do
|
||||||
|
minetest.sound_play({name="trumpet_win"}, {
|
||||||
|
to_player = name,
|
||||||
|
gain = 1.0, -- default
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
BIN
ctf_flag/sounds/trumpet_lose.ogg
Normal file
BIN
ctf_flag/sounds/trumpet_lose.ogg
Normal file
Binary file not shown.
BIN
ctf_flag/sounds/trumpet_win.ogg
Normal file
BIN
ctf_flag/sounds/trumpet_win.ogg
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user