diff --git a/mods/ctf/ctf_crafting/init.lua b/mods/ctf/ctf_crafting/init.lua index 6c89bce..cb60e5b 100644 --- a/mods/ctf/ctf_crafting/init.lua +++ b/mods/ctf/ctf_crafting/init.lua @@ -67,7 +67,7 @@ crafting.register_recipe({ -- Wooden plank x4 crafting.register_recipe({ type = "inv", - output = "ctf_team_base:reinforced_cobble", + output = "ctf_map:reinforced_cobble", items = { "default:cobble 4" }, always_known = true, level = 1, diff --git a/mods/ctf/ctf_team_base/api.lua b/mods/ctf/ctf_map/base.lua similarity index 87% rename from mods/ctf/ctf_team_base/api.lua rename to mods/ctf/ctf_map/base.lua index f07d83c..f1405d9 100644 --- a/mods/ctf/ctf_team_base/api.lua +++ b/mods/ctf/ctf_map/base.lua @@ -1,11 +1,9 @@ - -ctf_team_base = {} -function ctf_team_base.place(color, pos) +function ctf_map.place_base(color, pos) -- Spawn ind base for x = pos.x - 2, pos.x + 2 do for z = pos.z - 2, pos.z + 2 do minetest.set_node({ x = x, y = pos.y - 1, z = z}, - {name = "ctf_team_base:ind_cobble"}) + {name = "ctf_map:ind_cobble"}) end end @@ -22,7 +20,7 @@ function ctf_team_base.place(color, pos) end -- Spawn chest - local chest = {name = "ctf_team_base:chest_" .. color} + local chest = {name = "ctf_map:chest_" .. color} local dz = 2 if pos.z < 0 then dz = -2 diff --git a/mods/ctf/ctf_team_base/chest.lua b/mods/ctf/ctf_map/chest.lua similarity index 92% rename from mods/ctf/ctf_team_base/chest.lua rename to mods/ctf/ctf_map/chest.lua index ae33fb3..9d6f484 100644 --- a/mods/ctf/ctf_team_base/chest.lua +++ b/mods/ctf/ctf_map/chest.lua @@ -21,7 +21,7 @@ end local colors = {"red", "blue"} for _, chest_color in pairs(colors) do - minetest.register_node("ctf_team_base:chest_" .. chest_color, { + minetest.register_node("ctf_map:chest_" .. chest_color, { description = "Chest", tiles = { "default_chest_top_" .. chest_color .. ".png", @@ -52,12 +52,12 @@ for _, chest_color in pairs(colors) do local territory_owner = ctf.get_territory_owner(pos) if chest_color ~= territory_owner then if not territory_owner then - ctf.warning("ctf_team_base", "Unowned team chest") + ctf.warning("ctf_map", "Unowned team chest") minetest.set_node(pos, { name = "air" }) return end - ctf.warning("ctf_team_base", "Wrong chest, changing to " .. territory_owner .. " from " .. chest_color) - minetest.set_node(pos, "ctf_team_base:chest_" .. territory_owner) + ctf.warning("ctf_map", "Wrong chest, changing to " .. territory_owner .. " from " .. chest_color) + minetest.set_node(pos, "ctf_map:chest_" .. territory_owner) end local formspec = table.concat({ @@ -75,7 +75,7 @@ for _, chest_color in pairs(colors) do "Try killing an enemy player, or at least attempting to capture the flag.\n" .. "Find resources in chests scattered around the map." formspec = formspec .. "label[1,1;" .. minetest.formspec_escape(msg) .. "]" - minetest.show_formspec(player:get_player_name(), "ctf_team_base:no_access", formspec) + minetest.show_formspec(player:get_player_name(), "ctf_map:no_access", formspec) return end @@ -85,7 +85,7 @@ for _, chest_color in pairs(colors) do formspec = formspec .. "label[0,-0.2;" .. minetest.formspec_escape("Any team member can take from here") .. "]" .. "list[" .. chestinv .. ";main;0,0.3;5,4;]" .. - "background[5,-0.2;3.15,4.7;ctf_team_base_pro_only.png;false]" .. + "background[5,-0.2;3.15,4.7;ctf_map_pro_only.png;false]" .. "list[" .. chestinv .. ";pro;5,0.3;3,4;]" if is_pro then @@ -102,7 +102,7 @@ for _, chest_color in pairs(colors) do "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85) - minetest.show_formspec(player:get_player_name(), "ctf_team_base:chest", formspec) + minetest.show_formspec(player:get_player_name(), "ctf_map:chest", formspec) end, allow_metadata_inventory_move = function(pos, from_list, from_index, diff --git a/mods/ctf/ctf_map/depends.txt b/mods/ctf/ctf_map/depends.txt index 246946f..f824a59 100644 --- a/mods/ctf/ctf_map/depends.txt +++ b/mods/ctf/ctf_map/depends.txt @@ -2,8 +2,8 @@ default ctf_treasure? stairs? wool? -ctf_team_base? ctf? ctf_match? worldedit? irc? +ctf_stats? diff --git a/mods/ctf/ctf_map/init.lua b/mods/ctf/ctf_map/init.lua index e264cf6..1120b58 100644 --- a/mods/ctf/ctf_map/init.lua +++ b/mods/ctf/ctf_map/init.lua @@ -3,9 +3,10 @@ ctf_map = {} dofile(minetest.get_modpath("ctf_map") .. "/nodes.lua") dofile(minetest.get_modpath("ctf_map") .. "/emerge.lua") dofile(minetest.get_modpath("ctf_map") .. "/barrier.lua") - +dofile(minetest.get_modpath("ctf_map") .. "/base.lua") if minetest.get_modpath("ctf") then + dofile(minetest.get_modpath("ctf_map") .. "/chest.lua") dofile(minetest.get_modpath("ctf_map") .. "/schem_map.lua") dofile(minetest.get_modpath("ctf_map") .. "/give_initial_stuff.lua") diff --git a/mods/ctf/ctf_map/maps b/mods/ctf/ctf_map/maps index 1595c65..9e25819 160000 --- a/mods/ctf/ctf_map/maps +++ b/mods/ctf/ctf_map/maps @@ -1 +1 @@ -Subproject commit 1595c6532532daf6745e42865db33f1b7dc1bfd8 +Subproject commit 9e2581925aed31e5572507a0aba8120c18f41fa0 diff --git a/mods/ctf/ctf_map/nodes.lua b/mods/ctf/ctf_map/nodes.lua index d7ebd3f..dafb918 100644 --- a/mods/ctf/ctf_map/nodes.lua +++ b/mods/ctf/ctf_map/nodes.lua @@ -1,3 +1,12 @@ +minetest.register_node("ctf_map:reinforced_cobble", { + description = "Reinforced Cobblestone", + tiles = {"ctf_map_reinforced_cobble.png"}, + is_ground_content = false, + groups = {cracky = 1, stone = 2}, + sounds = default.node_sound_stone_defaults(), +}) + + -- -- Special nodes -- @@ -31,13 +40,6 @@ minetest.register_node("ctf_map:ind_glass", { sounds = default.node_sound_glass_defaults() }) -minetest.register_node("ctf_map:ind_stone", { - description = "Indestructible Stone", - groups = {immortal = 1}, - tiles = {"default_stone.png"}, - is_ground_content = false -}) - minetest.register_node("ctf_map:ind_glass_red", { description = "Indestructible Red Glass", drawtype = "glasslike", @@ -109,7 +111,6 @@ minetest.register_node("ctf_map:mossycobble", { sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("ctf_map:desert_stone", { description = "Indestructible Desert Stone", tiles = {"default_desert_stone.png"}, @@ -761,3 +762,6 @@ for name, nodedef in pairs(minetest.registered_nodes) do minetest.register_node("ctf_map:" .. name:split(":")[2], nodedef) end end + +minetest.register_alias("ctf_map:ind_cobble", "ctf_map:cobble") +minetest.register_alias("ctf_map:ind_stone", "ctf_map:stone") diff --git a/mods/ctf/ctf_map/schem_map.lua b/mods/ctf/ctf_map/schem_map.lua index 3dd9424..e95d11d 100644 --- a/mods/ctf/ctf_map/schem_map.lua +++ b/mods/ctf/ctf_map/schem_map.lua @@ -103,7 +103,7 @@ function ctf_map.place_map(map) assert(res) for _, value in pairs(ctf_map.map.teams) do - ctf_team_base.place(value.color, value.pos) + ctf_map.place_base(value.color, value.pos) end local seed = minetest.get_mapgen_setting("seed") diff --git a/mods/ctf/ctf_team_base/textures/ctf_team_base_pro_only.png b/mods/ctf/ctf_map/textures/ctf_map_pro_only.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/ctf_team_base_pro_only.png rename to mods/ctf/ctf_map/textures/ctf_map_pro_only.png diff --git a/mods/ctf/ctf_team_base/textures/ctf_team_base_reinforced_cobble.png b/mods/ctf/ctf_map/textures/ctf_map_reinforced_cobble.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/ctf_team_base_reinforced_cobble.png rename to mods/ctf/ctf_map/textures/ctf_map_reinforced_cobble.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_front_blue.png b/mods/ctf/ctf_map/textures/default_chest_front_blue.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_front_blue.png rename to mods/ctf/ctf_map/textures/default_chest_front_blue.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_front_red.png b/mods/ctf/ctf_map/textures/default_chest_front_red.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_front_red.png rename to mods/ctf/ctf_map/textures/default_chest_front_red.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_side_blue.png b/mods/ctf/ctf_map/textures/default_chest_side_blue.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_side_blue.png rename to mods/ctf/ctf_map/textures/default_chest_side_blue.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_side_red.png b/mods/ctf/ctf_map/textures/default_chest_side_red.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_side_red.png rename to mods/ctf/ctf_map/textures/default_chest_side_red.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_top_blue.png b/mods/ctf/ctf_map/textures/default_chest_top_blue.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_top_blue.png rename to mods/ctf/ctf_map/textures/default_chest_top_blue.png diff --git a/mods/ctf/ctf_team_base/textures/default_chest_top_red.png b/mods/ctf/ctf_map/textures/default_chest_top_red.png similarity index 100% rename from mods/ctf/ctf_team_base/textures/default_chest_top_red.png rename to mods/ctf/ctf_map/textures/default_chest_top_red.png diff --git a/mods/ctf/ctf_team_base/depends.txt b/mods/ctf/ctf_team_base/depends.txt deleted file mode 100644 index 1882da9..0000000 --- a/mods/ctf/ctf_team_base/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -ctf -ctf_flag -ctf_match -ctf_stats diff --git a/mods/ctf/ctf_team_base/init.lua b/mods/ctf/ctf_team_base/init.lua deleted file mode 100644 index b0484fe..0000000 --- a/mods/ctf/ctf_team_base/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -dofile(minetest.get_modpath("ctf_team_base") .. "/api.lua") -dofile(minetest.get_modpath("ctf_team_base") .. "/chest.lua") -dofile(minetest.get_modpath("ctf_team_base") .. "/nodes.lua") diff --git a/mods/ctf/ctf_team_base/nodes.lua b/mods/ctf/ctf_team_base/nodes.lua deleted file mode 100644 index b2e0cfe..0000000 --- a/mods/ctf/ctf_team_base/nodes.lua +++ /dev/null @@ -1,15 +0,0 @@ -minetest.register_node("ctf_team_base:ind_cobble", { - description = "Cobblestone", - tiles = {"default_cobble.png"}, - is_ground_content = false, - groups = {immortal = 1}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("ctf_team_base:reinforced_cobble", { - description = "Reinforced Cobblestone", - tiles = {"ctf_team_base_reinforced_cobble.png"}, - is_ground_content = false, - groups = {cracky = 1, stone = 2}, - sounds = default.node_sound_stone_defaults(), -})