Skip to content

Commit

Permalink
Digging and footstep sounds for everything that needs them! Plus, pus…
Browse files Browse the repository at this point in the history
…hing buttons, punching switches, and flipping levers all make sounds.
  • Loading branch information
Uberi committed Mar 7, 2013
1 parent 84d5546 commit 3792b69
Show file tree
Hide file tree
Showing 25 changed files with 50 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mesecons_blinkyplant/init.lua
Expand Up @@ -9,6 +9,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {
walkable = false,
groups = {dig_immediate=3, mesecon = 2},
description="Blinky Plant",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
Expand All @@ -29,6 +30,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
drop='"mesecons_blinkyplant:blinky_plant_off" 1',
light_source = LIGHT_MAX-7,
description = "Blinky Plant",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
Expand Down
6 changes: 5 additions & 1 deletion mesecons_button/init.lua
Expand Up @@ -6,6 +6,7 @@ mesecon.button_turnoff = function (pos)
local node = minetest.env:get_node(pos)
if node.name=="mesecons_button:button_on" then --has not been dug
mesecon:swap_node(pos, "mesecons_button:button_off")
minetest.sound_play("mesecons_button_pop", {pos=pos})
local rules = mesecon.rules.buttonlike_get(node)
mesecon:receptor_off(pos, rules)
end
Expand Down Expand Up @@ -41,9 +42,11 @@ minetest.register_node("mesecons_button:button_off", {
description = "Button",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_button:button_on")
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.after(1, mesecon.button_turnoff, pos)
end,
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off,
rules = mesecon.rules.buttonlike_get
Expand Down Expand Up @@ -80,6 +83,7 @@ minetest.register_node("mesecons_button:button_on", {
groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon_needs_receiver = 1},
drop = 'mesecons_button:button_off',
description = "Button",
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
rules = mesecon.rules.buttonlike_get
Expand Down
Binary file added mesecons_button/sounds/mesecons_button_pop.ogg
Binary file not shown.
Binary file added mesecons_button/sounds/mesecons_button_push.ogg
Binary file not shown.
2 changes: 2 additions & 0 deletions mesecons_commandblock/init.lua
Expand Up @@ -152,6 +152,7 @@ minetest.register_node("mesecons_commandblock:commandblock_off", {
local owner = minetest.env:get_meta(pos):get_string("owner")
return owner == "" or owner == player:get_player_name()
end,
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_on = commandblock_action_on
}}
Expand All @@ -169,6 +170,7 @@ minetest.register_node("mesecons_commandblock:commandblock_on", {
local owner = minetest.env:get_meta(pos):get_string("owner")
return owner == "" or owner == player:get_player_name()
end,
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_off = commandblock_action_off
}}
Expand Down
2 changes: 2 additions & 0 deletions mesecons_compatibility/init.lua
Expand Up @@ -153,6 +153,7 @@ doors:register_door("doors:door_wood", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_wood_b.png", "door_brown.png"},
tiles_top = {"door_wood_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(),
})

doors:register_door("doors:door_steel", {
Expand All @@ -162,4 +163,5 @@ doors:register_door("doors:door_steel", {
tiles_bottom = {"door_steel_b.png", "door_grey.png"},
tiles_top = {"door_steel_a.png", "door_grey.png"},
only_placer_can_open = true,
sounds = default.node_sound_stone_defaults(),
})
1 change: 1 addition & 0 deletions mesecons_delayer/init.lua
Expand Up @@ -110,6 +110,7 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
end,
delayer_time = delaytime,
delayer_onstate = "mesecons_delayer:delayer_on_"..tostring(i),
sounds = default.node_sound_stone_defaults(),
mesecons = {
receptor =
{
Expand Down
2 changes: 2 additions & 0 deletions mesecons_detector/init.lua
Expand Up @@ -54,6 +54,7 @@ minetest.register_node("mesecons_detector:object_detector_off", {
}},
on_construct = object_detector_make_formspec,
on_receive_fields = object_detector_on_receive_fields,
sounds = default.node_sound_stone_defaults(),
digiline = object_detector_digiline
})

Expand All @@ -68,6 +69,7 @@ minetest.register_node("mesecons_detector:object_detector_on", {
}},
on_construct = object_detector_make_formspec,
on_receive_fields = object_detector_on_receive_fields,
sounds = default.node_sound_stone_defaults(),
digiline = object_detector_digiline
})

Expand Down
1 change: 1 addition & 0 deletions mesecons_gates/init.lua
Expand Up @@ -156,6 +156,7 @@ for _, gate in ipairs(gates) do
end,
groups = groups,
drop = drop,
sounds = default.node_sound_stone_defaults(),
mesecons_gate = gate.name,
mesecons =
{
Expand Down
2 changes: 2 additions & 0 deletions mesecons_hydroturbine/init.lua
Expand Up @@ -23,6 +23,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_off", {
{-0.45, 1.15, -0.1, 0.45, 1.45, 0.1},
{-0.1, 1.15, -0.45, 0.1, 1.45, 0.45}},
},
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off
}}
Expand All @@ -49,6 +50,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
{-0.5, 1.15, -0.1, 0.5, 1.45, 0.1},
{-0.1, 1.15, -0.5, 0.1, 1.45, 0.5}},
},
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}}
Expand Down
2 changes: 2 additions & 0 deletions mesecons_lamp/init.lua
Expand Up @@ -22,6 +22,7 @@ minetest.register_node("mesecons_lamp:lamp_on", {
selection_box = mesecon_lamp_box,
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon_effector_on = 1},
drop='"mesecons_lamp:lamp_off" 1',
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = {
action_off = function (pos, node)
mesecon:swap_node(pos, "mesecons_lamp:lamp_off")
Expand All @@ -42,6 +43,7 @@ minetest.register_node("mesecons_lamp:lamp_off", {
selection_box = mesecon_lamp_box,
groups = {dig_immediate=3, mesecon_receptor_off = 1, mesecon_effector_off = 1},
description="Meselamp",
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
mesecon:swap_node(pos, "mesecons_lamp:lamp_on")
Expand Down
2 changes: 2 additions & 0 deletions mesecons_lightstone/init.lua
Expand Up @@ -4,6 +4,7 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
inventory_image = minetest.inventorycube(texture_off),
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
description=name.." Lightstone",
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_on")
Expand All @@ -16,6 +17,7 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on)
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
drop = "node mesecons_lightstone:lightstone_" .. name .. "_off 1",
light_source = LIGHT_MAX-2,
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_off = function (pos, node)
mesecon:swap_node(pos, "mesecons_lightstone:lightstone_" .. name .. "_off")
Expand Down
1 change: 1 addition & 0 deletions mesecons_luacontroller/init.lua
Expand Up @@ -421,6 +421,7 @@ minetest.register_node(nodename, {
if err then print(err) end
reset_meta(pos, fields.code, err)
end,
sounds = default.node_sound_stone_defaults(),
mesecons = mesecons,
digiline = digiline,
is_luacontroller = true,
Expand Down
1 change: 1 addition & 0 deletions mesecons_microcontroller/init.lua
Expand Up @@ -128,6 +128,7 @@ minetest.register_node(nodename, {
yc_reset (pos)
update_yc(pos)
end,
sounds = default.node_sound_stone_defaults(),
mesecons = mesecons,
after_dig_node = function (pos, node)
rules = mesecon:get_rules(node.name)
Expand Down
2 changes: 2 additions & 0 deletions mesecons_movestones/init.lua
Expand Up @@ -61,6 +61,7 @@ minetest.register_node("mesecons_movestones:movestone", {
legacy_facedir_simple = true,
groups = {cracky=3},
description="Movestone",
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
local direction=mesecon:get_movestone_direction(pos)
Expand Down Expand Up @@ -131,6 +132,7 @@ minetest.register_node("mesecons_movestones:sticky_movestone", {
legacy_facedir_simple = true,
groups = {cracky=3},
description="Sticky Movestone",
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
local direction=mesecon:get_movestone_direction(pos)
Expand Down
1 change: 1 addition & 0 deletions mesecons_noteblock/init.lua
Expand Up @@ -14,6 +14,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
minetest.env:add_node(pos, {name = node.name, param2 = param2})
mesecon.noteblock_play(pos, param2)
end,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector = { -- play sound when activated
action_on = function (pos, node)
mesecon.noteblock_play(pos, node.param2)
Expand Down
11 changes: 11 additions & 0 deletions mesecons_pistons/init.lua
Expand Up @@ -136,6 +136,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_normal,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
rules = piston_get_rules
Expand Down Expand Up @@ -163,6 +164,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
node_box = piston_on_box,
selection_box = piston_on_box,
mesecons_piston = pistonspec_normal,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
rules = piston_get_rules
Expand Down Expand Up @@ -215,6 +217,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
paramtype2 = "facedir",
after_place_node = piston_orientate,
mesecons_piston = pistonspec_sticky,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
rules = piston_get_rules
Expand Down Expand Up @@ -242,6 +245,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
node_box = piston_on_box,
selection_box = piston_on_box,
mesecons_piston = pistonspec_sticky,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
rules = piston_get_rules
Expand Down Expand Up @@ -339,6 +343,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
node_box = piston_up_on_box,
selection_box = piston_up_on_box,
mesecons_piston = pistonspec_normal_up,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
}}
Expand Down Expand Up @@ -393,6 +398,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
paramtype2 = "facedir",
drop = "mesecons_pistons:piston_sticky_off",
mesecons_piston = pistonspec_sticky_up,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
}}
Expand All @@ -419,6 +425,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
node_box = piston_up_on_box,
selection_box = piston_up_on_box,
mesecons_piston = pistonspec_sticky_up,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
}}
Expand Down Expand Up @@ -491,6 +498,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
paramtype2 = "facedir",
drop = "mesecons_pistons:piston_normal_off",
mesecons_piston = pistonspec_normal_down,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
}}
Expand All @@ -517,6 +525,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
node_box = piston_down_on_box,
selection_box = piston_down_on_box,
mesecons_piston = pistonspec_normal_down,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
}}
Expand Down Expand Up @@ -567,6 +576,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
paramtype2 = "facedir",
drop = "mesecons_pistons:piston_sticky_off",
mesecons_piston = pistonspec_sticky_down,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
}}
Expand All @@ -593,6 +603,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
node_box = piston_down_on_box,
selection_box = piston_down_on_box,
mesecons_piston = pistonspec_sticky_down,
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
}}
Expand Down
1 change: 1 addition & 0 deletions mesecons_powerplant/init.lua
Expand Up @@ -15,6 +15,7 @@ minetest.register_node("mesecons_powerplant:power_plant", {
type = "fixed",
fixed = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
},
sounds = default.node_sound_leaves_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}}
Expand Down
1 change: 1 addition & 0 deletions mesecons_pressureplates/init.lua
Expand Up @@ -85,6 +85,7 @@ function mesecon:register_pressure_plate(offstate, onstate, description, texture
drop = offstate,
pressureplate = ppspec,
on_timer = pp_on_timer,
sounds = default.node_sound_wood_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}},
Expand Down
1 change: 1 addition & 0 deletions mesecons_random/init.lua
Expand Up @@ -5,6 +5,7 @@ minetest.register_node("mesecons_random:removestone", {
inventory_image = minetest.inventorycube("jeija_removestone_inv.png"),
groups = {cracky=3},
description="Removestone",
sounds = default.node_sound_stone_defaults(),
mesecons = {effector = {
action_on = function (pos, node)
minetest.env:remove_node(pos)
Expand Down
2 changes: 2 additions & 0 deletions mesecons_solarpanel/init.lua
Expand Up @@ -22,6 +22,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", {
},
drop = "mesecons_solarpanel:solar_panel_off",
groups = {dig_immediate=3, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}}
Expand Down Expand Up @@ -51,6 +52,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
},
groups = {dig_immediate=3},
description="Solar Panel",
sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = {
state = mesecon.state.off
}}
Expand Down
4 changes: 4 additions & 0 deletions mesecons_switch/init.lua
Expand Up @@ -5,12 +5,14 @@ minetest.register_node("mesecons_switch:mesecon_switch_off", {
paramtype2="facedir",
groups = {dig_immediate=2},
description="Switch",
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off
}},
on_punch = function(pos, node)
mesecon:swap_node(pos, "mesecons_switch:mesecon_switch_on")
mesecon:receptor_on(pos)
minetest.sound_play("mesecons_switch", {pos=pos})
end
})

