Add traps to dungeons.
This commit is contained in:
parent
cbf8994755
commit
2f9d41c11e
3 changed files with 19 additions and 8 deletions
6
abms.lua
6
abms.lua
|
@ -391,11 +391,11 @@ minetest.register_abm({
|
|||
|
||||
minetest.register_abm({
|
||||
nodenames = {"fun_caves:dungeon_floor_1"},
|
||||
interval = 20 * time_factor,
|
||||
interval = 10 * time_factor,
|
||||
chance = 250,
|
||||
catch_up = false,
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -453,7 +453,7 @@ minetest.register_abm({
|
|||
minetest.register_abm({
|
||||
nodenames = {"fun_caves:dungeon_floor_1"},
|
||||
interval = 20 * time_factor,
|
||||
chance = 1000,
|
||||
chance = 500,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
if not (pos and node) then
|
||||
|
|
13
dungeon.lua
13
dungeon.lua
|
@ -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 ry == 0 and (cy > 0 or not centered_in) 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
|
||||
data[ivm] = node['fun_caves:dungeon_floor_2']
|
||||
end
|
||||
|
|
|
@ -505,7 +505,7 @@ end
|
|||
|
||||
minetest.register_node("fun_caves:stone_with_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},
|
||||
drop = 'default:diamond',
|
||||
is_ground_content = false,
|
||||
|
@ -588,7 +588,7 @@ end
|
|||
|
||||
minetest.register_node("fun_caves:stone_with_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},
|
||||
drop = 'default:gold_lump',
|
||||
is_ground_content = false,
|
||||
|
@ -731,7 +731,7 @@ end
|
|||
|
||||
minetest.register_node("fun_caves:stone_with_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},
|
||||
drop = 'default:copper_lump',
|
||||
is_ground_content = false,
|
||||
|
@ -777,7 +777,7 @@ minetest.register_abm({
|
|||
-- pit of iron razors?
|
||||
minetest.register_node("fun_caves:stone_with_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},
|
||||
drop = 'default:iron_lump',
|
||||
is_ground_content = false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue