1 local S
= minetest
.get_translator("3dforniture")
4 Some adjustments and expansions for Hades game added 2015 by Glünggi
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
29 suggested creating bathroom kit.
37 --[[ ----- Basic furniture ----- ]]
40 local furniture_colors
= {
41 {"", S("Table"), S("Chair")},
42 {"_black", S("Black Table"), S("Black Chair")},
43 {"_white", S("White Table"), S("White Chair")},
45 for f
=1, #furniture_colors
do
46 local append
= furniture_colors
[f
][1]
47 local desc_t
= furniture_colors
[f
][2]
48 local desc_c
= furniture_colors
[f
][3]
51 minetest
.register_node("3dforniture:table"..append
,
52 {description
= desc_t
,
54 "forniture_wood"..append
..".png",
57 sunlight_propagates
= true,
59 paramtype2
= "facedir",
63 {-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
64 {0.3,-0.5,-0.4, 0.4,0.4,-0.3},
65 {-0.4,-0.5,0.3, -0.3,0.4,0.4},
66 {0.3,-0.5,0.3, 0.4,0.4,0.4},
67 {-0.5,0.4,-0.5, 0.5,0.5,0.5},
68 {-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
69 {0.3,-0.2,-0.4, 0.4,-0.1,0.3},
70 {-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
71 {-0.3,-0.2,0.3, 0.3,-0.1,0.4},
74 groups
= {table=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
75 sounds
= hades_sounds
.node_sound_wood_defaults(),
79 minetest
.register_node("3dforniture:chair"..append
,
80 { description
= desc_c
,
82 "forniture_wood"..append
..".png",
85 sunlight_propagates
= true,
87 paramtype2
= "facedir",
91 {-0.3,-0.5,0.2, -0.2,0.5,0.3},
92 {0.2,-0.5,0.2, 0.3,0.5,0.3},
93 {-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
94 {0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
95 {-0.3,-0.1,-0.3, 0.3,0,0.2},
96 {-0.2,0.1,0.25, 0.2,0.4,0.26}
101 fixed
= {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
103 groups
= {chair
=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
104 sounds
= hades_sounds
.node_sound_wood_defaults(),
108 local armchair_colors
= {
109 {"", S("Black Armchair")},
110 {"_white", S("White Armchair")},
111 {"_red", S("Red Armchair")},
112 {"_brown", S("Brown Armchair")},
113 {"_blue", S("Blue Armchair")},
114 {"_dark_green", S("Dark Green Armchair")},
118 for a
=1, #armchair_colors
do
119 local append
= armchair_colors
[a
][1]
120 local desc
= armchair_colors
[a
][2]
121 minetest
.register_node("3dforniture:armchair"..append
,
122 { description
= desc
,
124 "forniture_armchair_top"..append
..".png",
125 "forniture_armchair_top"..append
..".png",
126 "forniture_armchair_lat1"..append
..".png",
127 "forniture_armchair_lat1"..append
..".png",
128 "forniture_armchair_lat2"..append
..".png",
129 "forniture_armchair_lat2"..append
..".png",
131 drawtype
= "nodebox",
132 sunlight_propagates
= true,
134 paramtype2
= "facedir",
139 {-0.5,-0.5,-0.45, -0.3,0.05,0.3},
140 {-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
141 {-0.45,0.05,-0.45, -0.35,0.1,0.15},
143 {0.3,-0.5,-0.45, 0.5,0.05,0.3},{0.35,-0.5,-0.5,0.45,0.05,-0.45},{0.35,0.05,-0.45, 0.45,0.1,0.15},
145 {-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
147 {-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
150 {-0.5,0.05,0.15, -0.3,0.45, 0.3},{-0.45,0.1,0.1, -0.35,0.45,0.15},{-0.45,0.45,0.15,-0.35,0.5,0.35},
152 {0.3,0.05,0.15, 0.5,0.45,0.3},{0.35,0.1,0.1, 0.45,0.45,0.15},{0.35,0.45,0.15,0.45,0.5,0.35},
157 fixed
= {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
159 groups
= {armchair
=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
160 sounds
= hades_sounds
.node_sound_wood_defaults(),
170 { "max", "hi", minetest
.LIGHT_MAX
},
173 local drop
, not_in_creative_inventory
175 drop
= "3dforniture:table_lamp_off"
176 not_in_creative_inventory
= 1
178 minetest
.register_node("3dforniture:table_lamp_"..lamps
[l
][1], {
179 description
= S("Table Lamp"),
180 _tt_help
= S("4 different luminance levels"),
181 drawtype
= "nodebox",
183 "forniture_table_lamp_s.png",
184 "forniture_table_lamp_s.png",
185 "forniture_table_lamp_l.png",
188 paramtype2
= 'facedir',
193 {-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
194 {-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
195 {-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
196 {-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
197 {-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
200 {-0.2,-0.1,-0.2, -0.175,0.3,0.2},
201 {0.175,-0.1,-0.2, 0.2,0.3,0.2},
202 {-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
203 {-0.175,-0.1,0.175, 0.175,0.3,0.2},
206 sunlight_propagates
= true,
208 light_source
= lamps
[l
][3],
211 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.3, 0.2},
213 groups
= {cracky
=2,oddly_breakable_by_hand
=1,not_in_creative_inventory
=not_in_creative_inventory
},
215 sounds
= hades_sounds
.node_sound_glass_defaults(),
216 on_rightclick
= function(pos
, node
, clicker
)
217 minetest
.sound_play({name
="3dforniture_table_lamp_switch"}, {pos
=pos
, gain
=0.35, max_hear_distance
=6})
218 minetest
.set_node(pos
, {name
="3dforniture:table_lamp_"..lamps
[l
][2]})
220 on_rotate
= "simple",
225 --[[ ----- Bathroom Kit -----]]
228 minetest
.register_node("3dforniture:toilet",
229 { description
= S("Toilet"),
231 "forniture_marble.png", "forniture_marble.png",
232 "forniture_marble_sb1.png", "forniture_marble_sb1.png",
233 "forniture_marble_sb2.png", "forniture_marble_sb2.png",
235 drawtype
= "nodebox",
236 sunlight_propagates
= false,
238 paramtype2
= "facedir",
242 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
243 {-0.1,-0.45,-0.1, 0.1,0,0.5},
244 {-0.3,-0.2,-0.3, 0.3,0,0.35},
245 {-0.25,0,-0.25, 0.25,0.05,0.25},
246 {-0.3,0,0.3, 0.3,0.4,0.5},
247 {-0.05,0.4,0.35, 0.05,0.45,0.45}, -- flush button
253 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
255 {-0.1,-0.2,0.35, 0.1,0.0,0.5},
256 {-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
258 {-0.3,-0.2,-0.3, 0.3,0,0.35},
259 {-0.25,0,-0.25, 0.25,0.05,0.25},
260 {-0.3,0,0.3, 0.3,0.4,0.5},
261 {-0.05,0.4,0.35, 0.05,0.45,0.45}, -- flush button
265 drop
="3dforniture:toilet",
266 groups
= {cracky
=3,},
267 sounds
= hades_sounds
.node_sound_stone_defaults(),
268 on_rightclick
= function (pos
, node
, clicker
)
269 minetest
.add_node(pos
, {name
="3dforniture:toilet_open", param2
=node
.param2
})
271 on_rotate
= "simple",
273 minetest
.register_node("3dforniture:toilet_open",
276 "forniture_marble_top_toilet.png", "forniture_marble.png",
277 "forniture_marble_sb1.png", "forniture_marble_sb1.png",
278 "forniture_marble_sb2.png", "forniture_marble_sb2.png",
280 drawtype
= "nodebox",
281 sunlight_propagates
= false,
283 paramtype2
= 'facedir',
287 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
288 {-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
289 {-0.1,-0.2,0.3, 0.1,0,0.5},
290 {-0.3,-0.2,0.1, 0.3,0,0.35},
291 {-0.3,-0.2,-0.3, -0.1,-0.15,0.1},
292 {-0.1,-0.2,-0.3, 0.1,-0.15,-0.1},
293 {0.1,-0.2,-0.3, 0.3,-0.15,0.1},
294 {-0.3,-0.15,-0.3, -0.2,0,0.1},
295 {-0.2,-0.15,-0.3, 0.2,0,-0.2},
296 {0.2,-0.15,-0.3, 0.3,0,0.1},
297 {-0.25,0,0.2, 0.25,0.5,0.25},
298 {-0.3,0,0.3, 0.3,0.4,0.5},
299 {-0.05,0.4,0.35, 0.05,0.45,0.45}, -- flush button
305 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
307 {-0.1,-0.2,0.35, 0.1,0.0,0.5},
308 {-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
310 {-0.3,-0.2,-0.3, 0.3,0,0.35},
311 {-0.3,0,0.3, 0.3,0.4,0.5},
312 {-0.25,0,0.2, 0.25,0.5,0.25},
313 {-0.05,0.4,0.35, 0.05,0.45,0.45}, -- flush button
316 drop
= "3dforniture:toilet",
317 groups
= {cracky
= 3,not_in_creative_inventory
=1},
318 sounds
= hades_sounds
.node_sound_stone_defaults(),
319 on_rightclick
= function (pos
, node
, clicker
)
320 minetest
.add_node(pos
, {name
="3dforniture:toilet", param2
=node
.param2
})
321 minetest
.sound_play("3dforniture_dig_toilet", {gain
=0.5, pos
=pos
}, false)
323 on_rotate
= "simple",
327 minetest
.register_node("3dforniture:sink",
328 {description
= S("Sink"),
330 "forniture_marble_top_sink.png", "forniture_marble.png",
331 "forniture_marble_sb1.png", "forniture_marble_sb1.png",
332 "forniture_marble_sb2.png", "forniture_marble_sb2.png",
334 inventory_image
= "3dforniture_inv_sink.png",
335 drawtype
= "nodebox",
336 sunlight_propagates
= true,
338 paramtype2
= 'facedir',
342 {-0.15,0.35,0.2,0.15,0.4,0.5},
343 {-0.25,0.4,0.4, 0.25,0.45,0.5},
344 {-0.25,0.4,0.15, -0.15,0.45,0.4},
345 {0.15,0.4,0.15, 0.25,0.45,0.4},
346 {-0.15,0.4,0.15, 0.15,0.45,0.2},
347 {-0.3,0.45,0.4, 0.3,0.5,0.5},
348 {-0.3,0.45,0.1, -0.25,0.5,0.4},
349 {0.25,0.45,0.1, 0.3,0.5,0.4},
350 {-0.25,0.45,0.1, 0.25,0.5,0.15},
355 fixed
= {-0.3,0.35,0.1, 0.3,0.5,0.5},
357 groups
= {cracky
=2,},
358 sounds
= hades_sounds
.node_sound_stone_defaults(),
359 on_rotate
= "simple",
363 minetest
.register_node("3dforniture:taps",
364 { description
= S("Taps"),
366 "forniture_metal.png", "forniture_metal.png",
367 "forniture_metal_s1.png", "forniture_metal_s1.png",
368 "forniture_metal_s2.png", "forniture_metal_s2.png",
370 inventory_image
= "3dforniture_inv_taps.png",
371 drawtype
= "nodebox",
372 sunlight_propagates
= true,
374 paramtype2
= 'facedir',
379 {-0.25,-0.45,0.49, 0.25,-0.3,0.5},
380 {-0.05,-0.4,0.25, 0.05,-0.35,0.5},
381 {-0.05,-0.425,0.25,0.05,-0.4,0.3},
384 {-0.2,-0.4,0.45, -0.15,-0.35,0.5},
385 {-0.2,-0.45,0.4, -0.15,-0.3,0.45},
386 {-0.25,-0.4,0.4, -0.1,-0.35,0.45},
389 {0.15,-0.4,0.45, 0.2,-0.35,0.5},
390 {0.15,-0.45,0.4, 0.2,-0.3,0.45},
391 {0.1,-0.4,0.4, 0.25,-0.35,0.45},
396 fixed
= {-0.25,-0.45,0.25, 0.25,-0.3,0.5},
398 groups
= {cracky
=2,},
399 sounds
= hades_sounds
.node_sound_metal_defaults(),
400 on_rotate
= "simple",
404 minetest
.register_node("3dforniture:shower_tray",
405 { description
= S("Shower Tray"),
407 "forniture_marble_base_ducha_top.png",
408 "forniture_marble_base_ducha_top.png",
409 "forniture_marble_sb1.png",
410 "forniture_marble_sb1.png",
411 "forniture_marble_sb2.png",
412 "forniture_marble_sb2.png",
414 inventory_image
= "3dforniture_inv_shower_tray.png",
415 drawtype
= "nodebox",
416 sunlight_propagates
= true,
418 paramtype2
= 'facedir',
419 legacy_facedir_simple
= true,
423 {-0.5,-0.5,-0.5, 0.5,-0.45,0.5},
424 {-0.5,-0.45,-0.5, 0.5,-0.4,-0.45},
425 {-0.5,-0.45,0.45, 0.5,-0.4,0.5},
426 {-0.5,-0.45,-0.45, -0.45,-0.4,0.45},
427 {0.45,-0.45,-0.45, 0.5,-0.4,0.45},
432 fixed
= {-0.5,-0.5,-0.5, 0.5,-0.4,0.5},
434 groups
= {cracky
=2,},
435 sounds
= hades_sounds
.node_sound_stone_defaults(),
436 on_rotate
= "simple",
440 minetest
.register_node("3dforniture:shower_head",
441 {description
= S("Shower Head"),
443 "forniture_metal.png",
444 "forniture_metal.png",
445 "forniture_metal_s1.png",
446 "forniture_metal_s1.png",
447 "forniture_metal_s2.png",
448 "forniture_metal_s2.png",
450 inventory_image
= "3dforniture_inv_shower_head.png",
451 drawtype
= "nodebox",
452 sunlight_propagates
= true,
454 paramtype2
= 'facedir',
458 {-0.1,-0.5,0.1, 0.1,-0.4,0.3},
459 {-0.05,-0.4,0.15, 0.05,-0.3,0.25},
460 {-0.05,-0.35,0.25,0.05,-0.3,0.5},
461 {-0.1,-0.4,0.49, 0.1,-0.25,0.5},
466 fixed
= {-0.1,-0.5,0.1, 0.1,-0.25,0.5},
468 groups
= {cracky
=2,},
469 sounds
= hades_sounds
.node_sound_metal_defaults(),
470 on_rotate
= "simple",
473 --[[ ----- Medieval theme -----]]
476 minetest
.register_node("3dforniture:bars",
477 { description
= S("Steel Bars"),
479 "forniture_black_metal.png",
480 "forniture_black_metal.png",
481 "forniture_black_metal_s1.png",
482 "forniture_black_metal_s1.png",
483 "forniture_black_metal_s2.png",
484 "forniture_black_metal_s2.png",
486 drawtype
= "nodebox",
487 sunlight_propagates
= true,
489 paramtype2
= "facedir",
493 {-0.5,-0.5,-0.1, -0.4,0.5,0.1},
494 {-0.1,-0.5,-0.1, 0.1,0.5,0.1},
495 {0.4,-0.5,-0.1, 0.5,0.5,0.1},
496 {-0.5,-0.5,-0.05, 0.5,-0.45,0.05},
497 {-0.5,0.45,-0.05, 0.5,0.5,0.05}
502 fixed
= {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
505 sounds
= hades_sounds
.node_sound_metal_defaults(),
506 on_rotate
= "simple",
509 -- L Binding Bars (corner)
510 minetest
.register_node("3dforniture:L_binding_bars",
511 { description
=S("Binding Steel Bars"),
513 "forniture_black_metal.png",
514 "forniture_black_metal.png",
515 "forniture_black_metal_s1.png",
516 "forniture_black_metal_s1.png",
517 "forniture_black_metal_s2.png",
518 "forniture_black_metal_s2.png",
520 drawtype
= "nodebox",
521 sunlight_propagates
= true,
523 paramtype2
="facedir",
527 {-0.1,-0.5,-0.5,0.1,0.5,-0.4},
528 {-0.15,-0.5,-0.15, 0.15,0.5,0.15},
529 {0.4,-0.5,-0.1, 0.5,0.5,0.1},
530 {0,-0.5,-0.05, 0.5,-0.45,0.05},
531 {-0.05,-0.5,-0.5, 0.05,-0.45,0},
532 {0,0.45,-0.05, 0.5,0.5,0.05},
533 {-0.05,0.45,-0.5, 0.05,0.5,0},
536 groups
= {cracky
=1,},
537 sounds
= hades_sounds
.node_sound_metal_defaults(),
538 on_rotate
= "simple",
542 minetest
.register_node("3dforniture:chains",
543 { description
= S("Chains"),
545 "forniture_black_metal.png",
546 "forniture_black_metal.png",
547 "forniture_black_metal_s1.png",
548 "forniture_black_metal_s1.png",
549 "forniture_black_metal_s2.png",
550 "forniture_black_metal_s2.png",
552 inventory_image
= "3dforniture_inv_chains.png",
553 drawtype
= "nodebox",
554 sunlight_propagates
= true,
556 paramtype2
= "facedir",
563 {-0.45,0.25,0.45, -0.2,0.5,0.5},
564 {-0.35,0.4,0.35, -0.3,0.45,0.45},
565 {-0.35,0.3,0.35, -0.3,0.35,0.45},
566 {-0.35,0.35,0.3, -0.3,0.4,0.35},
569 {-0.4,0.35,0.35, -0.25,0.4,0.4},
570 {-0.4,0.15,0.35, -0.25,0.2,0.4},
571 {-0.45,0.2,0.35, -0.4,0.35,0.4},
572 {-0.25,0.2,0.35, -0.2,0.35,0.4},
575 {-0.35,0.2,0.3, -0.3,0.25,0.45},
576 {-0.35,0,0.3, -0.3,0.05,0.45},
577 {-0.35,0.05,0.25, -0.3,0.2,0.3},
578 {-0.35,0.05,0.45, -0.3,0.2,0.5},
581 {-0.4,0.05,0.35, -0.25,0.1,0.4},
582 {-0.4,-0.15,0.35, -0.25,-0.1,0.4},
583 {-0.45,-0.1,0.35, -0.4,0.05,0.4},
584 {-0.25,-0.1,0.35, -0.2,0.05,0.4},
587 {-0.35,-0.1,0.3, -0.3,-0.05,0.45},
588 {-0.35,-0.3,0.3, -0.3,-0.25,0.45},
589 {-0.35,-0.25,0.25, -0.3,-0.1,0.3},
590 {-0.35,-0.25,0.45, -0.3,-0.1,0.5},
593 {-0.4,-0.25,0.35, -0.25,-0.2,0.4},
594 {-0.4,-0.45,0.35, -0.25,-0.4,0.4},
595 {-0.45,-0.4,0.35, -0.4,-0.25,0.4},
596 {-0.25,-0.4,0.35, -0.2,-0.25,0.4},
601 {0.2,0.25,0.45, 0.45,0.5,0.5},
602 {0.3,0.4,0.35,0.35,0.45,0.45},
603 {0.3,0.3,0.35, 0.35,0.35,0.45},
604 {0.3,0.35,0.3, 0.35,0.4,0.35},
607 {0.25,0.35,0.35, 0.4,0.4,0.4},
608 {0.25,0.15,0.35, 0.4,0.2,0.4},
609 {0.2,0.2,0.35, 0.25,0.35,0.4},
610 {0.4,0.2,0.35, 0.45,0.35,0.4},
613 {0.3,0.2,0.3, 0.35,0.25,0.45},
614 {0.3,0,0.3, 0.35,0.05,0.45},
615 {0.3,0.05,0.25, 0.35,0.2,0.3},
616 {0.3,0.05,0.45, 0.35,0.2,0.5},
619 {0.25,0.05,0.35, 0.4,0.1,0.4},
620 {0.25,-0.15,0.35, 0.4,-0.1,0.4},
621 {0.2,-0.1,0.35, 0.25,0.05,0.4},
622 {0.4,-0.1,0.35, 0.45,0.05,0.4},
625 {0.3,-0.1,0.3, 0.35,-0.05,0.45},
626 {0.3,-0.3,0.3, 0.35,-0.25,0.45},
627 {0.3,-0.25,0.25, 0.35,-0.1,0.3},
628 {0.3,-0.25,0.45, 0.35,-0.1,0.5},
631 {0.25,-0.25,0.35, 0.4,-0.2,0.4},
632 {0.25,-0.45,0.35,0.4,-0.4,0.4},
633 {0.2,-0.4,0.35, 0.25,-0.25,0.4},
634 {0.4,-0.4,0.35, 0.45,-0.25,0.4},
640 {-0.45, -0.45, 1/4, -0.2, 1/2, 1/2},
641 {0.2, -0.45, 1/4, 0.45, 1/2, 1/2},
645 sounds
= hades_sounds
.node_sound_metal_defaults(),
646 on_rotate
= "simple",