technology/screen.lua
jimy-byerley 7c019aadad new file: aircraft.lua
new file:   characters
	new file:   depends.txt
	new file:   documentation.txt
	new file:   electric_nodes.lua
	new file:   init.lua
	new file:   models/chasseur.blend
	new file:   models/chasseur.blend1
	new file:   models/chasseur.blend2
	new file:   models/chasseur.x
	new file:   models/hunter.x
	new file:   models/patrouilleur-closed.blend1
	new file:   models/patrouilleur-closed.blend2
	new file:   models/patrouilleur-opened.blend1
	new file:   models/patrouilleur.blend
	new file:   models/patrouilleur.blend1
	new file:   models/patrouilleur.blend2
	new file:   models/patrouilleur.x
	new file:   models/patrouilleur_close.blend
	new file:   models/patrouilleur_close.x
	new file:   models/patrouilleur_open.blend
	new file:   models/patrouilleur_open.blend1
	new file:   models/patrouilleur_open.blend2
	new file:   models/patrouilleur_open.x
	new file:   screen.lua
	new file:   sounds/cps-vflSymP2Q.swf
	new file:   sounds/jackhammer_sound.ogg
	new file:   sounds/metal_footstep.1.ogg
	new file:   sounds/metal_footstep.2.ogg
	new file:   sounds/metal_footstep.3.ogg
	new file:   sounds/metal_footstep.4.ogg
	new file:   structures.lua
	new file:   textures/battery_back.png
	new file:   textures/battery_side.png
	new file:   textures/battery_top.png
	new file:   textures/bronze_ingot.png
	new file:   textures/bronze_lump.png
	new file:   textures/button_item.png
	new file:   textures/edge_side.png
	new file:   textures/electronic_card_item.png
	new file:   textures/floor_bottom.png
	new file:   textures/floor_side.png
	new file:   textures/floor_top.png
	new file:   textures/hydro_generator_front.png
	new file:   textures/jackhammer.png
	new file:   textures/jackhammer_side.png
	new file:   textures/jackhammer_top.png
	new file:   textures/lamp_box.png
	new file:   textures/lamp_box_on.png
	new file:   textures/lamp_small.png
	new file:   textures/lamp_small_ceiling.png
	new file:   textures/lamp_small_floor.png
	new file:   textures/lamp_small_on.png
	new file:   textures/lamp_small_on_ceiling.png
	new file:   textures/lamp_small_on_floor.png
	new file:   textures/lamp_small_only.png
	new file:   textures/patrouilleur.png
	new file:   textures/plastic_item.png
	new file:   textures/resistor_item.png
	new file:   textures/resistor_side.png
	new file:   textures/resistor_top.png
	new file:   textures/screen_flat_back.png
	new file:   textures/screen_flat_bottom.png
	new file:   textures/screen_flat_front_2columns.png
	new file:   textures/screen_flat_front_bigtext.png
	new file:   textures/screen_flat_front_cybertronic.png
	new file:   textures/screen_flat_front_map.png
	new file:   textures/screen_flat_front_off.png
	new file:   textures/screen_flat_front_smalltext.png
	new file:   textures/screen_flat_left.png
	new file:   textures/screen_flat_right.png
	new file:   textures/screen_flat_top.png
	new file:   textures/steel_armature_h_side.png
	new file:   textures/steel_armature_top.png
	new file:   textures/steel_armature_v_side.png
	new file:   textures/steel_wrench.png
	new file:   textures/structure_armature_h_wielded.png
	new file:   textures/structures_concrete.png
	new file:   textures/switch_side.png
	new file:   textures/switch_top_off.png
	new file:   textures/switch_top_on.png
	new file:   textures/technology_ladder.png
	new file:   textures/triangle_left.png
	new file:   textures/triangle_right.png
	new file:   textures/triangle_side.png
	new file:   textures/wire_item.png
	new file:   textures/wire_side.png
	new file:   textures/wire_top.png
	new file:   textures/wire_top_wall.png
	new file:   tools.lua
2014-06-20 13:17:17 +02:00

196 lines
6.4 KiB
Lua
Executable File

-- crafting
minetest.register_craft({
output = "technology:flat_screen_off",
recipe = {
{"technology:plastic", "", ""},
{"technology:plastic", "technology:electronic_card", "default:glass"},
{"technology:plastic", "", ""},
}
})
--node defs
minetest.register_node("technology:flat_screen_off", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_off.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
local node = minetest.env:get_node(pos)
node.name = "technology:flat_screen_smalltext"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_smalltext", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 3,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_smalltext.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_bigtext", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 5,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_bigtext.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_2columns", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_2columns.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_map", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 6,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_map.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
minetest.register_node("technology:flat_screen_screensaver", {
description = "modern screen",
stack_max = 1,
node_placement_prediction = "",
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
selection_box = {type = "fixed", fixed = {
{-0.45, -0.4, 0.3, 0.45, 0.3, 0.25},
{-0.35, -0.35, 0.3, 0.35, 0.25, 0.4},
}},
tiles = {"screen_flat_top.png", "screen_flat_bottom.png", "screen_flat_left.png",
"screen_flat_right.png", "screen_flat_back.png", "screen_flat_front_cybertronic.png"},
walkable = true,
groups = {choppy=2, dig_immediate=2},
on_punch = function(pos, node, puncher)
node.name = "technology:flat_screen_off"
minetest.env:set_node(pos, node)
end,
drop = 'technology:flat_screen_off',
})
local screens = {"technology:flat_screen_smalltext",
"technology:flat_screen_bigtext", "technology:flat_screen_2columns", "technology:flat_screen_map",
"technology:flat_screen_screensaver"}
minetest.register_abm({
nodenames = screens,
interval = 1,
chance = 2,
action = function(pos, node, _, _)
if math.random(1,2) == 1 then return end
local newname = screens[math.random(1,5)]
local node = minetest.env:get_node(pos)
node.name = newname
minetest.env:set_node(pos, node)
end,
})
minetest.register_alias("technology:flat_screen", "technology:flat_screen_off")