Add desert sandstone trap

This commit is contained in:
Wuzzy 2019-08-19 17:26:05 +02:00
parent 2ce13628cc
commit 8901184f72
4 changed files with 40 additions and 4 deletions

View File

@ -1,8 +1,10 @@
Cracked Desert Sandstone Brick = Rissiger Wüstensandsteinziegel
Cracked Sandstone Brick = Rissiger Sandsteinziegel
Desert Sandstone with Ankh Engraving = Wüstensandstein mit Ankh-Gravur
Desert Sandstone with Cactus Engraving = Wüstensandstein mit Kaktusgravur
Desert Sandstone with Scarab Engraving = Wüstensandstein mit Skarabäusgravur
Falling Cracked Sandstone Brick = Fallender rissiger Sandsteinziegel
Falling Cracked Desert Sandstone Brick = Fallender rissiger Wüstensandsteinziegel
Mummy Spawn Egg = Mumien-Spawn-Ei
Mummy Spawner = Mumien-Spawner
Sandstone with Eye Engraving = Sandstein mit Augengravur

View File

@ -1,8 +1,10 @@
Cracked Desert Sandstone Brick =
Cracked Sandstone Brick =
Desert Sandstone with Ankh Engraving =
Desert Sandstone with Cactus Engraving =
Desert Sandstone with Scarab Engraving =
Falling Cracked Sandstone Brick =
Falling Cracked Desert Sandstone Brick =
Mummy Spawn Egg =
Mummy Spawner =
Sandstone with Eye Engraving =

View File

@ -39,15 +39,21 @@ for i=1, #img do
})
end
local trap_on_timer = function (pos, elapsed)
local trap_on_timer = function(pos, elapsed)
local objs = minetest.get_objects_inside_radius(pos, 2)
local n = minetest.get_node(pos)
for i, obj in pairs(objs) do
if obj:is_player() then
local n = minetest.get_node(pos)
if n and n.name then
if minetest.registered_nodes[n.name]._tsm_pyramids_crack and minetest.registered_nodes[n.name]._tsm_pyramids_crack < 2 then
minetest.set_node(pos, {name="tsm_pyramids:trap_2"})
minetest.check_for_falling(pos)
if n.name == "tsm_pyramids:trap" then
minetest.set_node(pos, {name="tsm_pyramids:trap_2"})
minetest.check_for_falling(pos)
elseif n.name == "tsm_pyramids:desert_trap" then
minetest.set_node(pos, {name="tsm_pyramids:desert_trap_2"})
minetest.check_for_falling(pos)
end
return true
end
end
end
@ -79,3 +85,28 @@ minetest.register_node("tsm_pyramids:trap_2", {
sounds = default.node_sound_stone_defaults(),
drop = "",
})
minetest.register_node("tsm_pyramids:desert_trap", {
description = S("Cracked Desert 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."),
tiles = {"default_desert_sandstone_brick.png^tsm_pyramids_crack.png"},
is_ground_content = false,
groups = {crumbly=3,cracky=3},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(0.1)
end,
_tsm_pyramids_crack = 1,
on_timer = trap_on_timer,
drop = "",
})
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 = "",
})

View File

@ -35,6 +35,7 @@ code_desert["1"] = "deco_stone4"
code_desert["2"] = "deco_stone5"
code_desert["3"] = "deco_stone6"
code_desert["b"] = "desert_sandstone_brick"
code_desert["t"] = "desert_trap"
local function replace(str, iy, code_table, deco)
local out = "default:"