commit cf30aae90df9e0bbc465216738c13d45cd0734c6 Author: RealBadAngel Date: Sun Jun 29 18:36:29 2014 +0200 Plasma lamp controlled with mesecons. diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..acaa924 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +mesecons diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..af2d0a2 --- /dev/null +++ b/init.lua @@ -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 }} +}) + diff --git a/textures/glass_face_streaks.png b/textures/glass_face_streaks.png new file mode 100644 index 0000000..6ad9629 Binary files /dev/null and b/textures/glass_face_streaks.png differ diff --git a/textures/plasma_storm.png b/textures/plasma_storm.png new file mode 100644 index 0000000..ac29736 Binary files /dev/null and b/textures/plasma_storm.png differ diff --git a/textures/steel_frame.png b/textures/steel_frame.png new file mode 100644 index 0000000..383eab7 Binary files /dev/null and b/textures/steel_frame.png differ