1 local S
= minetest
.get_translator("hades_furniture")
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 {"_uncolored", S("Uncolored Table"), S("Uncolored 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("hades_furniture:table"..append
,
52 {description
= desc_t
,
54 "hades_furniture_wood"..append
..".png",
57 sunlight_propagates
= true,
59 paramtype2
= "facedir",
60 is_ground_content
= false,
64 {-0.4,-0.5,-0.4, -0.3,0.4,-0.3},
65 {0.3,-0.5,-0.4, 0.4,0.4,-0.3},
66 {-0.4,-0.5,0.3, -0.3,0.4,0.4},
67 {0.3,-0.5,0.3, 0.4,0.4,0.4},
68 {-0.5,0.4,-0.5, 0.5,0.5,0.5},
69 {-0.4,-0.2,-0.3, -0.3,-0.1,0.3},
70 {0.3,-0.2,-0.4, 0.4,-0.1,0.3},
71 {-0.3,-0.2,-0.4, 0.4,-0.1,-0.3},
72 {-0.3,-0.2,0.3, 0.3,-0.1,0.4},
75 groups
= {table=1, choppy
=3,oddly_breakable_by_hand
=2},
76 sounds
= hades_sounds
.node_sound_wood_defaults(),
80 minetest
.register_node("hades_furniture:chair"..append
,
81 { description
= desc_c
,
83 "hades_furniture_wood"..append
..".png",
86 sunlight_propagates
= true,
88 paramtype2
= "facedir",
89 is_ground_content
= false,
90 _hades_itemshow_offset
= { x
=-0.118, y
=0, z
=-0.118 },
94 {-0.3,-0.5,0.2, -0.2,0.5,0.3},
95 {0.2,-0.5,0.2, 0.3,0.5,0.3},
96 {-0.3,-0.5,-0.3, -0.2,-0.1,-0.2},
97 {0.2,-0.5,-0.3, 0.3,-0.1,-0.2},
98 {-0.3,-0.1,-0.3, 0.3,0,0.2},
99 {-0.2,0.1,0.25, 0.2,0.4,0.26}
104 fixed
= {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
106 groups
= {chair
=1, choppy
=3,oddly_breakable_by_hand
=2},
107 sounds
= hades_sounds
.node_sound_wood_defaults(),
111 local armchair_colors
= {
112 {"", S("Black Armchair")},
113 {"_white", S("White Armchair")},
114 {"_red", S("Red Armchair")},
115 {"_brown", S("Brown Armchair")},
116 {"_blue", S("Blue Armchair")},
117 {"_dark_green", S("Dark Green Armchair")},
121 for a
=1, #armchair_colors
do
122 local append
= armchair_colors
[a
][1]
123 local desc
= armchair_colors
[a
][2]
124 minetest
.register_node("hades_furniture:armchair"..append
,
125 { description
= desc
,
127 "hades_furniture_armchair_top"..append
..".png",
128 "hades_furniture_armchair_top"..append
..".png",
129 "hades_furniture_armchair_lat1"..append
..".png",
130 "hades_furniture_armchair_lat1"..append
..".png",
131 "hades_furniture_armchair_lat2"..append
..".png",
132 "hades_furniture_armchair_lat2"..append
..".png",
134 drawtype
= "nodebox",
135 sunlight_propagates
= true,
137 paramtype2
= "facedir",
138 is_ground_content
= false,
143 {-0.5,-0.5,-0.45, -0.3,0.05,0.3},
144 {-0.45,-0.5,-0.5, -0.35,0.05,-0.45},
145 {-0.45,0.05,-0.45, -0.35,0.1,0.15},
147 {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},
149 {-0.5,-0.5,0.3, 0.5,0.45,0.5},{-0.45,0.45,0.35,0.45,0.5,0.45},
151 {-0.3,-0.45,-0.35, 0.3,-0.1,0.3},{-0.3,-0.45,-0.4, 0.3,-0.15,-0.35},
154 {-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},
156 {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},
161 fixed
= {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
163 groups
= {armchair
=1, choppy
=3,oddly_breakable_by_hand
=2},
164 sounds
= hades_sounds
.node_sound_wood_defaults({
165 footstep
= hades_sounds
.node_sound_cloth_defaults().footstep
,
176 { "max", "hi", minetest
.LIGHT_MAX
},
179 local drop
, not_in_creative_inventory
, tt
, desc
181 drop
= "hades_furniture:table_lamp_off"
182 not_in_creative_inventory
= 1
183 desc
= S("Table Lamp (level @1)", l
)
185 tt
= S("4 different luminance levels")
186 desc
= S("Table Lamp")
188 minetest
.register_node("hades_furniture:table_lamp_"..lamps
[l
][1], {
191 drawtype
= "nodebox",
193 "hades_furniture_table_lamp_s.png",
194 "hades_furniture_table_lamp_s.png",
195 "hades_furniture_table_lamp_l.png",
197 use_texture_alpha
= "clip",
199 paramtype2
= 'facedir',
200 is_ground_content
= false,
205 {-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
206 {-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
207 {-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
208 {-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
209 {-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
212 {-0.2,-0.1,-0.2, -0.175,0.3,0.2},
213 {0.175,-0.1,-0.2, 0.2,0.3,0.2},
214 {-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
215 {-0.175,-0.1,0.175, 0.175,0.3,0.2},
218 sunlight_propagates
= true,
220 light_source
= lamps
[l
][3],
223 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.3, 0.2},
225 groups
= {cracky
=2,oddly_breakable_by_hand
=1,not_in_creative_inventory
=not_in_creative_inventory
},
227 sounds
= hades_sounds
.node_sound_wood_defaults(),
228 on_rightclick
= function(pos
, node
, clicker
)
229 minetest
.sound_play({name
="hades_furniture_table_lamp_switch"}, {pos
=pos
, gain
=0.35, max_hear_distance
=6})
230 minetest
.set_node(pos
, {name
="hades_furniture:table_lamp_"..lamps
[l
][2]})
232 on_rotate
= "simple",
237 --[[ ----- Medieval theme -----]]
239 -- Steel Bars (only straight section)
242 { "bars", "L_binding_bars", S("Straight Steel Bars"), S("Binding Steel Bars"), { "hades_furniture_black_metal_s1.png" } },
243 { "rusty_bars", "binding_rusty_bars", S("Straight Rusty Bars"), S("Binding Rusty Bars"), { "columnia_rusty.png" } },
254 minetest
.register_node("hades_furniture:"..id
, {
257 drawtype
= "nodebox",
258 sunlight_propagates
= true,
260 paramtype2
= 'facedir',
261 is_ground_content
= false,
265 {-0.1,-0.5,-0.1, 0.1,0.5,0.1}, -- center bar
266 {0.4,-0.5,-0.1, 0.5,0.5,0.1}, -- right bar
267 {0.1,-0.5,-0.05, 0.4,-0.45,0.05}, -- right low rail
268 {0.1,0.45,-0.05, 0.4,0.5,0.05}, -- right high rail
269 {-0.5,-0.5,-0.1, -0.4,0.5,0.1}, -- left bar
270 {-0.4,-0.5,-0.05, -0.1,-0.45,0.05}, -- left low rail
271 {-0.4,0.45,-0.05, -0.1,0.5,0.05}, -- left high rail
276 fixed
= {-0.5,-0.5,-0.15, 0.5,0.5,0.15},
278 groups
= {metal_bars
=1, cracky
=1},
279 sounds
= hades_sounds
.node_sound_metal_defaults(),
280 on_rotate
= "simple",
281 _hades_shaper_next
= "hades_furniture:"..id2
,
284 -- Binding bars (for corners and junctions).
285 -- Also, center bar is slightly thicker
286 minetest
.register_node("hades_furniture:"..id2
,
290 drawtype
= "nodebox",
291 sunlight_propagates
= true,
293 is_ground_content
= false,
294 connects_to
= {"group:metal_bars", "hades_core:steelblock", "columnia:rusty_block"},
295 connect_sides
= { "left", "right", "front", "back" },
299 {-0.15,-0.5,-0.15, 0.15,0.5,0.15}, -- center bar
302 {0.4,-0.5,-0.1, 0.5,0.5,0.1}, -- bar
303 {0.15,-0.5,-0.05, 0.4,-0.45,0.05}, -- low rail
304 {0.15,0.45,-0.05, 0.4,0.5,0.05}, -- high rail
307 {-0.5,-0.5,-0.1, -0.4,0.5,0.1}, -- bar
308 {-0.4,-0.5,-0.05, -0.15,-0.45,0.05}, -- low rail
309 {-0.4,0.45,-0.05, -0.15,0.5,0.05}, -- high rail
312 {-0.1,-0.5,-0.5,0.1,0.5,-0.4}, -- bar
313 {-0.05,-0.5,-0.4, 0.05,-0.45,-0.15}, -- low rail
314 {-0.05,0.45,-0.4, 0.05,0.5,-0.15}, -- high rail
317 {-0.1,-0.5,0.4,0.1,0.5,0.5}, -- bar
318 {-0.05,-0.5,0.15, 0.05,-0.45,0.4}, -- low rail
319 {-0.05,0.45,0.15, 0.05,0.5,0.4}, -- high rail
325 {-0.15,-0.5,-0.15, 0.15,0.5,0.15}, -- center bar
328 {0.15,-0.5,-0.15, 0.5,0.5,0.15},
331 {-0.5,-0.5,-0.15, -0.15,0.5,0.15},
334 {-0.15,-0.5,-0.15, 0.15,0.5,0.5},
337 {-0.15,-0.5,-0.5, 0.15,0.5,-0.15},
341 groups
= {metal_bars
=1, cracky
=1,},
342 sounds
= hades_sounds
.node_sound_metal_defaults(),
343 _hades_shaper_next
= "hades_furniture:"..id
,
347 minetest
.register_node("hades_furniture:plant_pot", {
348 description
= S("Plant Pot"),
350 tiles
= {"hades_furniture_plant_pot_top.png", "hades_furniture_plant_pot_bottom.png", "hades_furniture_plant_pot_sides.png"},
351 is_ground_content
= false,
352 drawtype
= "nodebox",
353 is_ground_content
= false,
357 {-0.5,-0.5,-3/16, 0.5,0.5,3/16},
358 {-7/16,-0.5,-5/16, 7/16,0.5,5/16},
359 {-6/16,-0.5,-6/16, 6/16,0.5,6/16},
360 {-5/16,-0.5,-7/16, 5/16,0.5,7/16},
361 {-3/16,-0.5,-0.5, 3/16,0.5,0.5},
366 fixed
= {{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }},
369 sounds
= hades_sounds
.node_sound_stone_defaults({
370 footstep
= hades_sounds
.node_sound_dirt_defaults().footstep
,