mirror of
http://repo.or.cz/minetest_pyramids/tsm_pyramids.git
synced 2024-12-22 15:30:19 +01:00
Simplify trap stone definition
This commit is contained in:
parent
c2167e305a
commit
47b32ecae1
99
nodes.lua
99
nodes.lua
@ -61,72 +61,39 @@ local trap_on_timer = function(pos, elapsed)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("tsm_pyramids:trap", {
|
local register_trap_stone = function(basename, desc_normal, desc_falling, base_tile, drop)
|
||||||
description = S("Cracked Sandstone Brick"),
|
minetest.register_node("tsm_pyramids:"..basename, {
|
||||||
_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."),
|
description = desc_normal,
|
||||||
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack.png"},
|
_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."),
|
||||||
is_ground_content = false,
|
tiles = { base_tile .. "^tsm_pyramids_crack.png" },
|
||||||
groups = {crumbly=3,cracky=3},
|
is_ground_content = false,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
groups = {crumbly=3,cracky=3},
|
||||||
on_construct = function(pos)
|
sounds = default.node_sound_stone_defaults(),
|
||||||
minetest.get_node_timer(pos):start(0.1)
|
on_construct = function(pos)
|
||||||
end,
|
minetest.get_node_timer(pos):start(0.1)
|
||||||
_tsm_pyramids_crack = 1,
|
end,
|
||||||
on_timer = trap_on_timer,
|
_tsm_pyramids_crack = 1,
|
||||||
drop = {
|
on_timer = trap_on_timer,
|
||||||
items = {
|
drop = drop,
|
||||||
{ items = { "default:sand" }, rarity = 1 },
|
})
|
||||||
{ items = { "default:sand" }, rarity = 2 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("tsm_pyramids:trap_2", {
|
minetest.register_node("tsm_pyramids:"..basename.."_2", {
|
||||||
description = S("Falling Cracked Sandstone Brick"),
|
description = desc_falling,
|
||||||
_doc_items_longdesc = S("This old porous brick falls under its own weight."),
|
_doc_items_longdesc = S("This old porous brick falls under its own weight."),
|
||||||
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack2.png"},
|
tiles = { base_tile .. "^tsm_pyramids_crack2.png" },
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {crumbly=3,cracky=3,falling_node=1,not_in_creative_inventory=1},
|
groups = {crumbly=3,cracky=3,falling_node=1,not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
drop = {
|
drop = drop,
|
||||||
items = {
|
})
|
||||||
{ items = { "default:sand" }, rarity = 1 },
|
end
|
||||||
{ items = { "default:sand" }, rarity = 2 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("tsm_pyramids:desert_trap", {
|
register_trap_stone("trap",
|
||||||
description = S("Cracked Desert Sandstone Brick"),
|
S("Cracked Sandstone Brick"), S("Falling Cracked Sandstone Brick"),
|
||||||
_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."),
|
"default_sandstone_brick.png",
|
||||||
tiles = {"default_desert_sandstone_brick.png^tsm_pyramids_crack.png"},
|
{ items = { { items = { "default:sand" }, rarity = 1 }, { items = { "default:sand" }, rarity = 2 }, } })
|
||||||
is_ground_content = false,
|
register_trap_stone("desert_trap",
|
||||||
groups = {crumbly=3,cracky=3},
|
S("Cracked Desert Sandstone Brick"), S("Falling Cracked Desert Sandstone Brick"),
|
||||||
sounds = default.node_sound_stone_defaults(),
|
"default_desert_sandstone_brick.png",
|
||||||
on_construct = function(pos)
|
{ items = { { items = { "default:desert_sand" }, rarity = 1 }, { items = { "default:desert_sand" }, rarity = 2 }, } })
|
||||||
minetest.get_node_timer(pos):start(0.1)
|
|
||||||
end,
|
|
||||||
_tsm_pyramids_crack = 1,
|
|
||||||
on_timer = trap_on_timer,
|
|
||||||
drop = {
|
|
||||||
items = {
|
|
||||||
{ items = { "default:desert_sand" }, rarity = 1 },
|
|
||||||
{ items = { "default:desert_sand" }, rarity = 2 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("tsm_pyramids:desert_trap_2", {
|
|
||||||
description = S("Falling Cracked Desert Sandstone Brick"),
|
|
||||||
_doc_items_longdesc = S("This old porous brick falls under its own weight."),
|
|
||||||
tiles = {"default_desert_sandstone_brick.png^tsm_pyramids_crack2.png"},
|
|
||||||
is_ground_content = false,
|
|
||||||
groups = {crumbly=3,cracky=3,falling_node=1,not_in_creative_inventory=1},
|
|
||||||
sounds = default.node_sound_stone_defaults(),
|
|
||||||
drop = {
|
|
||||||
items = {
|
|
||||||
{ items = { "default:desert_sand" }, rarity = 1 },
|
|
||||||
{ items = { "default:desert_sand" }, rarity = 2 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user