Add exploding chests and remove dungeon protection.

This commit is contained in:
Duane 2016-08-03 08:36:30 -05:00
parent ab1fc810a9
commit 4141dce691
2 changed files with 11 additions and 4 deletions

View file

@ -118,12 +118,22 @@ newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local ready = meta:get_string('formspec')
if treasures and ready == '' then
if minetest.get_modpath('tnt') and math.random(20) == 1 then
minetest.set_node(pos, {name = 'tnt:tnt_burning'})
local timer = minetest.get_node_timer(pos)
if timer then
timer:start(5)
end
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
return
end
meta:set_string("formspec", chest_formspec)
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
local something
for i = 1, 100 do
for j = 1, 3 * depth do
for j = 1, 5 * depth do
for _, tre in pairs(treasures) do
if tre.name and tre.level and tre.rarity and tre.level <= level and math.random(tre.rarity) == 1 then
inv:add_item('main', tre.name)

View file

@ -9,9 +9,6 @@ function minetest.is_protected(pos, name)
end
local node = get_node_or_nil(pos)
if node and get_item_group(node.name, "dungeon") ~= 0 then
return true
end
if node and node.name == 'fun_caves:translocator' and (name == '' or not minetest.get_player_by_name(name)) then
return true
end