1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-29 13:20:25 +02:00

Footstep sounds: 5 new sounds

Original recording by Ryding.
http://freesound.org/people/Ryding/
Found by Anth0rx, edited by paramat.

Add and use 'default.node_sound_snow_defaults()' function.
This commit is contained in:
paramat
2017-10-21 07:01:23 +01:00
committed by paramat
parent 045abbd6d7
commit 3f14d1012d
10 changed files with 73 additions and 30 deletions

View File

@ -1,5 +1,3 @@
-- mods/default/functions.lua
--
-- Sounds
--
@ -117,6 +115,21 @@ function default.node_sound_water_defaults(table)
return table
end
function default.node_sound_snow_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name = "default_snow_footstep", gain = 0.2}
table.dig = table.dig or
{name = "default_snow_footstep", gain = 0.3}
table.dug = table.dug or
{name = "default_snow_footstep", gain = 0.3}
table.place = table.place or
{name = "default_place_node", gain = 1.0}
default.node_sound_defaults(table)
return table
end
--
-- Lavacooling
--
@ -145,8 +158,9 @@ if minetest.settings:get_bool("enable_lavacooling") ~= false then
})
end
--
-- optimized helper to put all items in an inventory into a drops list
-- Optimized helper to put all items in an inventory into a drops list
--
function default.get_inventory_drops(pos, inventory, drops)
@ -161,11 +175,12 @@ function default.get_inventory_drops(pos, inventory, drops)
end
end
--
-- Papyrus and cactus growing
--
-- wrapping the functions in abm action is necessary to make overriding them possible
-- Wrapping the functions in ABM action is necessary to make overriding them possible
function default.grow_cactus(pos, node)
if node.param2 >= 4 then
@ -242,7 +257,7 @@ minetest.register_abm({
--
-- dig upwards
-- Dig upwards
--
function default.dig_up(pos, node, digger)
@ -386,6 +401,7 @@ function default.register_leafdecay(def)
end
end
--
-- Convert dirt to something that fits the environment
--
@ -538,7 +554,7 @@ minetest.register_abm({
--
-- NOTICE: This method is not an official part of the API yet!
-- NOTICE: This method is not an official part of the API yet.
-- This method may change in future.
--
@ -558,7 +574,7 @@ function default.can_interact_with_node(player, pos)
return true
end
-- is player wielding the right key?
-- Is player wielding the right key?
local item = player:get_wielded_item()
if item:get_name() == "default:key" then
local key_meta = item:get_meta()