Remove old comments
[minetest_pyramids/tsm_pyramids.git] / nodes.lua
blob75b1abba5be48a71de8c41701b07b6f53adf7b1a
1 local img = {"eye", "men", "sun"}
3 for i=1,3 do
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(),
11 end
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"})
20 nodeupdate(pos)
21 end
22 end
23 end
24 return true
25 end
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)
35 end,
36 crack = 1,
37 on_timer = trap_on_timer,
38 drop = "",
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(),
47 drop = "",