added long sofas, changed recipes

fork-master
thefamilygrog 2013-04-28 22:42:46 -04:00
parent 4212ea2391
commit d49127dd03
23 changed files with 224 additions and 12 deletions

View File

@ -4,23 +4,24 @@ Living Room Furniture (lrfurn) mod for Minetest
by thefamilygrog66
Description:
Coloured Sofas, Armchairs, Coffee Tables and End Tables, loosely based on PilzAdam's beds mod. There are 9 colours in all: red, orange, yellow, green, blue, violet, black, grey and white.
Coloured Long Sofas (3 blocks wide), Sofas (2 blocks wide), Armchairs, Coffee Tables and End Tables, loosely based on PilzAdam's beds mod. There are 9 colours in all: red, orange, yellow, green, blue, violet, black, grey and white.
When you right-click on a sofa or armchair, it transports you onto it, and replenishes your HP. Good if you've just escaped nasty mobs, didn't fare so well in battle, or just had a bad fall. The coffee table - which isn't coloured, just wooden - is pretty much just for decoration. It stands half a block high and nearly 2 blocks long. The end table is similar to the coffee table, though roughly half the length (i.e. only one block) and square.
When you right-click on a long sofa, sofa or armchair, it transports you onto it, and replenishes your HP. Good if you've just escaped nasty mobs, didn't fare so well in battle, or just had a bad fall. The coffee table - which isn't coloured, just wooden - is pretty much just for decoration. It stands half a block high and nearly 2 blocks long. The end table is similar to the coffee table, though roughly half the length (i.e. only one block) and square.
Recipes:
Sofa
Long Sofa
+---------------+---------------+---------------+
| coloured wool | coloured wool | coloured wool |
+---------------+---------------+---------------+
| wood slab | wood slab | wood slab |
+---------------+---------------+---------------+
| stick | | stick |
| stick | stick | stick |
+---------------+---------------+---------------+
Armchair
Sofa
+---------------+---------------+-------+
| coloured wool | coloured wool | |
+---------------+---------------+-------+
@ -29,6 +30,16 @@ Recipes:
| stick | stick | |
+---------------+---------------+-------+
Armchair
+---------------+-------+-------+
| coloured wool | | |
+---------------+-------+-------+
| wood slab | | |
+---------------+-------+-------+
| stick | | |
+---------------+-------+-------+
Coffee Table (only wood texture)
+-----------+-----------+-----------+

View File

@ -63,9 +63,9 @@ for i in ipairs(armchairs_list) do
minetest.register_craft({
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "wool:"..colour, "", },
{"stairs:slab_wood", "stairs:slab_wood", "", },
{"default:stick", "default:stick", "", }
{"wool:"..colour, "", "", },
{"stairs:slab_wood", "", "", },
{"default:stick", "", "", }
}
})

View File

@ -1,3 +1,4 @@
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")

200
longsofas.lua Normal file
View File

@ -0,0 +1,200 @@
local longsofas_list = {
{ "Red Long Sofa", "red"},
{ "Orange Long Sofa", "orange"},
{ "Yellow Long Sofa", "yellow"},
{ "Green Long Sofa", "green"},
{ "Blue Long Sofa", "blue"},
{ "Violet Long Sofa", "violet"},
{ "Black Long Sofa", "black"},
{ "Grey Long Sofa", "grey"},
{ "White Long Sofa", "white"},
}
for i in ipairs(longsofas_list) do
local longsofadesc = longsofas_list[i][1]
local colour = longsofas_list[i][2]
minetest.register_node("lrfurn:longsofa_right_"..colour, {
description = longsofadesc,
drawtype = "nodebox",
tiles = {"lrfurn_sofa_right_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_right_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
paramtype = "light",
paramtype2 = "facedir",
stack_max = 1,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
--legs
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
--base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm
{-0.3125, 0, -0.5, 0.5, 0.25, -0.3125},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 2.5},
}
},
on_construct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
node.name = "lrfurn:longsofa_middle_"..colour
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
minetest.env:set_node(pos, node)
node.name = "lrfurn:longsofa_left_"..colour
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
minetest.env:set_node(pos, node)
end
end
end,
on_destruct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_middle_"..colour ) then
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
minetest.env:remove_node(pos)
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_left_"..colour ) then
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
minetest.env:remove_node(pos)
end
end
end
end
end,
on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then
return
end
pos.y = pos.y-0.5
clicker:setpos(pos)
clicker:set_hp(20)
end
})
minetest.register_node("lrfurn:longsofa_middle_"..colour, {
drawtype = "nodebox",
tiles = {"lrfurn_longsofa_middle_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_longsofa_middle_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
--legs
{-0.4375, -0.5, -0.03125, -0.375, -0.375, 0.03125},
{0.375, -0.5, -0.03125, 0.4375, -0.375, 0.03125},
--base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{0, 0, 0, 0, 0, 0},
}
},
})
minetest.register_node("lrfurn:longsofa_left_"..colour, {
drawtype = "nodebox",
tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
--legs
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
--base/cushion
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
--back
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
--arm
{-0.3125, 0, 0.3125, 0.5, 0.25, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{0, 0, 0, 0, 0, 0},
}
},
})
minetest.register_alias("lrfurn:longsofa_"..colour, "lrfurn:longsofa_right_"..colour)
minetest.register_craft({
output = "lrfurn:longsofa_"..colour,
recipe = {
{"wool:"..colour, "wool:"..colour, "wool:"..colour, },
{"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood", },
{"default:stick", "default:stick", "default:stick", }
}
})
end
if minetest.setting_get("log_mods") then
minetest.log("action", "long sofas loaded")
end

View File

@ -131,9 +131,9 @@ for i in ipairs(sofas_list) do
minetest.register_craft({
output = "lrfurn:sofa_"..colour,
recipe = {
{"wool:"..colour, "wool:"..colour, "wool:"..colour, },
{"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood", },
{"default:stick", "", "default:stick", }
{"wool:"..colour, "wool:"..colour, "", },
{"stairs:slab_wood", "stairs:slab_wood", "", },
{"default:stick", "default:stick", "", }
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B