forked from Mineclonia/Mineclonia
Random pitch for eat/drink sounds
This commit is contained in:
parent
6f9e178084
commit
e37411dc13
|
@ -28,14 +28,14 @@ mcl_buckets.liquids = {}
|
||||||
local sound_place = function(itemname, pos)
|
local sound_place = function(itemname, pos)
|
||||||
local def = minetest.registered_nodes[itemname]
|
local def = minetest.registered_nodes[itemname]
|
||||||
if def and def.sounds and def.sounds.place then
|
if def and def.sounds and def.sounds.place then
|
||||||
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos})
|
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local sound_take = function(itemname, pos)
|
local sound_take = function(itemname, pos)
|
||||||
local def = minetest.registered_nodes[itemname]
|
local def = minetest.registered_nodes[itemname]
|
||||||
if def and def.sounds and def.sounds.dug then
|
if def and def.sounds and def.sounds.dug then
|
||||||
minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos})
|
minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso
|
||||||
pos = pos,
|
pos = pos,
|
||||||
max_hear_distance = 12,
|
max_hear_distance = 12,
|
||||||
gain = 1.0,
|
gain = 1.0,
|
||||||
|
pitch = 1 + math.random(-10, 10)*0.005,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
-- Assume the item is a food
|
-- Assume the item is a food
|
||||||
|
@ -186,6 +187,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso
|
||||||
pos = pos,
|
pos = pos,
|
||||||
max_hear_distance = 12,
|
max_hear_distance = 12,
|
||||||
gain = 1.0,
|
gain = 1.0,
|
||||||
|
pitch = 1 + math.random(-10, 10)*0.005,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue