Add indestructible floor to ctf_team_base

This commit is contained in:
rubenwardy 2015-12-01 00:58:52 +00:00
parent 2a07b2d18f
commit 2bdb1e2a32
10 changed files with 37 additions and 13 deletions

View file

@ -13,6 +13,13 @@ minetest.register_node("ctf_barrier:ind_glass", {
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("ctf_barrier:ind_stone", {
description = "Cheater!",
groups = {immortal = 1},
tiles = {"default_stone.png"},
is_ground_content = false
})
minetest.register_node("ctf_barrier:ind_glass_red", { minetest.register_node("ctf_barrier:ind_glass_red", {
description = "You cheater you!", description = "You cheater you!",
drawtype = "glasslike", drawtype = "glasslike",
@ -30,12 +37,11 @@ minetest.register_node("ctf_barrier:ind_glass_red", {
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
local lim = ctf.setting("match.map_reset_limit") local c_stone = minetest.get_content_id("ctf_barrier:ind_stone")
local c_glass = minetest.get_content_id("ctf_barrier:ind_glass") local c_glass = minetest.get_content_id("ctf_barrier:ind_glass")
local c_glass_red = minetest.get_content_id("ctf_barrier:ind_glass_red") local c_glass_red = minetest.get_content_id("ctf_barrier:ind_glass_red")
local c_water = minetest.get_content_id("default:water_source") local c_water = minetest.get_content_id("default:water_source")
local c_water_f = minetest.get_content_id("default:water_flowing") local c_water_f = minetest.get_content_id("default:water_flowing")
local c_stone = minetest.get_content_id("ctf_flag:ind_base")
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local r = tonumber(minetest.setting_get("barrier")) local r = tonumber(minetest.setting_get("barrier"))
minetest.register_on_generated(function(minp, maxp, seed) minetest.register_on_generated(function(minp, maxp, seed)

@ -1 +1 @@
Subproject commit 9804ec7518a5c94108fc19f59e67e7a84fc698a3 Subproject commit 622dcb8468df885e7111c8b7e1a52999df4058a4

View file

@ -1,3 +1,4 @@
ctf ctf
ctf_flag ctf_flag
ctf_match ctf_match
ctf_barrier

View file

@ -12,7 +12,7 @@ local chest_formspec =
local colors = {"red", "blue"} local colors = {"red", "blue"}
for _, color in pairs(colors) do for _, color in pairs(colors) do
minetest.register_node("ctf_team_chest:chest_" .. color, { minetest.register_node("ctf_team_base:chest_" .. color, {
description = "Chest", description = "Chest",
tiles = { tiles = {
"default_chest_top_" .. color .. ".png", "default_chest_top_" .. color .. ".png",
@ -58,8 +58,28 @@ minetest.register_on_generated(function(minp, maxp, seed)
if minp.x <= flag.x and maxp.x >= flag.x and if minp.x <= flag.x and maxp.x >= flag.x and
minp.y <= flag.y and maxp.y >= flag.y and minp.y <= flag.y and maxp.y >= flag.y and
minp.z <= flag.z and maxp.z >= flag.z then minp.z <= flag.z and maxp.z >= flag.z then
-- Spawn ind base
for x = flag.x - 2, flag.x + 2 do
for z = flag.z - 2, flag.z + 2 do
minetest.set_node({ x = x, y = flag.y - 1, z = z},
{name = "ctf_barrier:ind_stone"})
end
end
local chest = {name = "ctf_team_chest:chest_" .. team.data.color} -- Check for trees
for y = flag.y, flag.y + 2 do
for x = flag.x - 3, flag.x + 3 do
for z = flag.z - 3, flag.z + 3 do
local pos = {x=x, y=y, z=z}
if minetest.get_node(pos).name == "default:tree" then
minetest.set_node(pos, {name="air"})
end
end
end
end
-- Spawn chest
local chest = {name = "ctf_team_base:chest_" .. team.data.color}
local dz = 2 local dz = 2
if flag.z < 0 then if flag.z < 0 then
dz = -2 dz = -2
@ -70,10 +90,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
y = flag.y, y = flag.y,
z = flag.z + dz z = flag.z + dz
} }
minetest.set_node(pos, chest) minetest.set_node(pos, chest)
print("Flag " .. dump(flag))
local inv = minetest.get_inventory({type = "node", pos=pos}) local inv = minetest.get_inventory({type = "node", pos=pos})
inv:add_item("main", ItemStack("default:stone 99")) inv:add_item("main", ItemStack("default:stone 99"))
inv:add_item("main", ItemStack("default:stone 99")) inv:add_item("main", ItemStack("default:stone 99"))

View file

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 625 B

View file

Before

Width:  |  Height:  |  Size: 614 B

After

Width:  |  Height:  |  Size: 614 B

View file

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 564 B

View file

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View file

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 593 B

View file

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 587 B