Add a couple more sound registrations.

This commit is contained in:
Aaron Suen 2020-02-20 07:16:00 -05:00
parent 670cbbb89b
commit a8e9c7dbda

View File

@ -38,13 +38,24 @@ function nodecore.stack_sounds_delay(...)
nodecore.stack_sounds(unpack(t)) nodecore.stack_sounds(unpack(t))
end) end)
end end
function nodecore.sounds(name, gfoot, gdug, gplace)
return { local gains_base = {
footstep = {name = name, gain = gfoot or 0.2}, footstep = 0.2,
dig = {name = name, gain = gdug or 0.5}, dig = 0.5,
dug = {name = name, gain = gdug or 1}, dug = 1,
place = {name = name, gain = gplace or 1} place = 1,
} place_failed = 0.2,
fall = 0.1
}
function nodecore.sounds(name, gains)
local t = {}
for k, v in pairs(gains_base) do
t[k] = {
name = name,
gain = (gains and gains[k] or 1) * v
}
end
return t
end end
function nodecore.sound_play_except(name, def, pname) function nodecore.sound_play_except(name, def, pname)