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",
55 "forniture_wood"..append
..".png",
56 "forniture_wood_s1"..append
..".png",
57 "forniture_wood_s1"..append
..".png",
58 "forniture_wood_s2"..append
..".png",
59 "forniture_wood_s2"..append
..".png",
62 sunlight_propagates
= true,
64 paramtype2
= "facedir",
68 {-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
69 {0.3,-0.5,-0.4, 0.4,0.4,-0.3},
70 {-0.4,-0.5,0.3, -0.3,0.4,0.4},
71 {0.3,-0.5,0.3, 0.4,0.4,0.4},
72 {-0.5,0.4,-0.5, 0.5,0.5,0.5},
73 {-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
74 {0.3,-0.2,-0.4, 0.4,-0.1,0.3},
75 {-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
76 {-0.3,-0.2,0.3, 0.3,-0.1,0.4},
79 groups
= {table=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
80 sounds
= hades_sounds
.node_sound_wood_defaults(),
84 minetest
.register_node("3dforniture:chair"..append
,
85 { description
= desc_c
,
87 "forniture_wood"..append
..".png",
88 "forniture_wood"..append
..".png",
89 "forniture_wood_s1"..append
..".png",
90 "forniture_wood_s1"..append
..".png",
91 "forniture_wood_s2"..append
..".png",
92 "forniture_wood_s2"..append
..".png",
95 sunlight_propagates
= true,
97 paramtype2
= "facedir",
101 {-0.3,-0.5,0.2, -0.2,0.5,0.3},
102 {0.2,-0.5,0.2, 0.3,0.5,0.3},
103 {-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
104 {0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
105 {-0.3,-0.1,-0.3, 0.3,0,0.2},
106 {-0.2,0.1,0.25, 0.2,0.4,0.26}
111 fixed
= {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
113 groups
= {chair
=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
114 sounds
= hades_sounds
.node_sound_wood_defaults(),
118 local armchair_colors
= {
119 {"", S("Black Armchair")},
120 {"_white", S("White Armchair")},
121 {"_red", S("Red Armchair")},
122 {"_brown", S("Brown Armchair")},
123 {"_blue", S("Blue Armchair")},
124 {"_dark_green", S("Dark Green Armchair")},
128 for a
=1, #armchair_colors
do
129 local append
= armchair_colors
[a
][1]
130 local desc
= armchair_colors
[a
][2]
131 minetest
.register_node("3dforniture:armchair"..append
,
132 { description
= desc
,
134 "forniture_armchair_top"..append
..".png",
135 "forniture_armchair_top"..append
..".png",
136 "forniture_armchair_lat1"..append
..".png",
137 "forniture_armchair_lat1"..append
..".png",
138 "forniture_armchair_lat2"..append
..".png",
139 "forniture_armchair_lat2"..append
..".png",
141 drawtype
= "nodebox",
142 sunlight_propagates
= true,
144 paramtype2
= "facedir",
149 {-0.5,-0.5,-0.45, -0.3,0.05,0.3},
150 {-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
151 {-0.45,0.05,-0.45, -0.35,0.1,0.15},
153 {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},
155 {-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
157 {-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
160 {-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},
162 {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},
167 fixed
= {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
169 groups
= {armchair
=1, snappy
=2,choppy
=2,oddly_breakable_by_hand
=2},
170 sounds
= hades_sounds
.node_sound_wood_defaults(),
180 { "max", "hi", minetest
.LIGHT_MAX
},
183 local drop
, not_in_creative_inventory
185 drop
= "3dforniture:table_lamp_off"
186 not_in_creative_inventory
= 1
188 minetest
.register_node("3dforniture:table_lamp_"..lamps
[l
][1], {
189 description
= S("Table Lamp"),
190 _tt_help
= S("4 different luminance levels"),
191 drawtype
= "nodebox",
193 "forniture_table_lamp_s.png",
194 "forniture_table_lamp_s.png",
195 "forniture_table_lamp_l.png",
198 paramtype2
= 'facedir',
203 {-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
204 {-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
205 {-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
206 {-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
207 {-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
210 {-0.2,-0.1,-0.2, -0.175,0.3,0.2},
211 {0.175,-0.1,-0.2, 0.2,0.3,0.2},
212 {-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
213 {-0.175,-0.1,0.175, 0.175,0.3,0.2},
216 sunlight_propagates
= true,
218 light_source
= lamps
[l
][3],
221 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.3, 0.2},
223 groups
= {cracky
=2,oddly_breakable_by_hand
=1,not_in_creative_inventory
=not_in_creative_inventory
},
225 sounds
= hades_sounds
.node_sound_glass_defaults(),
226 on_rightclick
= function(pos
, node
, clicker
)
227 minetest
.sound_play({name
="3dforniture_table_lamp_switch"}, {pos
=pos
, gain
=0.35, max_hear_distance
=6})
228 minetest
.set_node(pos
, {name
="3dforniture:table_lamp_"..lamps
[l
][2]})
230 on_rotate
= "simple",
235 --[[ ----- Bathroom Kit -----]]
238 minetest
.register_node("3dforniture:toilet",
239 { description
= S("Toilet"),
241 "forniture_marble.png", "forniture_marble.png",
242 "forniture_marble_s1.png", "forniture_marble_s1.png",
243 "forniture_marble_s2.png", "forniture_marble_s2.png",
245 drawtype
= "nodebox",
246 sunlight_propagates
= false,
248 paramtype2
= "facedir",
252 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
253 {-0.1,-0.45,-0.1, 0.1,0,0.5},
254 {-0.3,-0.2,-0.3, 0.3,0,0.35},
255 {-0.25,0,-0.25, 0.25,0.05,0.25},
256 {-0.3,0,0.3, 0.3,0.4,0.5},
257 {-0.05,0.4,0.35, 0.05,0.45,0.45},
260 drop
="3dforniture:toilet",
261 groups
= {cracky
=3,},
262 sounds
= hades_sounds
.node_sound_stone_defaults(),
263 on_rightclick
= function (pos
, node
, clicker
)
264 minetest
.add_node(pos
, {name
="3dforniture:toilet_open", param2
=node
.param2
})
266 on_rotate
= "simple",
268 minetest
.register_node("3dforniture:toilet_open",
271 "forniture_marble_top_toilet.png", "forniture_marble.png",
272 "forniture_marble_sb1.png", "forniture_marble_sb1.png",
273 "forniture_marble_sb2.png", "forniture_marble_sb2.png",
275 drawtype
= "nodebox",
276 sunlight_propagates
= false,
278 paramtype2
= 'facedir',
282 {-0.2,-0.5,-0.2, 0.2,-0.45,0.5},
283 {-0.1,-0.45,-0.1, 0.1,-0.2,0.5},
284 {-0.1,-0.2,0.3, 0.1,0,0.5},
285 {-0.3,-0.2,0.1, 0.3,0,0.35},
286 {-0.3,-0.2,-0.3, -0.1,-0.15,0.1},
287 {-0.1,-0.2,-0.3, 0.1,-0.15,-0.1},
288 {0.1,-0.2,-0.3, 0.3,-0.15,0.1},
289 {-0.3,-0.15,-0.3, -0.2,0,0.1},
290 {-0.2,-0.15,-0.3, 0.2,0,-0.2},
291 {0.2,-0.15,-0.3, 0.3,0,0.1},
292 {-0.25,0,0.2, 0.25,0.5,0.25},
293 {-0.3,0,0.3, 0.3,0.4,0.5},
296 drop
= "3dforniture:toilet",
297 groups
= {cracky
= 3,not_in_creative_inventory
=1},
298 sounds
= hades_sounds
.node_sound_stone_defaults(),
299 on_rightclick
= function (pos
, node
, clicker
)
300 minetest
.add_node(pos
, {name
="3dforniture:toilet", param2
=node
.param2
})
301 minetest
.sound_play("3dforniture_dig_toilet", {gain
=0.5, pos
=pos
}, false)
303 on_rotate
= "simple",
307 minetest
.register_node("3dforniture:sink",
308 {description
= S("Sink"),
310 "forniture_marble_top_sink.png", "forniture_marble.png",
311 "forniture_marble_sb1.png", "forniture_marble_sb1.png",
312 "forniture_marble_sb2.png", "forniture_marble_sb2.png",
314 inventory_image
= "3dforniture_inv_sink.png",
315 drawtype
= "nodebox",
316 sunlight_propagates
= true,
318 paramtype2
= 'facedir',
322 {-0.15,0.35,0.2,0.15,0.4,0.5},
323 {-0.25,0.4,0.4, 0.25,0.45,0.5},
324 {-0.25,0.4,0.15, -0.15,0.45,0.4},
325 {0.15,0.4,0.15, 0.25,0.45,0.4},
326 {-0.15,0.4,0.15, 0.15,0.45,0.2},
327 {-0.3,0.45,0.4, 0.3,0.5,0.5},
328 {-0.3,0.45,0.1, -0.25,0.5,0.4},
329 {0.25,0.45,0.1, 0.3,0.5,0.4},
330 {-0.25,0.45,0.1, 0.25,0.5,0.15},
335 fixed
= {-0.3,0.35,0.1, 0.3,0.5,0.5},
337 groups
= {cracky
=2,},
338 sounds
= hades_sounds
.node_sound_stone_defaults(),
339 on_rotate
= "simple",
343 minetest
.register_node("3dforniture:taps",
344 { description
= S("Taps"),
346 "forniture_metal.png", "forniture_metal.png",
347 "forniture_metal_s1.png", "forniture_metal_s1.png",
348 "forniture_metal_s2.png", "forniture_metal_s2.png",
350 inventory_image
= "3dforniture_inv_taps.png",
351 drawtype
= "nodebox",
352 sunlight_propagates
= true,
354 paramtype2
= 'facedir',
359 {-0.25,-0.45,0.49, 0.25,-0.3,0.5},
360 {-0.05,-0.4,0.25, 0.05,-0.35,0.5},
361 {-0.05,-0.425,0.25,0.05,-0.4,0.3},
364 {-0.2,-0.4,0.45, -0.15,-0.35,0.5},
365 {-0.2,-0.45,0.4, -0.15,-0.3,0.45},
366 {-0.25,-0.4,0.4, -0.1,-0.35,0.45},
369 {0.15,-0.4,0.45, 0.2,-0.35,0.5},
370 {0.15,-0.45,0.4, 0.2,-0.3,0.45},
371 {0.1,-0.4,0.4, 0.25,-0.35,0.45},
376 fixed
= {-0.25,-0.45,0.25, 0.25,-0.3,0.5},
378 groups
= {cracky
=2,},
379 sounds
= hades_sounds
.node_sound_metal_defaults(),
380 on_rotate
= "simple",
384 minetest
.register_node("3dforniture:shower_tray",
385 { description
= S("Shower Tray"),
387 "forniture_marble_base_ducha_top.png",
388 "forniture_marble_base_ducha_top.png",
389 "forniture_marble_sb1.png",
390 "forniture_marble_sb1.png",
391 "forniture_marble_sb2.png",
392 "forniture_marble_sb2.png",
394 inventory_image
= "3dforniture_inv_shower_tray.png",
395 drawtype
= "nodebox",
396 sunlight_propagates
= true,
398 paramtype2
= 'facedir',
399 legacy_facedir_simple
= true,
403 {-0.5,-0.5,-0.5, 0.5,-0.45,0.5},
404 {-0.5,-0.45,-0.5, 0.5,-0.4,-0.45},
405 {-0.5,-0.45,0.45, 0.5,-0.4,0.5},
406 {-0.5,-0.45,-0.45, -0.45,-0.4,0.45},
407 {0.45,-0.45,-0.45, 0.5,-0.4,0.45},
412 fixed
= {-0.5,-0.5,-0.5, 0.5,-0.4,0.5},
414 groups
= {cracky
=2,},
415 sounds
= hades_sounds
.node_sound_stone_defaults(),
416 on_rotate
= "simple",
420 minetest
.register_node("3dforniture:shower_head",
421 {description
= S("Shower Head"),
423 "forniture_metal.png",
424 "forniture_metal.png",
425 "forniture_metal_s1.png",
426 "forniture_metal_s1.png",
427 "forniture_metal_s2.png",
428 "forniture_metal_s2.png",
430 inventory_image
= "3dforniture_inv_shower_head.png",
431 drawtype
= "nodebox",
432 sunlight_propagates
= true,
434 paramtype2
= 'facedir',
438 {-0.1,-0.5,0.1, 0.1,-0.4,0.3},
439 {-0.05,-0.4,0.15, 0.05,-0.3,0.25},
440 {-0.05,-0.35,0.25,0.05,-0.3,0.5},
441 {-0.1,-0.4,0.49, 0.1,-0.25,0.5},
446 fixed
= {-0.1,-0.5,0.1, 0.1,-0.25,0.5},
448 groups
= {cracky
=2,},
449 sounds
= hades_sounds
.node_sound_metal_defaults(),
450 on_rotate
= "simple",
453 --[[ ----- Medieval theme -----]]
456 minetest
.register_node("3dforniture:bars",
457 { description
= S("Steel Bars"),
459 "forniture_black_metal.png",
460 "forniture_black_metal.png",
461 "forniture_black_metal_s1.png",
462 "forniture_black_metal_s1.png",
463 "forniture_black_metal_s2.png",
464 "forniture_black_metal_s2.png",
466 drawtype
= "nodebox",
467 sunlight_propagates
= true,
469 paramtype2
= "facedir",
473 {-0.5,-0.5,-0.1, -0.4,0.5,0.1},
474 {-0.1,-0.5,-0.1, 0.1,0.5,0.1},
475 {0.4,-0.5,-0.1, 0.5,0.5,0.1},
476 {-0.5,-0.5,-0.05, 0.5,-0.45,0.05},
477 {-0.5,0.45,-0.05, 0.5,0.5,0.05}
482 fixed
= {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
485 sounds
= hades_sounds
.node_sound_metal_defaults(),
486 on_rotate
= "simple",
489 -- L Binding Bars (corner)
490 minetest
.register_node("3dforniture:L_binding_bars",
491 { description
=S("Binding Steel Bars"),
493 "forniture_black_metal.png",
494 "forniture_black_metal.png",
495 "forniture_black_metal_s1.png",
496 "forniture_black_metal_s1.png",
497 "forniture_black_metal_s2.png",
498 "forniture_black_metal_s2.png",
500 drawtype
= "nodebox",
501 sunlight_propagates
= true,
503 paramtype2
="facedir",
507 {-0.1,-0.5,-0.5,0.1,0.5,-0.4},
508 {-0.15,-0.5,-0.15, 0.15,0.5,0.15},
509 {0.4,-0.5,-0.1, 0.5,0.5,0.1},
510 {0,-0.5,-0.05, 0.5,-0.45,0.05},
511 {-0.05,-0.5,-0.5, 0.05,-0.45,0},
512 {0,0.45,-0.05, 0.5,0.5,0.05},
513 {-0.05,0.45,-0.5, 0.05,0.5,0},
516 groups
= {cracky
=1,},
517 sounds
= hades_sounds
.node_sound_metal_defaults(),
518 on_rotate
= "simple",
522 minetest
.register_node("3dforniture:chains",
523 { description
= S("Chains"),
525 "forniture_black_metal.png",
526 "forniture_black_metal.png",
527 "forniture_black_metal_s1.png",
528 "forniture_black_metal_s1.png",
529 "forniture_black_metal_s2.png",
530 "forniture_black_metal_s2.png",
532 inventory_image
= "3dforniture_inv_chains.png",
533 drawtype
= "nodebox",
534 sunlight_propagates
= true,
536 paramtype2
= "facedir",
543 {-0.45,0.25,0.45, -0.2,0.5,0.5},
544 {-0.35,0.4,0.35, -0.3,0.45,0.45},
545 {-0.35,0.3,0.35, -0.3,0.35,0.45},
546 {-0.35,0.35,0.3, -0.3,0.4,0.35},
549 {-0.4,0.35,0.35, -0.25,0.4,0.4},
550 {-0.4,0.15,0.35, -0.25,0.2,0.4},
551 {-0.45,0.2,0.35, -0.4,0.35,0.4},
552 {-0.25,0.2,0.35, -0.2,0.35,0.4},
555 {-0.35,0.2,0.3, -0.3,0.25,0.45},
556 {-0.35,0,0.3, -0.3,0.05,0.45},
557 {-0.35,0.05,0.25, -0.3,0.2,0.3},
558 {-0.35,0.05,0.45, -0.3,0.2,0.5},
561 {-0.4,0.05,0.35, -0.25,0.1,0.4},
562 {-0.4,-0.15,0.35, -0.25,-0.1,0.4},
563 {-0.45,-0.1,0.35, -0.4,0.05,0.4},
564 {-0.25,-0.1,0.35, -0.2,0.05,0.4},
567 {-0.35,-0.1,0.3, -0.3,-0.05,0.45},
568 {-0.35,-0.3,0.3, -0.3,-0.25,0.45},
569 {-0.35,-0.25,0.25, -0.3,-0.1,0.3},
570 {-0.35,-0.25,0.45, -0.3,-0.1,0.5},
573 {-0.4,-0.25,0.35, -0.25,-0.2,0.4},
574 {-0.4,-0.45,0.35, -0.25,-0.4,0.4},
575 {-0.45,-0.4,0.35, -0.4,-0.25,0.4},
576 {-0.25,-0.4,0.35, -0.2,-0.25,0.4},
581 {0.2,0.25,0.45, 0.45,0.5,0.5},
582 {0.3,0.4,0.35,0.35,0.45,0.45},
583 {0.3,0.3,0.35, 0.35,0.35,0.45},
584 {0.3,0.35,0.3, 0.35,0.4,0.35},
587 {0.25,0.35,0.35, 0.4,0.4,0.4},
588 {0.25,0.15,0.35, 0.4,0.2,0.4},
589 {0.2,0.2,0.35, 0.25,0.35,0.4},
590 {0.4,0.2,0.35, 0.45,0.35,0.4},
593 {0.3,0.2,0.3, 0.35,0.25,0.45},
594 {0.3,0,0.3, 0.35,0.05,0.45},
595 {0.3,0.05,0.25, 0.35,0.2,0.3},
596 {0.3,0.05,0.45, 0.35,0.2,0.5},
599 {0.25,0.05,0.35, 0.4,0.1,0.4},
600 {0.25,-0.15,0.35, 0.4,-0.1,0.4},
601 {0.2,-0.1,0.35, 0.25,0.05,0.4},
602 {0.4,-0.1,0.35, 0.45,0.05,0.4},
605 {0.3,-0.1,0.3, 0.35,-0.05,0.45},
606 {0.3,-0.3,0.3, 0.35,-0.25,0.45},
607 {0.3,-0.25,0.25, 0.35,-0.1,0.3},
608 {0.3,-0.25,0.45, 0.35,-0.1,0.5},
611 {0.25,-0.25,0.35, 0.4,-0.2,0.4},
612 {0.25,-0.45,0.35,0.4,-0.4,0.4},
613 {0.2,-0.4,0.35, 0.25,-0.25,0.4},
614 {0.4,-0.4,0.35, 0.45,-0.25,0.4},
619 fixed
= {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2}, },
621 sounds
= hades_sounds
.node_sound_metal_defaults(),
622 on_rotate
= "simple",