Plasma lamp controlled with mesecons.

This commit is contained in:
RealBadAngel 2014-06-29 18:36:29 +02:00
commit cf30aae90d
5 changed files with 34 additions and 0 deletions

1
depends.txt Normal file
View File

@ -0,0 +1 @@
mesecons

33
init.lua Normal file
View File

@ -0,0 +1,33 @@
minetest.register_node("plasmalamp:plasma_lamp_off", {
description = "Plasma Lamp",
drawtype = "glasslike_framed",
tiles = {"steel_frame.png","glass_face_streaks.png"},
paramtype = "light",
sunlight_propagates = true,
groups = {mesecon = 2, cracky = 3,oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = { action_on = function(pos,node)
minetest.swap_node(pos, {name = "plasmalamp:plasma_lamp_on", param2 = 255})
end }}
})
minetest.register_node("plasmalamp:plasma_lamp_on", {
description = "Plasma Lamp",
drawtype = "glasslike_framed",
tiles = {"steel_frame.png","glass_face_streaks.png"},
special_tiles = {
{
name="plasma_storm.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
}
},
paramtype = "light",
light_source = LIGHT_MAX - 1,
sunlight_propagates = true,
groups = {mesecon = 2, cracky = 3,oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
mesecons = {effector = { action_off = function(pos,node)
minetest.swap_node(pos, {name = "plasmalamp:plasma_lamp_off", param2 = 0})
end }}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

BIN
textures/plasma_storm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
textures/steel_frame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B