From 40c4e95834ff97be1dd58c12012062af9d7513f6 Mon Sep 17 00:00:00 2001 From: cheapie Date: Mon, 28 Dec 2015 18:31:50 -0600 Subject: Add flash red mode --- trafficlight/init.lua | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'trafficlight') diff --git a/trafficlight/init.lua b/trafficlight/init.lua index 562068f..a042dee 100644 --- a/trafficlight/init.lua +++ b/trafficlight/init.lua @@ -33,6 +33,9 @@ streets.tlRythm = { }, toWarn = { {name = "streets:trafficlight_top_warn", pauseBefore = 0} + }, + toFlashRed = { + {name = "streets:trafficlight_top_flashred", pauseBefore = 0} } } @@ -80,6 +83,11 @@ streets.on_digiline_receive = function(pos, node, channel, msg) pos = pos, to = "toWarn" }) + elseif msg == "FLASHRED" then + streets.tlSwitch({ + pos = pos, + to = "toFlashRed" + }) elseif msg == "GET" then local state = minetest.get_meta(pos):get_string("state") if not state or state == "" then @@ -267,6 +275,32 @@ minetest.register_node(":streets:trafficlight_top_warn",{ }, }) +minetest.register_node(":streets:trafficlight_top_flashred",{ + drop = "streets:trafficlight_top_off", + groups = {cracky = 1, not_in_creative_inventory = 1}, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + drawtype = "nodebox", + tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ + name="streets_tl_flashred.png", + animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}, + }}, + node_box = { + type = "fixed", + fixed = streets.tlBox + }, + light_source = 6, + digiline = { + receptor = {}, + effector = { + action = function(pos, node, channel, msg) + streets.on_digiline_receive(pos, node, channel, msg) + end + } + }, +}) + minetest.register_craft({ output = "streets:trafficlight_top_off", recipe = { @@ -283,4 +317,4 @@ minetest.register_craft({ {"digilines:wire_std_00000000", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000"}, {"", "digilines:wire_std_00000000", ""} } -}) \ No newline at end of file +}) -- cgit v1.2.3