Add traps to dungeons.

This commit is contained in:
Duane 2016-08-04 08:03:00 -05:00
parent cbf8994755
commit 2f9d41c11e
3 changed files with 19 additions and 8 deletions

View file

@ -391,11 +391,11 @@ minetest.register_abm({
minetest.register_abm({ minetest.register_abm({
nodenames = {"fun_caves:dungeon_floor_1"}, nodenames = {"fun_caves:dungeon_floor_1"},
interval = 20 * time_factor, interval = 10 * time_factor,
chance = 250, chance = 250,
catch_up = false, catch_up = false,
action = function(pos, node, aoc, active_object_count_wider) action = function(pos, node, aoc, active_object_count_wider)
if not (pos and node) or active_object_count_wider > 10 then if not (pos and node) or active_object_count_wider > 5 then
return return
end end
@ -453,7 +453,7 @@ minetest.register_abm({
minetest.register_abm({ minetest.register_abm({
nodenames = {"fun_caves:dungeon_floor_1"}, nodenames = {"fun_caves:dungeon_floor_1"},
interval = 20 * time_factor, interval = 20 * time_factor,
chance = 1000, chance = 500,
catch_up = false, catch_up = false,
action = function(pos, node) action = function(pos, node)
if not (pos and node) then if not (pos and node) then

View file

@ -390,7 +390,18 @@ fun_caves.dungeon = function(minp_in, maxp_in, data, p2data, area, node, heightm
if not leave_alone[data[ivm]] then if not leave_alone[data[ivm]] then
if ry == 0 and (cy > 0 or not centered_in) then if ry == 0 and (cy > 0 or not centered_in) then
if content[cx][cy][cz] == 'room' then if content[cx][cy][cz] == 'room' then
data[ivm] = node['fun_caves:dungeon_floor_1'] local r = math.random(5000)
if r == 1 then
data[ivm] = node['fun_caves:stone_with_gold_trap']
elseif r == 2 then
data[ivm] = node['fun_caves:stone_with_coal_trap']
elseif r == 3 then
data[ivm] = node['fun_caves:stone_with_iron_trap']
elseif r == 4 then
data[ivm] = node['fun_caves:stone_with_diamond_trap']
else
data[ivm] = node['fun_caves:dungeon_floor_1']
end
else else
data[ivm] = node['fun_caves:dungeon_floor_2'] data[ivm] = node['fun_caves:dungeon_floor_2']
end end

View file

@ -505,7 +505,7 @@ end
minetest.register_node("fun_caves:stone_with_diamond_trap", { minetest.register_node("fun_caves:stone_with_diamond_trap", {
description = "Diamond Trap", description = "Diamond Trap",
tiles = {"default_cobble.png^default_mineral_diamond.png"}, tiles = {"default_cobble.png^(default_mineral_diamond.png^[colorize:#000000:160)"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:diamond', drop = 'default:diamond',
is_ground_content = false, is_ground_content = false,
@ -588,7 +588,7 @@ end
minetest.register_node("fun_caves:stone_with_gold_trap", { minetest.register_node("fun_caves:stone_with_gold_trap", {
description = "Gold Trap", description = "Gold Trap",
tiles = {"default_cobble.png^default_mineral_gold.png"}, tiles = {"default_cobble.png^(default_mineral_gold.png^[colorize:#000000:160)"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:gold_lump', drop = 'default:gold_lump',
is_ground_content = false, is_ground_content = false,
@ -731,7 +731,7 @@ end
minetest.register_node("fun_caves:stone_with_copper_trap", { minetest.register_node("fun_caves:stone_with_copper_trap", {
description = "Copper Trap", description = "Copper Trap",
tiles = {"default_cobble.png^default_mineral_copper.png"}, tiles = {"default_cobble.png^(default_mineral_copper.png^[colorize:#000000:160)"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:copper_lump', drop = 'default:copper_lump',
is_ground_content = false, is_ground_content = false,
@ -777,7 +777,7 @@ minetest.register_abm({
-- pit of iron razors? -- pit of iron razors?
minetest.register_node("fun_caves:stone_with_iron_trap", { minetest.register_node("fun_caves:stone_with_iron_trap", {
description = "Iron Trap", description = "Iron Trap",
tiles = {"default_cobble.png^default_mineral_iron.png"}, tiles = {"default_cobble.png^(default_mineral_iron.png^[colorize:#000000:160)"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:iron_lump', drop = 'default:iron_lump',
is_ground_content = false, is_ground_content = false,