diff options
author | cheapie <no-email-for-you@example.com> | 2016-01-10 02:14:35 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2016-01-10 02:14:35 -0600 |
commit | 8b614bf8365a491299d4fdc33e4c45ab741ecfa0 (patch) | |
tree | 1cd403830671e5fc6252c3a85fafb202ee2b3d8f /infrastructure/advanced_crosswalk_lighting.lua | |
parent | f45815cbdc9b8bd38da48f25eac3dfc26fc13621 (diff) | |
download | roads-8b614bf8365a491299d4fdc33e4c45ab741ecfa0.tar roads-8b614bf8365a491299d4fdc33e4c45ab741ecfa0.tar.gz roads-8b614bf8365a491299d4fdc33e4c45ab741ecfa0.tar.bz2 roads-8b614bf8365a491299d4fdc33e4c45ab741ecfa0.tar.xz roads-8b614bf8365a491299d4fdc33e4c45ab741ecfa0.zip |
Add infrastructure as normal content
It will be developed as part of this mod now.
Diffstat (limited to 'infrastructure/advanced_crosswalk_lighting.lua')
-rw-r--r-- | infrastructure/advanced_crosswalk_lighting.lua | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/infrastructure/advanced_crosswalk_lighting.lua b/infrastructure/advanced_crosswalk_lighting.lua new file mode 100644 index 0000000..4e669c1 --- /dev/null +++ b/infrastructure/advanced_crosswalk_lighting.lua @@ -0,0 +1,85 @@ +-- Crosswalk lighting + minetest.register_node("infrastructure:crosswalk_lighting_dark", { + description = "Crosswalk lighting", + tiles = { + "infrastructure_traffic_lights_side.png", + "infrastructure_crosswalk_lighting_bottom.png", + "infrastructure_traffic_lights_side.png", + "infrastructure_traffic_lights_side.png", + "infrastructure_crosswalk_lighting_back.png", + "infrastructure_crosswalk_lighting_front.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3}, + node_box = { + type = "fixed", + fixed = { + {-3/8, -1/2, -1/4, 3/8, 1/2, -3/16}, + {-3/8, -1/2, 3/16, 3/8, 1/2, 1/4}, + {-1/4, 1/4, -3/16, -1/8, 3/8, 3/16}, + {1/8, 1/4, -3/16, 1/4, 3/8, 3/16}, + {-1/8, -1/2, -3/16, 1/8, -1/4, 3/16}, + {-1/2, -1/2, -1/8, 1/2, -3/8, 1/8}, + } + }, + selection_box = { + type = "fixed", + fixed = {-3/8, -1/2, -1/4, 3/8, 1/2, 1/4} + }, + + on_punch = function(pos, node) + minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_bright", param2 = node.param2}) + end, + + mesecons = {effector = { + action_on = function (pos, node) + minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_bright", param2 = node.param2}) + end, + }} + }) + + minetest.register_node("infrastructure:crosswalk_lighting_bright", { + tiles = { + "infrastructure_traffic_lights_side.png", + "infrastructure_crosswalk_lighting_bottom.png", + "infrastructure_traffic_lights_side.png", + "infrastructure_traffic_lights_side.png", + "infrastructure_crosswalk_lighting_back.png", + "infrastructure_crosswalk_lighting_front.png" + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 3, not_in_creative_inventory = 1}, + light_source = CROSSWALK_LIGHTING_LIGHT_RANGE, + drop = "infrastructure:crosswalk_lighting_dark", + node_box = { + type = "fixed", + fixed = { + {-3/8, -1/2, -1/4, 3/8, 1/2, -3/16}, + {-3/8, -1/2, 3/16, 3/8, 1/2, 1/4}, + {-1/4, 1/4, -3/16, -1/8, 3/8, 3/16}, + {1/8, 1/4, -3/16, 1/4, 3/8, 3/16}, + {-1/8, -1/2, -3/16, 1/8, -1/4, 3/16}, + {-1/2, -1/2, -1/8, 1/2, -3/8, 1/8}, + } + }, + selection_box = { + type = "fixed", + fixed = {-3/8, -1/2, -1/4, 3/8, 1/2, 1/4} + }, + + on_punch = function(pos, node) + minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_dark", param2 = node.param2}) + end, + + mesecons = {effector = { + action_off = function (pos, node) + minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_dark", param2 = node.param2}) + end, + }} + }) + + minetest.register_alias("infrastructure:crosswalk_lighting", "infrastructure:crosswalk_lighting_dark") |