homedecor_modpack/computer/computers.lua

340 lines
9.5 KiB
Lua
Raw Normal View History

local S = minetest.get_translator("computer")
2017-01-29 22:41:03 +01:00
-- Amiga 500 lookalike
2014-07-19 01:33:01 +02:00
computer.register("computer:shefriendSOO", {
description = S("SheFriendSOO"),
2015-05-09 13:51:19 +02:00
tiles_off = { front=true },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 17, 32, 32, 12 }, -- Monitor Screen
{ 3, 3, 29, 26, 26, 3 }, -- Monitor Tube
2015-05-09 13:51:19 +02:00
{ 0, 0, 0, 32, 4, 17 } -- Keyboard
})
})
2014-07-19 01:33:01 +02:00
2015-01-20 12:13:45 +01:00
-- Some generic laptop
2015-04-05 18:46:16 +02:00
minetest.register_node("computer:vanio", {
drawtype = "mesh",
mesh = "computer_laptop.obj",
description = S("Pony Vanio"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_laptop_inv.png",
2015-04-05 18:46:16 +02:00
tiles = {"computer_laptop.png"},
paramtype = "light",
paramtype2 = "facedir",
light_source = 4,
groups = {snappy=3},
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.35, -0.5, -0.35, 0.35, 0.05, 0.35},
},
2015-05-09 13:51:19 +02:00
on_rightclick = function(pos, node, clicker, itemstack)
2015-04-05 18:46:16 +02:00
node.name = "computer:vanio_off"
minetest.set_node(pos, node)
return itemstack
2015-04-05 18:46:16 +02:00
end
})
minetest.register_node("computer:vanio_off", {
drawtype = "mesh",
mesh = "computer_laptop_closed.obj",
tiles = {"computer_laptop.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.35, -0.5, -0.35, 0.35, -0.4, 0.25},
},
drop = "computer:vanio",
2015-05-09 13:51:19 +02:00
on_rightclick = function(pos, node, clicker, itemstack)
2015-04-05 18:46:16 +02:00
node.name = "computer:vanio"
minetest.set_node(pos, node)
return itemstack
2015-04-05 18:46:16 +02:00
end
})
2014-07-19 01:33:01 +02:00
-- Sony PlayStation lookalike
computer.register("computer:slaystation", {
description = S("Pony SlayStation"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_ps1_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { top=true },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 11, 32, 6, 21 }, -- Console
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
2015-05-09 13:51:19 +02:00
{ 22, 0, 4, 5, 2, 5 } -- Controller 2 Center
})
})
2014-07-19 01:33:01 +02:00
-- Sony PlayStation 2 lookalike
computer.register("computer:slaystation2", {
description = S("Pony SlayStation 2"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_ps2_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { front=true },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 2, 2, 11, 28, 3, 19 }, -- Console (Upper part)
{ 2, 0, 11, 26, 2, 19 }, -- Console (Lower part)
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
2015-05-09 13:51:19 +02:00
{ 22, 0, 1, 5, 2, 8 } -- Controller 2 Center
})
})
2014-07-19 01:33:01 +02:00
-- Sinclair ZX Spectrum lookalike
computer.register("computer:specter", {
description = S("SX Specter"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_specter_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 3, 0, 0, 26, 4, 17 }, -- Keyboard
2015-05-09 13:51:19 +02:00
{ 18, 0, 18, 12, 6, 14 } -- Tape Player
})
})
2014-07-19 01:33:01 +02:00
2015-01-20 12:13:45 +01:00
-- Nintendo Wii lookalike
2014-07-19 01:33:01 +02:00
computer.register("computer:wee", {
description = S("Nientiendo Wee"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_wii_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { front=true },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 11, 0, 3, 10, 6, 26 }, -- Base
2015-05-09 13:51:19 +02:00
{ 12, 6, 4, 8, 22, 24 } -- Top
})
})
2014-07-19 01:33:01 +02:00
2015-01-20 12:13:45 +01:00
-- Apple iPad lookalike
minetest.register_node("computer:piepad", {
description = S("Snapple Piepad"),
drawtype = "signlike",
tiles = {"computer_piepad_inv.png"},
inventory_image = "computer_piepad_inv.png",
wield_image = "computer_piepad_inv.png",
paramtype = "light",
paramtype2 = "wallmounted",
2015-05-09 13:51:19 +02:00
light_source = 8,
walkable = false,
2015-05-09 13:51:19 +02:00
groups = {oddly_breakable_by_hand=2},
selection_box = {type = "wallmounted"},
sounds = default.node_sound_wood_defaults()
})
2014-07-19 01:33:01 +02:00
-- Commodore 64 lookalike
computer.register("computer:admiral64", {
description = S("Admiral64"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_ad64_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
2015-05-09 13:51:19 +02:00
{ 0, 0, 0, 32, 4, 18 } -- Keyboard
})
})
2014-07-19 01:33:01 +02:00
-- Commodore 128 lookalike
computer.register("computer:admiral128", {
description = S("Admiral128"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_ad128_inv.png",
2015-05-09 13:51:19 +02:00
tiles_off = { },
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
2015-05-09 13:51:19 +02:00
{ 0, 0, 0, 32, 4, 27 } -- Keyboard
})
})
2017-02-24 07:04:24 +01:00
-- XBox lookalike
computer.register("computer:hueg_box", {
description = S("HUEG Box"),
2017-02-24 07:04:24 +01:00
tiles_off = { },
node_box = computer.pixelnodebox(16, {
-- X Y Z W H L
{ 0, 0, 7, 16, 6, 9 }, -- Console
{ 2, 0, 1, 11, 3, 6 }, -- Controller
{ 2, 0, 0, 2, 3, 1 },
{ 11, 0, 0, 2, 3, 1 },
})
})
2015-05-09 13:51:19 +02:00
-- Generic Flat Screen LCD (16x9) with keyboard
local mo_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.43, 0.5, 0.2, 0.25 }
}
2014-07-19 01:33:01 +02:00
2015-05-09 13:51:19 +02:00
minetest.register_node("computer:monitor", {
2017-01-29 22:41:03 +01:00
description = S("Monitor and keyboard"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_monitor_inv.png",
2015-05-09 13:51:19 +02:00
drawtype = "mesh",
mesh = "computer_monitor.obj",
2015-05-10 01:06:15 +02:00
tiles = {"computer_black.png", "monitor_plastic.png", "computer_black.png", "monitor_plastic.png"},
2014-07-19 01:33:01 +02:00
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
2015-05-09 13:51:19 +02:00
groups = {snappy=3},
selection_box = mo_sbox,
on_rightclick = function(pos, node, clicker, itemstack)
node.name = "computer:monitor_on"
minetest.set_node(pos, node)
return itemstack
2015-05-09 13:51:19 +02:00
end
2014-07-19 01:33:01 +02:00
})
2015-05-09 13:51:19 +02:00
minetest.register_node("computer:monitor_on", {
drawtype = "mesh",
mesh = "computer_monitor.obj",
2015-05-10 01:06:15 +02:00
tiles = {"monitor_display.png^[transformFX", "monitor_plastic.png", "computer_black.png", "monitor_plastic.png"},
2014-07-19 01:33:01 +02:00
paramtype = "light",
paramtype2 = "facedir",
2015-05-09 13:51:19 +02:00
light_source = 9,
2014-07-19 01:33:01 +02:00
walkable = false,
2015-05-09 13:51:19 +02:00
groups = {snappy=3, not_in_creative_inventory=1},
selection_box = mo_sbox,
drop = "computer:monitor",
on_rightclick = function(pos, node, clicker, itemstack)
node.name = "computer:monitor"
minetest.set_node(pos, node)
return itemstack
2014-07-19 01:33:01 +02:00
end
})
2015-05-09 13:51:19 +02:00
minetest.register_alias("computer:monitor_bios", "computer:monitor")
minetest.register_alias("computer:monitor_loading", "computer:monitor")
minetest.register_alias("computer:monitor_login", "computer:monitor")
minetest.register_alias("computer:monitor_desktop", "computer:monitor")
2014-07-19 01:33:01 +02:00
--WIFI Router (linksys look-a-like)
2015-01-20 12:13:45 +01:00
minetest.register_node("computer:router", {
2017-01-29 22:41:03 +01:00
description = S("WIFI Router"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_router_inv.png",
tiles = {
"computer_router_t.png",
"computer_router_bt.png",
"computer_router_l.png",
"computer_router_r.png",
"computer_router_b.png",
{
name = "computer_router_f_animated.png",
animation = {type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}
},
}, --"computer_router_f.png"},
2014-07-19 01:33:01 +02:00
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
2015-01-20 12:13:45 +01:00
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
2014-07-19 01:33:01 +02:00
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.0625, 0.25, -0.375, 0.3125},
{-0.1875, -0.4375, 0.3125, -0.125, -0.1875, 0.375},
{0.125, -0.4375, 0.3125, 0.1875, -0.1875, 0.375},
2015-05-09 13:51:19 +02:00
{-0.0625, -0.4375, 0.3125, 0.0625, -0.25, 0.375}
}
}
2014-07-19 01:33:01 +02:00
})
2015-05-09 18:23:53 +02:00
local pct_cbox = {
type = "fixed",
fixed = { -0.1875, -0.5, -0.36, 0.1875, 0.34, 0.46 }
}
2014-07-19 01:33:01 +02:00
2015-05-09 18:23:53 +02:00
--Modern PC Tower
2015-01-20 12:13:45 +01:00
minetest.register_node("computer:tower", {
2017-01-29 22:41:03 +01:00
description = S("Computer Tower"),
2015-05-10 11:12:22 +02:00
inventory_image = "computer_tower_inv.png",
2015-05-09 18:23:53 +02:00
drawtype = "mesh",
mesh = "computer_tower.obj",
tiles = {"computer_tower.png"},
2014-07-19 01:33:01 +02:00
paramtype = "light",
paramtype2 = "facedir",
2015-01-20 12:13:45 +01:00
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
2015-05-09 18:23:53 +02:00
selection_box = pct_cbox,
collision_box = pct_cbox
2014-07-19 01:33:01 +02:00
})
2015-05-09 18:23:53 +02:00
minetest.register_alias("computer:tower_on", "computer:tower")
2014-07-19 01:33:01 +02:00
--Rack Server
minetest.register_node("computer:server", {
drawtype = "nodebox",
2017-01-29 22:41:03 +01:00
description = S("Rack Server"),
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_l.png',
'computer_server_r.png',
'computer_server_bt.png',
'computer_server_f_off.png'
},
inventory_image = "computer_server_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
2015-05-09 13:51:19 +02:00
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
},
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
},
sounds = default.node_sound_wood_defaults(),
2015-05-09 13:51:19 +02:00
on_rightclick = function(pos, node, clicker, itemstack)
node.name = "computer:server_on"
minetest.set_node(pos, node)
return itemstack
2015-01-20 12:13:45 +01:00
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
2017-01-29 22:41:03 +01:00
minetest.chat_send_player( placer:get_player_name(),
S("Not enough vertical space to place a server!" ))
return itemstack
end
return minetest.item_place(itemstack, placer, pointed_thing)
end
2014-07-19 01:33:01 +02:00
})
minetest.register_node("computer:server_on", {
drawtype = "nodebox",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_l.png',
2016-02-13 10:33:58 +01:00
'computer_server_r.png',
'computer_server_bt.png',
'computer_server_f_on.png',
},
inventory_image = "computer_server_inv.png",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3,not_in_creative_inventory=1},
2015-05-09 13:51:19 +02:00
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
},
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
},
sounds = default.node_sound_wood_defaults(),
2014-07-19 01:33:01 +02:00
drop = 'computer:server',
2015-05-09 13:51:19 +02:00
on_rightclick = function(pos, node, clicker, itemstack)
node.name = "computer:server"
minetest.set_node(pos, node)
return itemstack
end
2014-07-19 01:33:01 +02:00
})