diff options
author | HybridDog <adresse_test@t-online.de> | 2015-05-22 19:43:59 +0200 |
---|---|---|
committer | Auke Kok <sofar@foo-projects.org> | 2015-05-25 15:52:57 -0700 |
commit | 20f1a5168e64486fff16f16807f2014797f35b89 (patch) | |
tree | 1233a6a117ab40ef4133ca78ff58d27c79803bf9 | |
parent | 61815728f58b018256c924aa7d03deb7290d6003 (diff) |
add watercan sounds
-rw-r--r-- | LICENSE | 14 | ||||
-rw-r--r-- | init.lua | 27 | ||||
-rw-r--r-- | sounds/crops_watercan_entering.ogg | bin | 0 -> 18988 bytes | |||
-rw-r--r-- | sounds/crops_watercan_splash_big.ogg | bin | 0 -> 21733 bytes | |||
-rw-r--r-- | sounds/crops_watercan_splash_quiet.ogg | bin | 0 -> 4950 bytes | |||
-rw-r--r-- | sounds/crops_watercan_splash_small.ogg | bin | 0 -> 5988 bytes |
6 files changed, 34 insertions, 7 deletions
@@ -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 +=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ @@ -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 diff --git a/sounds/crops_watercan_entering.ogg b/sounds/crops_watercan_entering.ogg Binary files differnew file mode 100644 index 0000000..68212bc --- /dev/null +++ b/sounds/crops_watercan_entering.ogg diff --git a/sounds/crops_watercan_splash_big.ogg b/sounds/crops_watercan_splash_big.ogg Binary files differnew file mode 100644 index 0000000..19c4b5e --- /dev/null +++ b/sounds/crops_watercan_splash_big.ogg diff --git a/sounds/crops_watercan_splash_quiet.ogg b/sounds/crops_watercan_splash_quiet.ogg Binary files differnew file mode 100644 index 0000000..9518e17 --- /dev/null +++ b/sounds/crops_watercan_splash_quiet.ogg diff --git a/sounds/crops_watercan_splash_small.ogg b/sounds/crops_watercan_splash_small.ogg Binary files differnew file mode 100644 index 0000000..7c02b3e --- /dev/null +++ b/sounds/crops_watercan_splash_small.ogg |