1 -- Boilerplate to support localized strings if intllib mod is installed.
3 if minetest
.get_modpath("intllib") then
6 S
= function(s
) return s
end
11 "ankh", "scarab", "cactus"
14 S("Sandstone with Eye Engraving"), S("Sandstone with Man Engraving"), S("Sandstone with Sun Engraving"),
15 S("Desert Sandstone with Ankh Engraving"), S("Desert Sandstone with Scarab Engraving"), S("Desert Sandstone with Cactus Engraving")
19 if minetest
.get_modpath("doc_items") then
20 decodesc
= doc
.sub
.items
.temp
.deco
24 local sandstone_img
, basenode
26 sandstone_img
= "default_desert_sandstone.png"
27 basenode
= "default:desert_sandstone"
29 sandstone_img
= "default_sandstone.png"
30 basenode
= "default:sandstone"
32 minetest
.register_node("tsm_pyramids:deco_stone"..i
, {
33 description
= desc
[i
],
34 _doc_items_longdesc
= decodesc
,
35 is_ground_content
= false,
36 tiles
= {sandstone_img
, sandstone_img
, sandstone_img
.."^tsm_pyramids_"..img
[i
]..".png"},
37 groups
= minetest
.registered_nodes
[basenode
].groups
,
38 sounds
= minetest
.registered_nodes
[basenode
].sounds
,
42 local trap_on_timer
= function(pos
, elapsed
)
43 local objs
= minetest
.get_objects_inside_radius(pos
, 2)
44 local n
= minetest
.get_node(pos
)
45 for i
, obj
in pairs(objs
) do
46 if obj
:is_player() then
48 if minetest
.registered_nodes
[n
.name
]._tsm_pyramids_crack
and minetest
.registered_nodes
[n
.name
]._tsm_pyramids_crack
< 2 then
49 if n
.name
== "tsm_pyramids:trap" then
50 minetest
.set_node(pos
, {name
="tsm_pyramids:trap_2"})
51 minetest
.check_for_falling(pos
)
52 elseif n
.name
== "tsm_pyramids:desert_trap" then
53 minetest
.set_node(pos
, {name
="tsm_pyramids:desert_trap_2"})
54 minetest
.check_for_falling(pos
)
64 minetest
.register_node("tsm_pyramids:trap", {
65 description
= S("Cracked Sandstone Brick"),
66 _doc_items_longdesc
= S("This brick is old, porous and unstable and is barely able to hold itself. One should be careful not to disturb it."),
67 tiles
= {"default_sandstone_brick.png^tsm_pyramids_crack.png"},
68 is_ground_content
= false,
69 groups
= {crumbly
=3,cracky
=3},
70 sounds
= default
.node_sound_stone_defaults(),
71 on_construct
= function(pos
)
72 minetest
.get_node_timer(pos
):start(0.1)
74 _tsm_pyramids_crack
= 1,
75 on_timer
= trap_on_timer
,
79 minetest
.register_node("tsm_pyramids:trap_2", {
80 description
= S("Falling Cracked Sandstone Brick"),
81 _doc_items_longdesc
= S("This old porous brick falls under its own weight."),
82 tiles
= {"default_sandstone_brick.png^tsm_pyramids_crack2.png"},
83 is_ground_content
= false,
84 groups
= {crumbly
=3,cracky
=3,falling_node
=1,not_in_creative_inventory
=1},
85 sounds
= default
.node_sound_stone_defaults(),
89 minetest
.register_node("tsm_pyramids:desert_trap", {
90 description
= S("Cracked Desert Sandstone Brick"),
91 _doc_items_longdesc
= S("This brick is old, porous and unstable and is barely able to hold itself. One should be careful not to disturb it."),
92 tiles
= {"default_desert_sandstone_brick.png^tsm_pyramids_crack.png"},
93 is_ground_content
= false,
94 groups
= {crumbly
=3,cracky
=3},
95 sounds
= default
.node_sound_stone_defaults(),
96 on_construct
= function(pos
)
97 minetest
.get_node_timer(pos
):start(0.1)
99 _tsm_pyramids_crack
= 1,
100 on_timer
= trap_on_timer
,
104 minetest
.register_node("tsm_pyramids:desert_trap_2", {
105 description
= S("Falling Cracked Desert Sandstone Brick"),
106 _doc_items_longdesc
= S("This old porous brick falls under its own weight."),
107 tiles
= {"default_desert_sandstone_brick.png^tsm_pyramids_crack2.png"},
108 is_ground_content
= false,
109 groups
= {crumbly
=3,cracky
=3,falling_node
=1,not_in_creative_inventory
=1},
110 sounds
= default
.node_sound_stone_defaults(),