Add more complex lamp mechanics
parent
97fdc14f22
commit
3fd74a50c8
88
init.lua
88
init.lua
|
@ -62,6 +62,7 @@ minetest.register_node("industrial_decor:lamp",{
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--Damaged
|
||||||
minetest.register_node("industrial_decor:lamp_damaged",{
|
minetest.register_node("industrial_decor:lamp_damaged",{
|
||||||
description = "Damaged Industrial Lamp",
|
description = "Damaged Industrial Lamp",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
@ -79,27 +80,82 @@ minetest.register_node("industrial_decor:lamp_damaged",{
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, player, pointed_thing)
|
||||||
|
if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_bulb"})
|
||||||
|
elseif player:get_wielded_item():get_name() == "tapes:ducttape_black" then
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_tape"})
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("industrial_decor:wires_hanging",{
|
--Light Bulb Only
|
||||||
description = "Hanging Wires",
|
minetest.register_node("industrial_decor:lamp_bulb",{
|
||||||
|
description = "Damaged Industrial Lamp with Light Bulb",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
tiles = {"industrial_decor_wires_hanging.png"},
|
tiles = {
|
||||||
inventory_image = "industrial_decor_wires_hanging.png",
|
{
|
||||||
wield_image = "industrial_decor_wires_hanging.png",
|
name = "industrial_decor_lamp_bulb.png",
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 16,
|
||||||
|
aspect_h = 16,
|
||||||
|
length = 2.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inventory_image = "industrial_decor_lamp_bulb_single.png",
|
||||||
|
wield_image = "industrial_decor_lamp_bulb_single.png",
|
||||||
light_propagates = true,
|
light_propagates = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
|
|
||||||
groups = {snappy = 3},
|
groups = {cracky = 2},
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, player, pointed_thing)
|
||||||
|
if player:get_wielded_item():get_name() == "tapes:ducttape_black" then
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"})
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--Taped
|
||||||
|
minetest.register_node("industrial_decor:lamp_tape",{
|
||||||
|
description = "Industrial Lamp with Duct Tape",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {"industrial_decor_lamp_tape.png"},
|
||||||
|
inventory_image = "industrial_decor_lamp_tape.png",
|
||||||
|
wield_image = "industrial_decor_lamp_bulb_tape.png",
|
||||||
|
light_propagates = true,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
walkable = false,
|
||||||
|
|
||||||
|
groups = {cracky = 2},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
||||||
|
},
|
||||||
|
|
||||||
|
on_rightclick = function(pos, node, player, pointed_thing)
|
||||||
|
if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"})
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
--Fixed
|
||||||
minetest.register_node("industrial_decor:lamp_fixed",{
|
minetest.register_node("industrial_decor:lamp_fixed",{
|
||||||
description = "Fixed Industrial Lamp",
|
description = "Fixed Industrial Lamp",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
@ -122,6 +178,26 @@ minetest.register_node("industrial_decor:lamp_fixed",{
|
||||||
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"})
|
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"})
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
--End of Lamps
|
||||||
|
|
||||||
|
minetest.register_node("industrial_decor:wires_hanging",{
|
||||||
|
description = "Hanging Wires",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {"industrial_decor_wires_hanging.png"},
|
||||||
|
inventory_image = "industrial_decor_wires_hanging.png",
|
||||||
|
wield_image = "industrial_decor_wires_hanging.png",
|
||||||
|
light_propagates = true,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
walkable = false,
|
||||||
|
|
||||||
|
groups = {snappy = 3},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_node("industrial_decor:sheet_tin",{
|
minetest.register_node("industrial_decor:sheet_tin",{
|
||||||
description = "Industrial Tin Sheet",
|
description = "Industrial Tin Sheet",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 362 B |
Binary file not shown.
After Width: | Height: | Size: 282 B |
Binary file not shown.
After Width: | Height: | Size: 546 B |
Loading…
Reference in New Issue