add watercan sounds

master
HybridDog 2015-05-22 19:43:59 +02:00 committed by Auke Kok
parent 61815728f5
commit 20f1a5168e
6 changed files with 34 additions and 7 deletions

14
LICENSE
View File

@ -9,9 +9,19 @@ All source code (lua):
(C) Auke Kok <sofar@foo-projects.org>
LGPL-2.0+
All textures, models, sounds:
All textures, models:
(C) Auke Kok <sofar@foo-projects.org>
CC-BY-SA-3.0
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Sounds:
- crops_watercan_splash*
http://freesound.org/people/junggle/sounds/27361/
http://profiles.google.com/jun66le
CC-BY-3.0
- crops_watercan_entering.ogg
http://freesound.org/people/Quistard/sounds/166824/
CC-BY-3.0
* Sounds edited with audacity
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

View File

@ -110,7 +110,7 @@ crops.plant = function(pos, node)
end
crops.can_grow = function(pos)
if minetest.get_node_light(pos, nil) < crops.settings.light then
if minetest.get_node_light(pos) < crops.settings.light then
return false
end
local node = minetest.get_node(pos)
@ -214,9 +214,27 @@ minetest.register_tool("crops:watering_can", {
return itemstack
end
-- filling it up?
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "water") >= 3 then
itemstack:set_wear(1)
local wear = itemstack:get_wear()
if minetest.get_item_group(minetest.get_node(pos).name, "water") >= 3 then
if wear ~= 1 then
minetest.sound_play("crops_watercan_entering", {pos=pos, gain=0.8})
minetest.after(math.random()/2, function(pos)
if math.random(2) == 1 then
minetest.sound_play("crops_watercan_splash_quiet", {pos=pos, gain=0.1})
end
if math.random(3) == 1 then
minetest.after(math.random()/2, function(pos)
minetest.sound_play("crops_watercan_splash_small", {pos=pos, gain=0.7})
end, pos)
end
if math.random(3) == 1 then
minetest.after(math.random()/2, function(pos)
minetest.sound_play("crops_watercan_splash_big", {pos=pos, gain=0.7})
end, pos)
end
end, pos)
itemstack:set_wear(1)
end
return itemstack
end
-- using it on a top-half part of a plant?
@ -229,7 +247,6 @@ minetest.register_tool("crops:watering_can", {
if water == nil then
return itemstack
end
local wear = itemstack:get_wear()
-- empty?
if wear == 65534 then
return itemstack

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.