1
0
mirror of https://codeberg.org/tenplus1/ambience.git synced 2024-12-24 17:50:29 +01:00

added void sound for robbie

This commit is contained in:
TenPlus1 2017-01-24 21:30:57 +00:00
parent a2cca9c6a5
commit bc88171858

View File

@ -113,9 +113,14 @@ local jungle_night = {
{name = "frog", length = 1}, {name = "frog", length = 1},
} }
local void = {
handler = {}, frequency = 1000,
{name = "fire_large", length = 8, gain = 0.8}
}
local radius = 6 local radius = 6
local num_fire, num_lava, num_water_flowing, num_water_source, local num_fire, num_lava, num_water_flowing, num_water_source, num_air,
num_desert, num_snow, num_jungletree, num_river num_desert, num_snow, num_jungletree, num_river, num_obsidian
-- check where player is and which sounds are played -- check where player is and which sounds are played
local get_ambience = function(player) local get_ambience = function(player)
@ -157,7 +162,8 @@ local get_ambience = function(player)
"default:lava_flowing", "default:lava_source", "default:jungletree", "default:lava_flowing", "default:lava_source", "default:jungletree",
"default:water_flowing", "default:water_source", "default:water_flowing", "default:water_source",
"default:river_water_flowing", "default:river_water_source", "default:river_water_flowing", "default:river_water_source",
"default:desert_sand", "default:desert_stone", "default:snowblock" "default:desert_sand", "default:desert_stone", "default:snowblock",
"default:obsidian", "air"
}) })
num_fire = (cn["fire:basic_flame"] or 0) + (cn["fire:permanent_flame"] or 0) num_fire = (cn["fire:basic_flame"] or 0) + (cn["fire:permanent_flame"] or 0)
@ -168,6 +174,8 @@ local get_ambience = function(player)
num_snow = (cn["default:snowblock"] or 0) num_snow = (cn["default:snowblock"] or 0)
num_jungletree = (cn["default:jungletree"] or 0) num_jungletree = (cn["default:jungletree"] or 0)
num_river = (cn["default:river_water_source"] or 0) + (cn["default:river_water_flowing"] or 0) num_river = (cn["default:river_water_source"] or 0) + (cn["default:river_water_flowing"] or 0)
num_obsidian = (cn["default:obsidian"] or 0)
num_air = (cn["air"] or 0)
--[[ --[[
print ( print (
"fr:" .. num_fire, "fr:" .. num_fire,
@ -179,6 +187,7 @@ print (
"jt:" .. num_jungletree "jt:" .. num_jungletree
) )
]] ]]
print ("---", num_obsidian, num_air)
-- is fire redo mod active? -- is fire redo mod active?
if fire and fire.mod and fire.mod == "redo" then if fire and fire.mod and fire.mod == "redo" then
@ -207,6 +216,10 @@ print (
return {beach = beach} return {beach = beach}
end end
if num_obsidian > 10 and num_air > 2000 then
return {void = void}
end
if num_desert > 150 then if num_desert > 150 then
return {desert = desert} return {desert = desert}
end end
@ -302,6 +315,7 @@ local still_playing = function(still_playing, player_name)
if not still_playing.largefire then stop_sound(largefire, player_name) end if not still_playing.largefire then stop_sound(largefire, player_name) end
if not still_playing.jungle then stop_sound(jungle, player_name) end if not still_playing.jungle then stop_sound(jungle, player_name) end
if not still_playing.jungle_night then stop_sound(jungle_night, player_name) end if not still_playing.jungle_night then stop_sound(jungle_night, player_name) end
if not still_playing.void then stop_sound(void, player_name) end
end end
-- player routine -- player routine
@ -321,11 +335,11 @@ minetest.register_globalstep(function(dtime)
local player_name = players[n]:get_player_name() local player_name = players[n]:get_player_name()
--local t1 = os.clock() local t1 = os.clock()
ambiences = get_ambience(players[n]) ambiences = get_ambience(players[n])
--print(string.format("elapsed time: %.4f\n", os.clock() - t1)) print(string.format("elapsed time: %.4f\n", os.clock() - t1))
still_playing(ambiences, player_name) still_playing(ambiences, player_name)