2013-03-18 00:09:42 +01:00
|
|
|
-- Various home electronics
|
|
|
|
|
2013-10-22 02:31:54 +02:00
|
|
|
local S = homedecor.gettext
|
2013-03-18 00:09:42 +01:00
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("speaker", {
|
2013-03-18 00:09:42 +01:00
|
|
|
description = S("Large Stereo Speaker"),
|
2015-03-28 03:55:41 +01:00
|
|
|
mesh="homedecor_speaker_large.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_speaker_sides.png",
|
|
|
|
"homedecor_speaker_front.png"
|
|
|
|
},
|
2013-03-18 00:09:42 +01:00
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
2015-03-28 05:03:38 +01:00
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
|
|
|
minetest.set_node(pos, {name = "homedecor:speaker_open", param2 = node.param2})
|
|
|
|
end
|
2013-03-18 00:09:42 +01:00
|
|
|
})
|
|
|
|
|
2015-03-28 05:00:23 +01:00
|
|
|
homedecor.register("speaker_open", {
|
|
|
|
description = S("Large Stereo Speaker, open front"),
|
|
|
|
mesh="homedecor_speaker_large_open.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_speaker_sides.png",
|
|
|
|
"homedecor_speaker_driver.png",
|
|
|
|
"homedecor_speaker_open_front.png",
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_black.png"
|
2015-03-28 05:00:23 +01:00
|
|
|
},
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
2015-03-28 05:03:38 +01:00
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
|
|
|
minetest.set_node(pos, {name = "homedecor:speaker", param2 = node.param2})
|
|
|
|
end
|
2015-03-28 05:00:23 +01:00
|
|
|
})
|
|
|
|
|
2015-03-28 03:55:41 +01:00
|
|
|
local spk_cbox = {
|
|
|
|
type = "fixed",
|
2015-03-28 05:01:15 +01:00
|
|
|
fixed = { -3/16, -8/16, 1/16, 3/16, -2/16, 7/16 }
|
2015-03-28 03:55:41 +01:00
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("speaker_small", {
|
2013-03-18 00:09:42 +01:00
|
|
|
description = S("Small Surround Speaker"),
|
2015-03-28 03:55:41 +01:00
|
|
|
mesh="homedecor_speaker_small.obj",
|
2013-03-18 00:09:42 +01:00
|
|
|
tiles = {
|
2015-03-28 03:55:41 +01:00
|
|
|
"homedecor_speaker_sides.png",
|
|
|
|
"homedecor_speaker_front.png"
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-03-28 03:55:41 +01:00
|
|
|
selection_box = spk_cbox,
|
|
|
|
collision_box = spk_cbox,
|
2013-03-18 00:09:42 +01:00
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("stereo", {
|
2013-03-18 00:09:42 +01:00
|
|
|
description = S("Stereo Receiver"),
|
|
|
|
tiles = { 'homedecor_stereo_top.png',
|
|
|
|
'homedecor_stereo_bottom.png',
|
2014-11-03 12:46:45 +01:00
|
|
|
'homedecor_stereo_left.png^[transformFX',
|
2013-03-18 00:09:42 +01:00
|
|
|
'homedecor_stereo_left.png',
|
|
|
|
'homedecor_stereo_back.png',
|
|
|
|
'homedecor_stereo_front.png'},
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("projection_screen", {
|
2013-03-18 00:09:42 +01:00
|
|
|
description = S("Projection Screen Material"),
|
|
|
|
drawtype = 'signlike',
|
|
|
|
tiles = { 'homedecor_projection_screen.png' },
|
|
|
|
wield_image = 'homedecor_projection_screen_inv.png',
|
|
|
|
inventory_image = 'homedecor_projection_screen_inv.png',
|
|
|
|
walkable = false,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
paramtype2 = 'wallmounted',
|
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
--wall_side = = <default>
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("television", {
|
2013-03-18 00:09:42 +01:00
|
|
|
description = S("Small CRT Television"),
|
|
|
|
tiles = { 'homedecor_television_top.png',
|
|
|
|
'homedecor_television_bottom.png',
|
2014-11-03 12:46:45 +01:00
|
|
|
'homedecor_television_left.png^[transformFX',
|
2013-03-18 00:09:42 +01:00
|
|
|
'homedecor_television_left.png',
|
|
|
|
'homedecor_television_back.png',
|
|
|
|
{ name="homedecor_television_front_animated.png",
|
|
|
|
animation={
|
|
|
|
type="vertical_frames",
|
|
|
|
aspect_w=16,
|
|
|
|
aspect_h=16,
|
|
|
|
length=80.0
|
2015-01-23 22:14:00 +01:00
|
|
|
}
|
2013-03-18 00:09:42 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
light_source = LIGHT_MAX - 1,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("dvd_vcr", {
|
2014-06-26 12:36:22 +02:00
|
|
|
description = S("DVD and VCR"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_dvdvcr_top.png",
|
|
|
|
"homedecor_dvdvcr_bottom.png",
|
|
|
|
"homedecor_dvdvcr_sides.png",
|
|
|
|
"homedecor_dvdvcr_sides.png^[transformFX",
|
|
|
|
"homedecor_dvdvcr_back.png",
|
|
|
|
"homedecor_dvdvcr_front.png",
|
|
|
|
},
|
2014-08-02 03:11:34 +02:00
|
|
|
inventory_image = "homedecor_dvdvcr_inv.png",
|
2014-06-26 12:36:22 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.3125, -0.5, -0.25, 0.3125, -0.375, 0.1875},
|
|
|
|
{-0.25, -0.5, -0.25, 0.25, -0.1875, 0.125},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-03-30 23:37:23 +02:00
|
|
|
local tel_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.1875, 0.25, -0.21, 0.15 }
|
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("telephone", {
|
2015-03-30 23:37:23 +02:00
|
|
|
mesh = "homedecor_telephone.obj",
|
2014-08-08 21:13:47 +02:00
|
|
|
tiles = {
|
2015-03-30 23:37:23 +02:00
|
|
|
"homedecor_telephone_dial.png",
|
|
|
|
"homedecor_telephone_base.png",
|
|
|
|
"homedecor_telephone_handset.png",
|
|
|
|
"homedecor_telephone_cord.png",
|
2014-08-08 21:13:47 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_telephone_inv.png",
|
|
|
|
description = "Telephone",
|
2015-01-23 22:14:00 +01:00
|
|
|
groups = {snappy=3},
|
2015-03-30 23:37:23 +02:00
|
|
|
selection_box = tel_cbox,
|
|
|
|
collision_box = tel_cbox,
|
2014-08-08 21:13:47 +02:00
|
|
|
})
|
|
|
|
|
2015-04-17 20:48:44 +02:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = "homedecor:telephone",
|
|
|
|
interval = 30,
|
|
|
|
chance = 10,
|
|
|
|
action = function(pos, node)
|
|
|
|
minetest.sound_play("homedecor_telephone_ringing", {
|
|
|
|
pos = pos,
|
|
|
|
gain = 1.0,
|
|
|
|
max_hear_distance = 10
|
|
|
|
})
|
|
|
|
end
|
|
|
|
})
|