Update helptext of obsidian
[MineClone/MineClone2.git] / mods / CORE / mcl_sounds / init.lua
blobb4d43f0c8d922e023eb7fca87d4f5f3ba43ffe42
1 --
2 -- Sounds
3 --
5 mcl_sounds = {}
7 function mcl_sounds.node_sound_defaults(table)
8 table = table or {}
9 table.footstep = table.footstep or
10 {name="", gain=1.0}
11 table.dug = table.dug or
12 {name="default_dug_node", gain=0.25}
13 table.dig = table.dig or
14 {name="default_dig_oddly_breakable_by_hand", gain=1.0}
15 table.place = table.place or
16 {name="default_place_node_hard", gain=1.0}
17 return table
18 end
20 function mcl_sounds.node_sound_stone_defaults(table)
21 table = table or {}
22 table.footstep = table.footstep or
23 {name="default_hard_footstep", gain=0.5}
24 table.dug = table.dug or
25 {name="default_hard_footstep", gain=1.0}
26 table.dig = table.dig or
27 {name="default_dig_cracky", gain=1.0}
28 mcl_sounds.node_sound_defaults(table)
29 return table
30 end
32 function mcl_sounds.node_sound_metal_defaults(table)
33 table = table or {}
34 table.footstep = table.footstep or
35 {name="default_metal_footstep", gain=0.5}
36 table.dug = table.dug or
37 {name="default_dug_metal", gain=1.0}
38 table.dig = table.dig or
39 {name="default_dig_metal", gain=1.0}
40 table.place = table.place or
41 {name="default_place_node_metal", gain=1.0}
42 mcl_sounds.node_sound_defaults(table)
43 return table
44 end
46 function mcl_sounds.node_sound_dirt_defaults(table)
47 table = table or {}
48 table.footstep = table.footstep or
49 {name="default_dirt_footstep", gain=1.0}
50 table.dug = table.dug or
51 {name="default_dirt_footstep", gain=1.5}
52 table.dig = table.dig or
53 {name="default_dig_crumbly", gain=1.0}
54 table.place = table.place or
55 {name="default_place_node", gain=1.0}
56 mcl_sounds.node_sound_defaults(table)
57 return table
58 end
60 function mcl_sounds.node_sound_sand_defaults(table)
61 table = table or {}
62 table.footstep = table.footstep or
63 {name="default_sand_footstep", gain=0.5}
64 table.dug = table.dug or
65 {name="default_sand_footstep", gain=1.0}
66 table.dig = table.dig or
67 {name="default_dig_crumbly", gain=1.0}
68 table.place = table.place or
69 {name="default_place_node", gain=1.0}
70 mcl_sounds.node_sound_defaults(table)
71 return table
72 end
74 function mcl_sounds.node_sound_snow_defaults(table)
75 table = table or {}
76 table.footstep = table.footstep or
77 {name="pedology_snow_soft_footstep", gain=0.5}
78 table.dug = table.dug or
79 {name="pedology_snow_soft_footstep", gain=1.0}
80 table.dig = table.dig or
81 {name="default_dig_crumbly", gain=1.0}
82 table.place = table.place or
83 {name="default_place_node", gain=1.0}
84 mcl_sounds.node_sound_defaults(table)
85 return table
86 end
88 function mcl_sounds.node_sound_wood_defaults(table)
89 table = table or {}
90 table.footstep = table.footstep or
91 {name="default_wood_footstep", gain=0.5}
92 table.dug = table.dug or
93 {name="default_wood_footstep", gain=1.0}
94 table.dig = table.dig or
95 {name="default_dig_choppy", gain=1.0}
96 mcl_sounds.node_sound_defaults(table)
97 return table
98 end
100 function mcl_sounds.node_sound_wool_defaults(table)
101 table = table or {}
102 table.footstep = table.footstep or
103 {name="mcl_sounds_cloth", gain=0.5}
104 table.dug = table.dug or
105 {name="mcl_sounds_cloth", gain=1.0}
106 table.dig = table.dig or
107 {name="mcl_sounds_cloth", gain=0.9}
108 table.place = table.dig or
109 {name="mcl_sounds_cloth", gain=1.0}
110 mcl_sounds.node_sound_defaults(table)
111 return table
114 function mcl_sounds.node_sound_leaves_defaults(table)
115 table = table or {}
116 table.footstep = table.footstep or
117 {name="default_grass_footstep", gain=0.35}
118 table.dug = table.dug or
119 {name="default_grass_footstep", gain=0.85}
120 table.dig = table.dig or
121 {name="default_dig_snappy", gain=0.4}
122 table.place = table.place or
123 {name="default_place_node", gain=1.0}
124 mcl_sounds.node_sound_defaults(table)
125 return table
128 function mcl_sounds.node_sound_glass_defaults(table)
129 table = table or {}
130 table.footstep = table.footstep or
131 {name="default_glass_footstep", gain=0.5}
132 table.dug = table.dug or
133 {name="default_break_glass", gain=1.0}
134 table.dig = table.dig or
135 {name="default_dig_cracky", gain=1.0}
136 mcl_sounds.node_sound_defaults(table)
137 return table
140 function mcl_sounds.node_sound_water_defaults(table)
141 table = table or {}
142 table.footstep = table.footstep or
143 {name = "default_water_footstep", gain = 0.2}
144 table.place = table.place or
145 {name = "mcl_sounds_place_node_water", gain = 1.0}
146 table.dug = table.dug or
147 {name = "mcl_sounds_dug_water", gain = 1.0}
148 mcl_sounds.node_sound_defaults(table)
149 return table
152 function mcl_sounds.node_sound_lava_defaults(table)
153 table = table or {}
154 -- TODO: Footstep
155 table.place = table.place or
156 {name = "default_place_node_lava", gain = 1.0}
157 table.dug = table.dug or
158 {name = "default_place_node_lava", gain = 1.0}
159 -- TODO: Different dug sound
160 mcl_sounds.node_sound_defaults(table)
161 return table
164 -- Player death sound
165 minetest.register_on_dieplayer(function(player)
166 -- TODO: Add separate death sound
167 minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true)
168 end)