From 2bdb1e2a3258c0f100b5f35b797adf7bcc4e1ed4 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 1 Dec 2015 00:58:52 +0000 Subject: [PATCH] Add indestructible floor to ctf_team_base --- mods/ctf_barrier/init.lua | 20 ++++++++----- mods/ctf_pvp_engine | 2 +- .../depends.txt | 1 + .../init.lua | 27 ++++++++++++++---- .../textures/default_chest_front_blue.png | Bin .../textures/default_chest_front_red.png | Bin .../textures/default_chest_side_blue.png | Bin .../textures/default_chest_side_red.png | Bin .../textures/default_chest_top_blue.png | Bin .../textures/default_chest_top_red.png | Bin 10 files changed, 37 insertions(+), 13 deletions(-) rename mods/{ctf_team_chest => ctf_team_base}/depends.txt (65%) rename mods/{ctf_team_chest => ctf_team_base}/init.lua (79%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_front_blue.png (100%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_front_red.png (100%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_side_blue.png (100%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_side_red.png (100%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_top_blue.png (100%) rename mods/{ctf_team_chest => ctf_team_base}/textures/default_chest_top_red.png (100%) diff --git a/mods/ctf_barrier/init.lua b/mods/ctf_barrier/init.lua index 36d9756..7a45b5f 100644 --- a/mods/ctf_barrier/init.lua +++ b/mods/ctf_barrier/init.lua @@ -13,6 +13,13 @@ minetest.register_node("ctf_barrier:ind_glass", { 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", { description = "You cheater you!", drawtype = "glasslike", @@ -30,14 +37,13 @@ minetest.register_node("ctf_barrier:ind_glass_red", { sounds = default.node_sound_glass_defaults() }) -local lim = ctf.setting("match.map_reset_limit") -local c_glass = minetest.get_content_id("ctf_barrier:ind_glass") +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_red = minetest.get_content_id("ctf_barrier:ind_glass_red") -local c_water = minetest.get_content_id("default:water_source") -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 r = tonumber(minetest.setting_get("barrier")) +local c_water = minetest.get_content_id("default:water_source") +local c_water_f = minetest.get_content_id("default:water_flowing") +local c_air = minetest.get_content_id("air") +local r = tonumber(minetest.setting_get("barrier")) minetest.register_on_generated(function(minp, maxp, seed) if not ((minp.x <= -r and maxp.x >= -r) or (minp.x <= r and maxp.x >= r) diff --git a/mods/ctf_pvp_engine b/mods/ctf_pvp_engine index 9804ec7..622dcb8 160000 --- a/mods/ctf_pvp_engine +++ b/mods/ctf_pvp_engine @@ -1 +1 @@ -Subproject commit 9804ec7518a5c94108fc19f59e67e7a84fc698a3 +Subproject commit 622dcb8468df885e7111c8b7e1a52999df4058a4 diff --git a/mods/ctf_team_chest/depends.txt b/mods/ctf_team_base/depends.txt similarity index 65% rename from mods/ctf_team_chest/depends.txt rename to mods/ctf_team_base/depends.txt index 38719b3..dcd7be6 100644 --- a/mods/ctf_team_chest/depends.txt +++ b/mods/ctf_team_base/depends.txt @@ -1,3 +1,4 @@ ctf ctf_flag ctf_match +ctf_barrier diff --git a/mods/ctf_team_chest/init.lua b/mods/ctf_team_base/init.lua similarity index 79% rename from mods/ctf_team_chest/init.lua rename to mods/ctf_team_base/init.lua index ca2365b..9d4e099 100644 --- a/mods/ctf_team_chest/init.lua +++ b/mods/ctf_team_base/init.lua @@ -12,7 +12,7 @@ local chest_formspec = local colors = {"red", "blue"} for _, color in pairs(colors) do - minetest.register_node("ctf_team_chest:chest_" .. color, { + minetest.register_node("ctf_team_base:chest_" .. color, { description = "Chest", tiles = { "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 minp.y <= flag.y and maxp.y >= flag.y and 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 if flag.z < 0 then dz = -2 @@ -70,10 +90,7 @@ minetest.register_on_generated(function(minp, maxp, seed) y = flag.y, z = flag.z + dz } - minetest.set_node(pos, chest) - print("Flag " .. dump(flag)) - 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")) diff --git a/mods/ctf_team_chest/textures/default_chest_front_blue.png b/mods/ctf_team_base/textures/default_chest_front_blue.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_front_blue.png rename to mods/ctf_team_base/textures/default_chest_front_blue.png diff --git a/mods/ctf_team_chest/textures/default_chest_front_red.png b/mods/ctf_team_base/textures/default_chest_front_red.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_front_red.png rename to mods/ctf_team_base/textures/default_chest_front_red.png diff --git a/mods/ctf_team_chest/textures/default_chest_side_blue.png b/mods/ctf_team_base/textures/default_chest_side_blue.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_side_blue.png rename to mods/ctf_team_base/textures/default_chest_side_blue.png diff --git a/mods/ctf_team_chest/textures/default_chest_side_red.png b/mods/ctf_team_base/textures/default_chest_side_red.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_side_red.png rename to mods/ctf_team_base/textures/default_chest_side_red.png diff --git a/mods/ctf_team_chest/textures/default_chest_top_blue.png b/mods/ctf_team_base/textures/default_chest_top_blue.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_top_blue.png rename to mods/ctf_team_base/textures/default_chest_top_blue.png diff --git a/mods/ctf_team_chest/textures/default_chest_top_red.png b/mods/ctf_team_base/textures/default_chest_top_red.png similarity index 100% rename from mods/ctf_team_chest/textures/default_chest_top_red.png rename to mods/ctf_team_base/textures/default_chest_top_red.png