1 local img
= {"eye", "men", "sun"}
4 minetest
.register_node("tsm_pyramids:deco_stone"..i
, {
5 description
= "Sandstone with "..img
[i
],
6 tiles
= {"default_sandstone.png^tsm_pyramids_"..img
[i
]..".png"},
7 is_ground_content
= true,
8 groups
= {crumbly
=2,cracky
=3},
9 sounds
= default
.node_sound_stone_defaults(),
13 local trap_on_timer
= function (pos
, elapsed
)
14 local objs
= minetest
.env
:get_objects_inside_radius(pos
, 2)
15 for i
, obj
in pairs(objs
) do
16 if obj
:is_player() then
17 local n
= minetest
.get_node(pos
)
18 if n
and n
.name
and minetest
.registered_nodes
[n
.name
].crack
< 2 then
19 minetest
.set_node(pos
, {name
="tsm_pyramids:trap_2"})
27 minetest
.register_node("tsm_pyramids:trap", {
28 description
= "Cracked sandstone brick",
29 tiles
= {"default_sandstone_brick.png^tsm_pyramids_crack.png"},
30 is_ground_content
= true,
31 groups
= {crumbly
=2,cracky
=3},
32 sounds
= default
.node_sound_stone_defaults(),
33 on_construct
= function(pos
)
34 minetest
.env
:get_node_timer(pos
):start(0.1)
37 on_timer
= trap_on_timer
,
41 minetest
.register_node("tsm_pyramids:trap_2", {
42 description
= "trapstone",
43 tiles
= {"default_sandstone_brick.png^tsm_pyramids_crack.png^[transformR90"},
44 is_ground_content
= true,
45 groups
= {crumbly
=2,cracky
=3,falling_node
=1,not_in_creative_inventory
=1},
46 sounds
= default
.node_sound_stone_defaults(),