2017-02-11 17:46:23 +00:00
|
|
|
--
|
|
|
|
-- Sounds
|
|
|
|
--
|
|
|
|
|
|
|
|
mcl_sounds = {}
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
|
|
|
{name="", gain=1.0}
|
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_dug_node", gain=0.25}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_oddly_breakable_by_hand", gain=0.5}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_place_node_hard", gain=1.0}
|
2017-02-11 17:46:23 +00:00
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_stone_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_hard_footstep", gain=0.2}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_hard_footstep", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_cracky", gain=0.5}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
2017-06-06 19:10:24 +00:00
|
|
|
function mcl_sounds.node_sound_metal_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_metal_footstep", gain=0.2}
|
2017-06-06 19:10:24 +00:00
|
|
|
table.dug = table.dug or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dug_metal", gain=0.5}
|
2017-06-06 19:10:24 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_metal", gain=0.5}
|
2017-06-06 19:10:24 +00:00
|
|
|
table.place = table.place or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_place_node_metal", gain=0.5}
|
2017-06-06 19:10:24 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
2017-02-11 17:46:23 +00:00
|
|
|
|
|
|
|
function mcl_sounds.node_sound_dirt_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dirt_footstep", gain=0.25}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dirt_footstep", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_crumbly", gain=0.4}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_place_node", gain=1.0}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_sand_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_sand_footstep", gain=0.05}
|
|
|
|
table.dug = table.dug or
|
|
|
|
{name="default_sand_footstep", gain=0.15}
|
|
|
|
table.dig = table.dig or
|
|
|
|
{name="default_dig_crumbly", gain=0.4}
|
|
|
|
table.place = table.place or
|
|
|
|
{name="default_place_node", gain=1.0}
|
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_gravel_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
|
|
|
{name="default_gravel_footstep", gain=0.25}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_gravel_dug", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_gravel_dig", gain=0.35}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_place_node", gain=1.0}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
2017-02-19 18:48:16 +00:00
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_snow_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2017-07-30 23:01:18 +00:00
|
|
|
{name="pedology_snow_soft_footstep", gain=0.5}
|
2017-02-19 18:48:16 +00:00
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="pedology_snow_soft_footstep", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-21 21:39:26 +00:00
|
|
|
{name="pedology_snow_soft_footstep", gain=1.0}
|
2017-02-19 18:48:16 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_place_node", gain=1.0}
|
2017-02-19 18:48:16 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
2017-02-11 17:46:23 +00:00
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
2022-12-20 19:57:57 +00:00
|
|
|
function mcl_sounds.node_sound_ice_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
|
|
|
{name="default_ice_footstep", gain=0.15}
|
|
|
|
table.dug = table.dug or
|
|
|
|
{name="default_ice_dug", gain=0.5}
|
|
|
|
table.dig = table.dig or
|
|
|
|
{name="default_ice_dig", gain=0.5}
|
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
2017-02-11 17:46:23 +00:00
|
|
|
function mcl_sounds.node_sound_wood_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_wood_footstep", gain=0.15}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_wood_footstep", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_choppy", gain=0.4}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
2019-06-14 21:01:50 +00:00
|
|
|
function mcl_sounds.node_sound_wool_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
|
|
|
{name="mcl_sounds_cloth", gain=0.5}
|
|
|
|
table.dug = table.dug or
|
|
|
|
{name="mcl_sounds_cloth", gain=1.0}
|
|
|
|
table.dig = table.dig or
|
|
|
|
{name="mcl_sounds_cloth", gain=0.9}
|
|
|
|
table.place = table.dig or
|
|
|
|
{name="mcl_sounds_cloth", gain=1.0}
|
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
2017-02-11 17:46:23 +00:00
|
|
|
function mcl_sounds.node_sound_leaves_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 20:12:56 +00:00
|
|
|
{name="default_grass_footstep", gain=0.1325}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2022-12-20 20:12:56 +00:00
|
|
|
{name="default_grass_footstep", gain=0.425}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dig = table.dig or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_dig_snappy", gain=0.4}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_place_node", gain=1.0}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
|
|
|
|
|
|
|
function mcl_sounds.node_sound_glass_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_glass_footstep", gain=0.3}
|
2017-02-11 17:46:23 +00:00
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name="default_break_glass", gain=1.0}
|
2017-02-25 15:30:10 +00:00
|
|
|
table.dig = table.dig or
|
2022-12-20 19:57:57 +00:00
|
|
|
{name="default_dig_cracky", gain=0.5}
|
2017-02-11 17:46:23 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
2017-06-06 19:10:24 +00:00
|
|
|
|
|
|
|
function mcl_sounds.node_sound_water_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
table.footstep = table.footstep or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name = "default_water_footstep", gain = 0.2}
|
2017-06-06 19:50:03 +00:00
|
|
|
table.place = table.place or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name = "mcl_sounds_place_node_water", gain = 1.0}
|
2017-06-06 19:50:03 +00:00
|
|
|
table.dug = table.dug or
|
2017-07-30 23:00:15 +00:00
|
|
|
{name = "mcl_sounds_dug_water", gain = 1.0}
|
2017-06-06 19:10:24 +00:00
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
2017-11-21 22:38:20 +00:00
|
|
|
|
2018-01-12 01:26:12 +00:00
|
|
|
function mcl_sounds.node_sound_lava_defaults(table)
|
|
|
|
table = table or {}
|
|
|
|
-- TODO: Footstep
|
|
|
|
table.place = table.place or
|
|
|
|
{name = "default_place_node_lava", gain = 1.0}
|
|
|
|
table.dug = table.dug or
|
|
|
|
{name = "default_place_node_lava", gain = 1.0}
|
|
|
|
-- TODO: Different dug sound
|
|
|
|
mcl_sounds.node_sound_defaults(table)
|
|
|
|
return table
|
|
|
|
end
|
2017-11-21 22:38:20 +00:00
|
|
|
|
|
|
|
-- Player death sound
|
|
|
|
minetest.register_on_dieplayer(function(player)
|
|
|
|
-- TODO: Add separate death sound
|
2020-04-06 22:55:45 +00:00
|
|
|
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true)
|
2017-11-21 22:38:20 +00:00
|
|
|
end)
|