Merge ctf_team_base into ctf_map

This commit is contained in:
rubenwardy 2019-03-17 01:36:15 +00:00 committed by GitHub
parent 5643fdf802
commit 762682ea80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 28 additions and 47 deletions

View file

@ -67,7 +67,7 @@ crafting.register_recipe({
-- Wooden plank x4 -- Wooden plank x4
crafting.register_recipe({ crafting.register_recipe({
type = "inv", type = "inv",
output = "ctf_team_base:reinforced_cobble", output = "ctf_map:reinforced_cobble",
items = { "default:cobble 4" }, items = { "default:cobble 4" },
always_known = true, always_known = true,
level = 1, level = 1,

View file

@ -1,11 +1,9 @@
function ctf_map.place_base(color, pos)
ctf_team_base = {}
function ctf_team_base.place(color, pos)
-- Spawn ind base -- Spawn ind base
for x = pos.x - 2, pos.x + 2 do for x = pos.x - 2, pos.x + 2 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
minetest.set_node({ x = x, y = pos.y - 1, z = z}, minetest.set_node({ x = x, y = pos.y - 1, z = z},
{name = "ctf_team_base:ind_cobble"}) {name = "ctf_map:ind_cobble"})
end end
end end
@ -22,7 +20,7 @@ function ctf_team_base.place(color, pos)
end end
-- Spawn chest -- Spawn chest
local chest = {name = "ctf_team_base:chest_" .. color} local chest = {name = "ctf_map:chest_" .. color}
local dz = 2 local dz = 2
if pos.z < 0 then if pos.z < 0 then
dz = -2 dz = -2

View file

@ -21,7 +21,7 @@ end
local colors = {"red", "blue"} local colors = {"red", "blue"}
for _, chest_color in pairs(colors) do 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", description = "Chest",
tiles = { tiles = {
"default_chest_top_" .. chest_color .. ".png", "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) local territory_owner = ctf.get_territory_owner(pos)
if chest_color ~= territory_owner then if chest_color ~= territory_owner then
if not 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" }) minetest.set_node(pos, { name = "air" })
return return
end end
ctf.warning("ctf_team_base", "Wrong chest, changing to " .. territory_owner .. " from " .. chest_color) ctf.warning("ctf_map", "Wrong chest, changing to " .. territory_owner .. " from " .. chest_color)
minetest.set_node(pos, "ctf_team_base:chest_" .. territory_owner) minetest.set_node(pos, "ctf_map:chest_" .. territory_owner)
end end
local formspec = table.concat({ 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" .. "Try killing an enemy player, or at least attempting to capture the flag.\n" ..
"Find resources in chests scattered around the map." "Find resources in chests scattered around the map."
formspec = formspec .. "label[1,1;" .. minetest.formspec_escape(msg) .. "]" 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 return
end end
@ -85,7 +85,7 @@ for _, chest_color in pairs(colors) do
formspec = formspec .. formspec = formspec ..
"label[0,-0.2;" .. minetest.formspec_escape("Any team member can take from here") .. "]" .. "label[0,-0.2;" .. minetest.formspec_escape("Any team member can take from here") .. "]" ..
"list[" .. chestinv .. ";main;0,0.3;5,4;]" .. "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;]" "list[" .. chestinv .. ";pro;5,0.3;3,4;]"
if is_pro then if is_pro then
@ -102,7 +102,7 @@ for _, chest_color in pairs(colors) do
"listring[current_player;main]" .. "listring[current_player;main]" ..
default.get_hotbar_bg(0,4.85) 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, end,
allow_metadata_inventory_move = function(pos, from_list, from_index, allow_metadata_inventory_move = function(pos, from_list, from_index,

View file

@ -2,8 +2,8 @@ default
ctf_treasure? ctf_treasure?
stairs? stairs?
wool? wool?
ctf_team_base?
ctf? ctf?
ctf_match? ctf_match?
worldedit? worldedit?
irc? irc?
ctf_stats?

View file

@ -3,9 +3,10 @@ ctf_map = {}
dofile(minetest.get_modpath("ctf_map") .. "/nodes.lua") dofile(minetest.get_modpath("ctf_map") .. "/nodes.lua")
dofile(minetest.get_modpath("ctf_map") .. "/emerge.lua") dofile(minetest.get_modpath("ctf_map") .. "/emerge.lua")
dofile(minetest.get_modpath("ctf_map") .. "/barrier.lua") dofile(minetest.get_modpath("ctf_map") .. "/barrier.lua")
dofile(minetest.get_modpath("ctf_map") .. "/base.lua")
if minetest.get_modpath("ctf") then 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") .. "/schem_map.lua")
dofile(minetest.get_modpath("ctf_map") .. "/give_initial_stuff.lua") dofile(minetest.get_modpath("ctf_map") .. "/give_initial_stuff.lua")

@ -1 +1 @@
Subproject commit 1595c6532532daf6745e42865db33f1b7dc1bfd8 Subproject commit 9e2581925aed31e5572507a0aba8120c18f41fa0

View file

@ -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 -- Special nodes
-- --
@ -31,13 +40,6 @@ minetest.register_node("ctf_map:ind_glass", {
sounds = default.node_sound_glass_defaults() 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", { minetest.register_node("ctf_map:ind_glass_red", {
description = "Indestructible Red Glass", description = "Indestructible Red Glass",
drawtype = "glasslike", drawtype = "glasslike",
@ -109,7 +111,6 @@ minetest.register_node("ctf_map:mossycobble", {
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("ctf_map:desert_stone", { minetest.register_node("ctf_map:desert_stone", {
description = "Indestructible Desert Stone", description = "Indestructible Desert Stone",
tiles = {"default_desert_stone.png"}, 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) minetest.register_node("ctf_map:" .. name:split(":")[2], nodedef)
end end
end end
minetest.register_alias("ctf_map:ind_cobble", "ctf_map:cobble")
minetest.register_alias("ctf_map:ind_stone", "ctf_map:stone")

View file

@ -103,7 +103,7 @@ function ctf_map.place_map(map)
assert(res) assert(res)
for _, value in pairs(ctf_map.map.teams) do 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 end
local seed = minetest.get_mapgen_setting("seed") local seed = minetest.get_mapgen_setting("seed")

View file

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View file

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

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

View file

@ -1,4 +0,0 @@
ctf
ctf_flag
ctf_match
ctf_stats

View file

@ -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")

View file

@ -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(),
})