Added dripping water and bats when underground

This commit is contained in:
Neuromancer 2012-08-18 08:32:13 -05:00
parent 67e8df56ac
commit ab0d4f28b8
1 changed files with 34 additions and 20 deletions

View File

@ -1,3 +1,7 @@
local night = {"Crickets_At_NightCombo", "horned_owl", "Wolves_Howling"}
local day = {"bird"}
local cave = {"Bats_in_Cave","drippingwater_drip.1","drippingwater_drip.2","drippingwater_drip.3", "Single_Water_Droplet", "Spooky_Water_Drops"}
math.randomseed(3) math.randomseed(3)
sound_playing = 0 sound_playing = 0
@ -13,28 +17,38 @@ minetest.register_globalstep(function(time)
sound_playing = 0.05 sound_playing = 0.05
end end
--random wolves & owls at night for _,player in ipairs(minetest.get_connected_players()) do
if time > 0.8 or time < 0.2 then if player:getpos().y < 0 then
if math.random(10000) >9997 then if math.random(10000) >9980 then
minetest.sound_play("Wolves_Howling") minetest.sound_play(cave[math.random(1, #cave)], {to_player = player:get_player_name()})
end end
if math.random(10000) >9997 then else
minetest.sound_play("horned_owl") --random wolves & owls at night
end if time > 0.8 or time < 0.2 then
end if math.random(10000) >9997 then
if time > sound_playing then minetest.sound_play("Wolves_Howling")
end
if time > 0.8 or time < 0.2 then if math.random(10000) >9997 then
sound_playing = time + 0.07 minetest.sound_play("horned_owl")
minetest.sound_play("Crickets_At_NightCombo") end
end
if time > sound_playing then
return true if time > 0.8 or time < 0.2 then
end sound_playing = time + 0.07
minetest.sound_play("Crickets_At_NightCombo")
return true
end
sound_playing = time + 0.1 sound_playing = time + 0.1
minetest.sound_play("bird") minetest.sound_play("bird")
return true return true
end
end
end end
end) end)