Expand All @@ -19,12 +21,14 @@ minetest.register_node("mesecons_switch:mesecon_switch_on", {
paramtype2="facedir",
groups = {dig_immediate=2,not_in_creative_inventory=1},
drop='"mesecons_switch:mesecon_switch_off" 1',
sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on
}},
on_punch = function(pos, node)
mesecon:swap_node(pos, "mesecons_switch:mesecon_switch_off")
mesecon:receptor_off(pos)
minetest.sound_play("mesecons_switch", {pos=pos})
end
})

Expand Down
Binary file added mesecons_switch/sounds/mesecons_switch.ogg
Binary file not shown.
4 changes: 4 additions & 0 deletions mesecons_walllever/init.lua
Expand Up @@ -34,7 +34,9 @@ minetest.register_node("mesecons_walllever:wall_lever_off", {
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_on")
mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_lever", {pos=pos})
end,
sounds = default.node_sound_wood_defaults(),
mesecons = {receptor = {
rules = mesecon.rules.buttonlike_get,
state = mesecon.state.off
Expand Down Expand Up @@ -74,7 +76,9 @@ minetest.register_node("mesecons_walllever:wall_lever_on", {
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off")
mesecon:receptor_off(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_lever", {pos=pos})
end,
sounds = default.node_sound_wood_defaults(),
mesecons = {receptor = {
rules = mesecon.rules.buttonlike_get,
state = mesecon.state.on
Expand Down
Binary file added mesecons_walllever/sounds/mesecons_lever.ogg
Binary file not shown.

0 comments on commit 3792b69

Please sign in to comment.