diff --git a/doc/items.lua b/doc/items.lua index 12eea1e..24d6102 100644 --- a/doc/items.lua +++ b/doc/items.lua @@ -157,5 +157,6 @@ techage.Items = { ta4_chest = "techage:ta4_chest", ta4_growlight = "techage:growlight_on", ta4_streetlamp = "techage_ta4_streetlamp.png", + ta4_industriallamp = "techage:industriallamp4_off", --ta4_ "", } diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index d40fadd..7722c16 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -157,7 +157,7 @@ techage.manual_DE.aTitel = { "2,TA4 Lampen", "3,TA4 LED Pflanzenlampe / TA4 LED Grow Light", "3,TA4 LED Straßenlampe / TA4 LED Street Lamp", - "3,weitere Lampen folgen...", + "3,TA4 LED Industrielampe / TA4 LED Industrial Lamp", "2,Weitere TA4 Blöcke", "3,TA4 Tank / TA4 Tank", "3,TA4 Pumpe / TA4 Pump", @@ -1280,7 +1280,12 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", - "", + "Die TA4 LED Industrielampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe muss von oben mit Strom versorgt werden.\n".. + "\n".. + "Die Lampe benötigt 1 ku Strom.\n".. + "\n".. + "\n".. + "\n", "", "Siehe TA3 Tank.\n".. "\n".. @@ -1504,7 +1509,7 @@ techage.manual_DE.aItemName = { "", "ta4_growlight", "ta4_streetlamp", - "", + "ta4_industriallamp", "", "ta4_tank", "ta4_pump", diff --git a/init.lua b/init.lua index df5b33d..cbdd2bf 100644 --- a/init.lua +++ b/init.lua @@ -148,6 +148,7 @@ else dofile(MP.."/lamps/industriallamp1.lua") dofile(MP.."/lamps/industriallamp2.lua") dofile(MP.."/lamps/industriallamp3.lua") + dofile(MP.."/lamps/industriallamp4.lua") dofile(MP.."/lamps/growlight.lua") -- Oil diff --git a/lamps/growlight.lua b/lamps/growlight.lua index 43d6979..5215a07 100644 --- a/lamps/growlight.lua +++ b/lamps/growlight.lua @@ -82,6 +82,7 @@ techage.register_lamp("techage:growlight", { }, }, on_switch_lamp = on_switch_lamp, + high_power = true, },{ description = S("TA4 LED Grow Light"), tiles = { @@ -103,6 +104,7 @@ techage.register_lamp("techage:growlight", { }, on_timer = node_timer, on_switch_lamp = on_switch_lamp, + high_power = true, }) minetest.register_craft({ diff --git a/lamps/industriallamp4.lua b/lamps/industriallamp4.lua new file mode 100644 index 0000000..d856d1d --- /dev/null +++ b/lamps/industriallamp4.lua @@ -0,0 +1,64 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2020 Joachim Stolberg + + GPL v3 + See LICENSE.txt for more information + + TA4 Industrial Lamp 4 + +]]-- + +local S = techage.S + +local function on_switch_lamp(pos, on) + techage.light_ring({x = pos.x, y = pos.y - 3, z = pos.z}, on) +end + +techage.register_lamp("techage:industriallamp4", { + description = S("TA4 LED Industrial Lamp"), + tiles = { + 'techage_growlight_off.png', + 'techage_growlight_back.png', + 'techage_growlight_side.png', + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, + }, + }, + on_switch_lamp = on_switch_lamp, + conn_sides = {"U"}, + high_power = true, +},{ + description = S("TA4 LED Industrial Lamp"), + tiles = { + -- up, down, right, left, back, front + 'techage_industlight4_on.png', + 'techage_growlight_back.png', + 'techage_growlight_side.png', + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -13/32, 8/16}, + }, + }, + on_switch_lamp = on_switch_lamp, + high_power = true, +}) + +minetest.register_craft({ + output = "techage:industriallamp4_off", + recipe = { + {"basic_materials:steel_strip", "basic_materials:steel_strip", "basic_materials:steel_strip"}, + {"techage:ta4_leds", "techage:ta4_leds", "techage:ta4_leds"}, + {"techage:ta4_leds", "techage:basalt_glass_thin", "techage:ta4_leds"}, + }, +}) diff --git a/lamps/lib.lua b/lamps/lib.lua index 1fbc7f3..da19e1b 100644 --- a/lamps/lib.lua +++ b/lamps/lib.lua @@ -109,11 +109,26 @@ local net_def = { }, } +local net_def2 = { + ele1 = { + sides = {U=1, D=1, L=1, R=1, F=1, B=1}, -- Cable connection sides + ntype = "con1", + on_power = on_power, + on_nopower = on_nopower, + nominal = PWR_NEEDED * 2, + }, +} + + function techage.register_lamp(basename, ndef_off, ndef_on) ndef_off.after_place_node = after_place_node ndef_off.after_dig_node = after_dig_node ndef_off.tubelib2_on_update2 = tubelib2_on_update2 - ndef_off.networks = net_def + if ndef_off.high_power then + ndef_off.networks = net_def2 + else + ndef_off.networks = net_def + end ndef_off.on_rightclick = lamp_on_rightclick if not ndef_off.on_rotate then ndef_off.on_place = on_place @@ -131,7 +146,11 @@ function techage.register_lamp(basename, ndef_off, ndef_on) ndef_on.after_place_node = after_place_node ndef_on.after_dig_node = after_dig_node ndef_on.tubelib2_on_update2 = tubelib2_on_update2 - ndef_on.networks = net_def + if ndef_on.high_power then + ndef_on.networks = net_def2 + else + ndef_on.networks = net_def + end ndef_on.on_rightclick = lamp_on_rightclick ndef_on.on_rotate = ndef_on.on_rotate or on_rotate ndef_on.on_timer = ndef_on.on_timer or node_timer diff --git a/lamps/streetlamp2.lua b/lamps/streetlamp2.lua index c5d92eb..11b30b6 100644 --- a/lamps/streetlamp2.lua +++ b/lamps/streetlamp2.lua @@ -35,6 +35,7 @@ techage.register_lamp("techage:streetlamp2", { on_switch_lamp = on_switch_lamp, on_rotate = screwdriver.disallow, conn_sides = {"F", "B"}, + high_power = true, },{ description = S("TA4 LED Street Lamp"), tiles = { @@ -52,6 +53,7 @@ techage.register_lamp("techage:streetlamp2", { on_switch_lamp = on_switch_lamp, on_rotate = screwdriver.disallow, conn_sides = {"F", "B"}, + high_power = true, }) minetest.register_node("techage:streetlamp_pole", { diff --git a/locale/techage.de.tr b/locale/techage.de.tr index 07e5e48..3ddc9a1 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -275,6 +275,7 @@ TA4 Heat Exchanger 2=TA4 Wärmetauscher 2 TA4 Heat Exchanger 3=TA4 Wärmetauscher 3 TA4 Hydrogen=TA4 Wasserstoff TA4 LED Grow Light=TA4 LED Pflanzenlampe +TA4 LED Industrial Lamp=TA4 LED Industrielampe TA4 LED Street Lamp=TA4 LED Straßenlampe TA4 LED Street Lamp Arm=TA4 LED Lampenarm TA4 LED Street Lamp Pole=TA4 LED Lampenmast diff --git a/locale/template.txt b/locale/template.txt index 0e0a69f..aa28d13 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -273,6 +273,7 @@ TA4 Heat Exchanger 2= TA4 Heat Exchanger 3= TA4 Hydrogen= TA4 LED Grow Light= +TA4 LED Industrial Lamp= TA4 LED Street Lamp= TA4 LED Street Lamp Arm= TA4 LED Street Lamp Pole= diff --git a/manuals/manual_ta4_DE.md b/manuals/manual_ta4_DE.md index b260a74..3adea05 100644 --- a/manuals/manual_ta4_DE.md +++ b/manuals/manual_ta4_DE.md @@ -436,7 +436,14 @@ Die Lampe benötigt 1 ku Strom. [ta4_streetlamp|image] -### weitere Lampen folgen... +### TA4 LED Industrielampe / TA4 LED Industrial Lamp + +Die TA4 LED Industrielampe ist eine Lampe mit besonders starker Ausleuchtung. Die Lampe muss von oben mit Strom versorgt werden. + +Die Lampe benötigt 1 ku Strom. + +[ta4_industriallamp|image] + diff --git a/manuals/toc_DE.md b/manuals/toc_DE.md index 7ef2502..45c3b0a 100644 --- a/manuals/toc_DE.md +++ b/manuals/toc_DE.md @@ -156,7 +156,7 @@ - [TA4 Lampen](./manual_ta4_DE.md#ta4-lampen) - [TA4 LED Pflanzenlampe / TA4 LED Grow Light](./manual_ta4_DE.md#ta4-led-pflanzenlampe--ta4-led-grow-light) - [TA4 LED Straßenlampe / TA4 LED Street Lamp](./manual_ta4_DE.md#ta4-led-straßenlampe--ta4-led-street-lamp) - - [weitere Lampen folgen...](./manual_ta4_DE.md#weitere-lampen-folgen...) + - [TA4 LED Industrielampe / TA4 LED Industrial Lamp](./manual_ta4_DE.md#ta4-led-industrielampe--ta4-led-industrial-lamp) - [Weitere TA4 Blöcke](./manual_ta4_DE.md#weitere-ta4-blöcke) - [TA4 Tank / TA4 Tank](./manual_ta4_DE.md#ta4-tank--ta4-tank) - [TA4 Pumpe / TA4 Pump](./manual_ta4_DE.md#ta4-pumpe--ta4-pump) diff --git a/solar/minicell.lua b/solar/minicell.lua index 9f1b46c..a4b72f5 100644 --- a/solar/minicell.lua +++ b/solar/minicell.lua @@ -116,6 +116,7 @@ minetest.register_node("techage:ta4_solar_minicell", { after_dig_node = after_dig_node, on_timer = node_timer, tubelib2_on_update2 = tubelib2_on_update2, + networks = net_def, }) Cable:add_secondary_node_names({"techage:ta4_solar_minicell"}) diff --git a/textures/techage_industlight4_on.png b/textures/techage_industlight4_on.png new file mode 100644 index 0000000..e9b0adc Binary files /dev/null and b/textures/techage_industlight4_on.png differ