Compare commits
No commits in common. "c1b3604a97ddd94d6396ae218e556b161de51f30" and "cd355bc9cd846371282e01d495d2c98e6886ff93" have entirely different histories.
c1b3604a97
...
cd355bc9cd
8 changed files with 984 additions and 211 deletions
|
@ -480,11 +480,7 @@ minetest.register_on_punchplayer(function(player, hitter,
|
||||||
|
|
||||||
if to.team == from.team and to.team ~= "" and
|
if to.team == from.team and to.team ~= "" and
|
||||||
to.team ~= nil and to.name ~= from.name then
|
to.team ~= nil and to.name ~= from.name then
|
||||||
hud_event.new(hname, {
|
minetest.chat_send_player(hname, pname .. " is on your team!")
|
||||||
name = "ctf:friendly_fire",
|
|
||||||
color = "warning",
|
|
||||||
value = pname .. " is on your team!",
|
|
||||||
})
|
|
||||||
if not ctf.setting("friendly_fire") then
|
if not ctf.setting("friendly_fire") then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,9 +14,8 @@ end
|
||||||
local function announce_all()
|
local function announce_all()
|
||||||
if bountied_player then
|
if bountied_player then
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local pname = player:get_player_name()
|
if bountied_player ~= player:get_player_name() then
|
||||||
if ctf.player(pname).team ~= ctf.player(bountied_player).team then
|
announce(player:get_player_name())
|
||||||
announce(pname)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -99,11 +99,7 @@ minetest.override_item("ctf_bandages:bandage", {
|
||||||
if ctf.player(pname).team == ctf.player(name).team then
|
if ctf.player(pname).team == ctf.player(name).team then
|
||||||
local nodename = minetest.get_node(object:get_pos()).name
|
local nodename = minetest.get_node(object:get_pos()).name
|
||||||
if ctf_classes.dont_heal[pname] or nodename:find("lava") or nodename:find("water") or nodename:find("trap") then
|
if ctf_classes.dont_heal[pname] or nodename:find("lava") or nodename:find("water") or nodename:find("trap") then
|
||||||
hud_event.new(name, {
|
minetest.chat_send_player(name, "You can't heal player in lava, water or spikes!")
|
||||||
name = "ctf_classes:environment",
|
|
||||||
color = "warning",
|
|
||||||
value = "Can't heal " .. pname .. " in lava, water or spikes!",
|
|
||||||
})
|
|
||||||
return -- Can't heal players in lava/water/spikes
|
return -- Can't heal players in lava/water/spikes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -156,9 +152,8 @@ local function paxel_stop(pname, reason)
|
||||||
hud_event.new(pname, {
|
hud_event.new(pname, {
|
||||||
name = "ctf_classes:paxel_stop",
|
name = "ctf_classes:paxel_stop",
|
||||||
color = "success",
|
color = "success",
|
||||||
value = string.format("Pillar digging stopped. Reason: %s. You can use again in %ds", reason or "unknown", DIG_COOLDOWN),
|
value = table.concat({"Pillar digging stopped", reason, "- wait " .. DIG_COOLDOWN .. "s"}, " "),
|
||||||
})
|
})
|
||||||
|
|
||||||
diggers[pname] = minetest.after(DIG_COOLDOWN, function() diggers[pname] = nil end)
|
diggers[pname] = minetest.after(DIG_COOLDOWN, function() diggers[pname] = nil end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -244,10 +239,10 @@ minetest.register_tool("ctf_classes:paxel_bronze", {
|
||||||
|
|
||||||
if diggers[pname] and diggers[pname] == true and type(diggers[pname]) ~= "table" then
|
if diggers[pname] and diggers[pname] == true and type(diggers[pname]) ~= "table" then
|
||||||
diggers[pname] = 1
|
diggers[pname] = 1
|
||||||
minetest.after(1, function()
|
minetest.after(2, function()
|
||||||
if user and user:get_player_control().RMB then
|
if user and user:get_player_control().RMB then
|
||||||
if diggers[pname] and type(diggers[pname]) ~= "table" then
|
if diggers[pname] and type(diggers[pname]) ~= "table" then
|
||||||
paxel_stop(pname, "Stop requested")
|
paxel_stop(pname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -10,13 +10,11 @@ ctf_events = {
|
||||||
events = {}
|
events = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ctf_events.post(action, one, one_color, two, two_color)
|
function ctf_events.post(action, one, two)
|
||||||
table.insert(ctf_events.events, 1, {
|
table.insert(ctf_events.events, 1, {
|
||||||
action = action,
|
action = action,
|
||||||
one = one,
|
one = one,
|
||||||
one_color = one_color,
|
two = two
|
||||||
two = two,
|
|
||||||
two_color = two_color
|
|
||||||
})
|
})
|
||||||
|
|
||||||
while #ctf_events.events > NUM_EVT do
|
while #ctf_events.events > NUM_EVT do
|
||||||
|
@ -40,16 +38,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
|
||||||
|
|
||||||
-- One
|
-- One
|
||||||
if evt.one then
|
if evt.one then
|
||||||
|
local tcolor = ctf_colors.get_color(ctf.player(evt.one))
|
||||||
if hud:exists(player, idx) then
|
if hud:exists(player, idx) then
|
||||||
hud:change(player, idx, "text", evt.one)
|
hud:change(player, idx, "text", evt.one)
|
||||||
hud:change(player, idx, "number", evt.one_color.hex)
|
hud:change(player, idx, "number", tcolor.hex)
|
||||||
else
|
else
|
||||||
local tmp = {
|
local tmp = {
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 0, y = 0.8},
|
position = {x = 0, y = 0.8},
|
||||||
scale = {x = 200, y = 100},
|
scale = {x = 200, y = 100},
|
||||||
text = evt.one,
|
text = evt.one,
|
||||||
number = evt.one_color.hex,
|
number = tcolor.hex,
|
||||||
offset = {x = 145, y = -y_pos},
|
offset = {x = 145, y = -y_pos},
|
||||||
alignment = {x = -1, y = 0}
|
alignment = {x = -1, y = 0}
|
||||||
}
|
}
|
||||||
|
@ -61,16 +60,17 @@ function ctf_events.update_row(i, player, name, tplayer, evt)
|
||||||
|
|
||||||
-- Two
|
-- Two
|
||||||
if evt.two then
|
if evt.two then
|
||||||
|
local tcolor = ctf_colors.get_color(ctf.player(evt.two))
|
||||||
if hud:exists(player, idx2) then
|
if hud:exists(player, idx2) then
|
||||||
hud:change(player, idx2, "text", evt.two)
|
hud:change(player, idx2, "text", evt.two)
|
||||||
hud:change(player, idx2, "number", evt.two_color.hex)
|
hud:change(player, idx2, "number", tcolor.hex)
|
||||||
else
|
else
|
||||||
local tmp = {
|
local tmp = {
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 0, y = 0.8},
|
position = {x = 0, y = 0.8},
|
||||||
scale = {x = 200, y = 100},
|
scale = {x = 200, y = 100},
|
||||||
text = evt.two,
|
text = evt.two,
|
||||||
number = evt.two_color.hex,
|
number = tcolor.hex,
|
||||||
offset = {x = 175, y = -y_pos},
|
offset = {x = 175, y = -y_pos},
|
||||||
alignment = {x = 1, y = 0}
|
alignment = {x = 1, y = 0}
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,6 @@ function ctf_events.update_all()
|
||||||
end
|
end
|
||||||
|
|
||||||
ctf.register_on_killedplayer(function(victim, killer, stack, tool_caps)
|
ctf.register_on_killedplayer(function(victim, killer, stack, tool_caps)
|
||||||
local victim_color = ctf_colors.get_color(ctf.player(victim))
|
|
||||||
local killer_color = ctf_colors.get_color(ctf.player(killer))
|
|
||||||
|
|
||||||
local type = "sword"
|
local type = "sword"
|
||||||
|
|
||||||
if tool_caps.damage_groups.grenade then
|
if tool_caps.damage_groups.grenade then
|
||||||
|
@ -142,7 +139,7 @@ ctf.register_on_killedplayer(function(victim, killer, stack, tool_caps)
|
||||||
victim = victim .. " (Suicide?)"
|
victim = victim .. " (Suicide?)"
|
||||||
end
|
end
|
||||||
|
|
||||||
ctf_events.post("kill_" .. type, killer, killer_color, victim, victim_color)
|
ctf_events.post("kill_" .. type, killer, victim)
|
||||||
ctf_events.update_all()
|
ctf_events.update_all()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5fe0d7b1fd8aba95cfe0361a333abfa6b00f20a8
|
Subproject commit bbf60077855ee90b95ca68f1b9bc853f7d53ecf2
|
|
@ -76,61 +76,814 @@ do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local mod_prefixes = {
|
-- Indestructible nodes from MTG's default mod
|
||||||
default = "";
|
do
|
||||||
stairs = "";
|
-- Stone
|
||||||
wool = "wool_";
|
|
||||||
}
|
|
||||||
|
|
||||||
local tool_groups = {
|
minetest.register_node(":ctf_map:stone", {
|
||||||
dig_immediate = true
|
description = "Indestructible Stone",
|
||||||
}
|
tiles = {"default_stone.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
local function add_tool_groups(def)
|
minetest.register_node(":ctf_map:cobble", {
|
||||||
local caps = def.tool_capabilities
|
description = "Indestructible Cobblestone",
|
||||||
if not caps then
|
tiles = {"default_cobble.png"},
|
||||||
return
|
is_ground_content = false,
|
||||||
end
|
groups = {immortal = 1},
|
||||||
local groups = caps.groupcaps
|
sounds = default.node_sound_stone_defaults(),
|
||||||
if not groups then
|
})
|
||||||
return
|
|
||||||
end
|
minetest.register_node(":ctf_map:stonebrick", {
|
||||||
for group in pairs(groups) do
|
description = "Indestructible Stone Brick",
|
||||||
tool_groups[group] = true
|
paramtype2 = "facedir",
|
||||||
end
|
place_param2 = 0,
|
||||||
|
tiles = {"default_stone_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_block", {
|
||||||
|
description = "Indestructible Stone Block",
|
||||||
|
tiles = {"default_stone_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:mossycobble", {
|
||||||
|
description = "Indestructible Mossy Cobblestone",
|
||||||
|
tiles = {"default_mossycobble.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_stone", {
|
||||||
|
description = "Indestructible Desert Stone",
|
||||||
|
tiles = {"default_desert_stone.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_cobble", {
|
||||||
|
description = "Indestructible Desert Cobblestone",
|
||||||
|
tiles = {"default_desert_cobble.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_stonebrick", {
|
||||||
|
description = "Indestructible Desert Stone Brick",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_desert_stone_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_stone_block", {
|
||||||
|
description = "Indestructible Desert Stone Block",
|
||||||
|
tiles = {"default_desert_stone_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:sandstone", {
|
||||||
|
description = "Indestructible Sandstone",
|
||||||
|
tiles = {"default_sandstone.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:sandstonebrick", {
|
||||||
|
description = "Indestructible Sandstone Brick",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_sandstone_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:sandstone_block", {
|
||||||
|
description = "Indestructible Sandstone Block",
|
||||||
|
tiles = {"default_sandstone_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_sandstone", {
|
||||||
|
description = "Indestructible Desert Sandstone",
|
||||||
|
tiles = {"default_desert_sandstone.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_sandstone_brick", {
|
||||||
|
description = "Indestructible Desert Sandstone Brick",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_desert_sandstone_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_sandstone_block", {
|
||||||
|
description = "Indestructible Desert Sandstone Block",
|
||||||
|
tiles = {"default_desert_sandstone_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:silver_sandstone", {
|
||||||
|
description = "Indestructible Silver Sandstone",
|
||||||
|
tiles = {"default_silver_sandstone.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:silver_sandstone_brick", {
|
||||||
|
description = "Indestructible Silver Sandstone Brick",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_silver_sandstone_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:silver_sandstone_block", {
|
||||||
|
description = "Indestructible Silver Sandstone Block",
|
||||||
|
tiles = {"default_silver_sandstone_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Soft / Non-Stone
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:dirt", {
|
||||||
|
description = "Indestructible Dirt",
|
||||||
|
tiles = {"default_dirt.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:dirt_with_grass", {
|
||||||
|
description = "Indestructible Dirt with Grass",
|
||||||
|
tiles = {"default_grass.png", "default_dirt.png",
|
||||||
|
{name = "default_dirt.png^default_grass_side.png",
|
||||||
|
tileable_vertical = false}},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:dirt_with_dry_grass", {
|
||||||
|
description = "Indestructible Dirt with Dry Grass",
|
||||||
|
tiles = {"default_dry_grass.png",
|
||||||
|
"default_dirt.png",
|
||||||
|
{name = "default_dirt.png^default_dry_grass_side.png",
|
||||||
|
tileable_vertical = false}},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_grass_footstep", gain = 0.4},
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:dirt_with_snow", {
|
||||||
|
description = "Indestructible Dirt with Snow",
|
||||||
|
tiles = {"default_snow.png", "default_dirt.png",
|
||||||
|
{name = "default_dirt.png^default_snow_side.png",
|
||||||
|
tileable_vertical = false}},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:dirt_with_rainforest_litter", {
|
||||||
|
description = "Indestructible Dirt with Rainforest Litter",
|
||||||
|
tiles = {
|
||||||
|
"default_rainforest_litter.png",
|
||||||
|
"default_dirt.png",
|
||||||
|
{name = "default_dirt.png^default_rainforest_litter_side.png",
|
||||||
|
tileable_vertical = false}
|
||||||
|
},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_grass_footstep", gain = 0.4},
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:sand", {
|
||||||
|
description = "Indestructible Sand",
|
||||||
|
tiles = {"default_sand.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_sand_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:desert_sand", {
|
||||||
|
description = "Indestructible Desert Sand",
|
||||||
|
tiles = {"default_desert_sand.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_sand_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:silver_sand", {
|
||||||
|
description = "Indestructible Silver Sand",
|
||||||
|
tiles = {"default_silver_sand.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_sand_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:gravel", {
|
||||||
|
description = "Indestructible Gravel",
|
||||||
|
tiles = {"default_gravel.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_gravel_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:clay", {
|
||||||
|
description = "Indestructible Clay",
|
||||||
|
tiles = {"default_clay.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:snow", {
|
||||||
|
description = "Indestructible Snow",
|
||||||
|
tiles = {"default_snow.png"},
|
||||||
|
inventory_image = "default_snowball.png",
|
||||||
|
wield_image = "default_snowball.png",
|
||||||
|
paramtype = "light",
|
||||||
|
buildable_to = true,
|
||||||
|
floodable = true,
|
||||||
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||||
|
dig = {name = "default_snow_footstep", gain = 0.2}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:snowblock", {
|
||||||
|
description = "Indestructible Snow Block",
|
||||||
|
tiles = {"default_snow.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_dirt_defaults({
|
||||||
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||||
|
dig = {name = "default_snow_footstep", gain = 0.2}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:ice", {
|
||||||
|
description = "Indestructible Ice",
|
||||||
|
tiles = {"default_ice.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
paramtype = "light",
|
||||||
|
groups = {immortal = 1, slippery = 4},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Trees
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:tree", {
|
||||||
|
description = "Indestructible Tree",
|
||||||
|
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:wood", {
|
||||||
|
description = "Indestructible Wooden Planks",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_wood.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:leaves", {
|
||||||
|
description = "Indestructible Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
waving = 1,
|
||||||
|
tiles = {"default_leaves.png"},
|
||||||
|
special_tiles = {"default_leaves_simple.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:apple", {
|
||||||
|
description = "Indestructible Apple",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {"default_apple.png"},
|
||||||
|
inventory_image = "default_apple.png",
|
||||||
|
stack_max = 99,
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
is_ground_content = false,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
|
||||||
|
},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:papyrus", {
|
||||||
|
description = "Indestructible Papyrus",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {"default_papyrus.png"},
|
||||||
|
inventory_image = "default_papyrus.png",
|
||||||
|
wield_image = "default_papyrus.png",
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
||||||
|
},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_dig_node = function(pos, node, metadata, digger)
|
||||||
|
default.dig_up(pos, node, digger)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:jungletree", {
|
||||||
|
description = "Indestructible Jungle Tree",
|
||||||
|
tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
|
||||||
|
"default_jungletree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:junglewood", {
|
||||||
|
description = "Indestructible Jungle Wood Planks",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_junglewood.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:jungleleaves", {
|
||||||
|
description = "Indestructible Jungle Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
waving = 1,
|
||||||
|
tiles = {"default_jungleleaves.png"},
|
||||||
|
special_tiles = {"default_jungleleaves_simple.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:pine_tree", {
|
||||||
|
description = "Indestructible Pine Tree",
|
||||||
|
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
|
||||||
|
"default_pine_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:pine_wood", {
|
||||||
|
description = "Indestructible Pine Wood Planks",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_pine_wood.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:pine_needles",{
|
||||||
|
description = "Indestructible Pine Needles",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
tiles = {"default_pine_needles.png"},
|
||||||
|
waving = 1,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:acacia_tree", {
|
||||||
|
description = "Indestructible Acacia Tree",
|
||||||
|
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
|
||||||
|
"default_acacia_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:acacia_wood", {
|
||||||
|
description = "Indestructible Acacia Wood Planks",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_acacia_wood.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:acacia_leaves", {
|
||||||
|
description = "Indestructible Acacia Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
tiles = {"default_acacia_leaves.png"},
|
||||||
|
special_tiles = {"default_acacia_leaves_simple.png"},
|
||||||
|
waving = 1,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:aspen_tree", {
|
||||||
|
description = "Indestructible Aspen Tree",
|
||||||
|
tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
|
||||||
|
"default_aspen_tree.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:aspen_wood", {
|
||||||
|
description = "Indestructible Aspen Wood Planks",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_aspen_wood.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:aspen_leaves", {
|
||||||
|
description = "Indestructible Aspen Leaves",
|
||||||
|
drawtype = "allfaces_optional",
|
||||||
|
tiles = {"default_aspen_leaves.png"},
|
||||||
|
waving = 1,
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Ores
|
||||||
|
--
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_coal", {
|
||||||
|
description = "Indestructible Coal Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_coal.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:coalblock", {
|
||||||
|
description = "Indestructible Coal Block",
|
||||||
|
tiles = {"default_coal_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_iron", {
|
||||||
|
description = "Indestructible Iron Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_iron.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_copper", {
|
||||||
|
description = "Indestructible Copper Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_copper.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_tin", {
|
||||||
|
description = "Indestructible Tin Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_tin.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:bronzeblock", {
|
||||||
|
description = "Indestructible Bronze Block",
|
||||||
|
tiles = {"default_bronze_block.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_metal_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_mese", {
|
||||||
|
description = "Indestructible Mese Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_mese.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:mese", {
|
||||||
|
description = "Indestructible Mese Block",
|
||||||
|
tiles = {"default_mese_block.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
light_source = 3,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:stone_with_diamond", {
|
||||||
|
description = "Indestructible Diamond Ore",
|
||||||
|
tiles = {"default_stone.png^default_mineral_diamond.png"},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Plantlife (non-cubic)
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:cactus", {
|
||||||
|
description = "Indestructible Cactus",
|
||||||
|
tiles = {"default_cactus_top.png", "default_cactus_top.png",
|
||||||
|
"default_cactus_side.png"},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = minetest.rotate_node,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:ladder_wood", {
|
||||||
|
description = "Indestructible Wooden Ladder",
|
||||||
|
drawtype = "signlike",
|
||||||
|
tiles = {"default_ladder_wood.png"},
|
||||||
|
inventory_image = "default_ladder_wood.png",
|
||||||
|
wield_image = "default_ladder_wood.png",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
climbable = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
--wall_top = = <default>
|
||||||
|
--wall_bottom = = <default>
|
||||||
|
--wall_side = = <default>
|
||||||
|
},
|
||||||
|
groups = {immortal = 1},
|
||||||
|
legacy_wallmounted = true,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
default.register_fence(":ctf_map:fence_wood", {
|
||||||
|
description = "Indestructible Wooden Fence",
|
||||||
|
texture = "default_fence_wood.png",
|
||||||
|
inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = "ctf_map:wood",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
default.register_fence(":ctf_map:fence_acacia_wood", {
|
||||||
|
description = "Indestructible Acacia Fence",
|
||||||
|
texture = "default_fence_acacia_wood.png",
|
||||||
|
inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = "ctf_map:acacia_wood",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
default.register_fence(":ctf_map:fence_junglewood", {
|
||||||
|
description = "Indestructible Jungle Wood Fence",
|
||||||
|
texture = "default_fence_junglewood.png",
|
||||||
|
inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = "ctf_map:junglewood",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
default.register_fence(":ctf_map:fence_pine_wood", {
|
||||||
|
description = "Indestructible Pine Fence",
|
||||||
|
texture = "default_fence_pine_wood.png",
|
||||||
|
inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = "ctf_map:pine_wood",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
default.register_fence(":ctf_map:fence_aspen_wood", {
|
||||||
|
description = "Indestructible Aspen Fence",
|
||||||
|
texture = "default_fence_aspen_wood.png",
|
||||||
|
inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
|
||||||
|
material = "ctf_map:aspen_wood",
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_wood_defaults()
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:glass", {
|
||||||
|
description = "Indestructible Glass",
|
||||||
|
drawtype = "glasslike_framed_optional",
|
||||||
|
tiles = {"default_glass.png", "default_glass_detail.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "glasslikeliquidlevel",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:brick", {
|
||||||
|
description = "Indestructible Brick Block",
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
place_param2 = 0,
|
||||||
|
tiles = {"default_brick.png"},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:meselamp", {
|
||||||
|
description = "Indestructible Mese Lamp",
|
||||||
|
drawtype = "glasslike",
|
||||||
|
tiles = {"default_meselamp.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {immortal = 1},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
light_source = default.LIGHT_MAX,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, def in pairs(minetest.registered_tools) do
|
-- Indestructible torches from MTG's default mod
|
||||||
add_tool_groups(def)
|
do
|
||||||
|
minetest.register_node(":ctf_map:torch", {
|
||||||
|
description = "Torch",
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "torch_floor.obj",
|
||||||
|
inventory_image = "default_torch_on_floor.png",
|
||||||
|
wield_image = "default_torch_on_floor.png",
|
||||||
|
tiles = {{
|
||||||
|
name = "default_torch_on_floor_animated.png",
|
||||||
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
|
}},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
liquids_pointable = false,
|
||||||
|
light_source = 12,
|
||||||
|
groups = {attached_node = 1, torch = 1},
|
||||||
|
drop = "ctf_map:torch",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local under = pointed_thing.under
|
||||||
|
local node = minetest.get_node(under)
|
||||||
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
if def and def.on_rightclick and
|
||||||
|
not (placer and placer:is_player() and
|
||||||
|
placer:get_player_control().sneak) then
|
||||||
|
return def.on_rightclick(under, node, placer, itemstack,
|
||||||
|
pointed_thing) or itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local above = pointed_thing.above
|
||||||
|
local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
|
||||||
|
local fakestack = itemstack
|
||||||
|
if wdir == 0 then
|
||||||
|
fakestack:set_name(":ctf_map:torch_ceiling")
|
||||||
|
elseif wdir == 1 then
|
||||||
|
fakestack:set_name(":ctf_map:torch")
|
||||||
|
else
|
||||||
|
fakestack:set_name(":ctf_map:torch_wall")
|
||||||
|
end
|
||||||
|
|
||||||
|
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
|
||||||
|
itemstack:set_name(":ctf_map:torch")
|
||||||
|
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:torch_wall", {
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "torch_wall.obj",
|
||||||
|
tiles = {{
|
||||||
|
name = "default_torch_on_floor_animated.png",
|
||||||
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
|
}},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
light_source = 12,
|
||||||
|
groups = {not_in_creative_inventory = 1, attached_node = 1, torch = 1},
|
||||||
|
drop = "ctf_map:torch",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":ctf_map:torch_ceiling", {
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "torch_ceiling.obj",
|
||||||
|
tiles = {{
|
||||||
|
name = "default_torch_on_floor_animated.png",
|
||||||
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
|
}},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
light_source = 12,
|
||||||
|
groups = {immortal = 1, not_in_creative_inventory = 1, attached_node = 1, torch = 1},
|
||||||
|
drop = "ctf_map:torch",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8},
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add hand groups
|
-- Register indestructible variants of nodes from MTGs' stairs and wool mods
|
||||||
add_tool_groups(minetest.registered_items[""])
|
do
|
||||||
|
local nodes = table.copy(minetest.registered_nodes)
|
||||||
local function make_immortal(def)
|
for name, nodedef in pairs(nodes) do
|
||||||
for group in pairs(tool_groups) do
|
if name:find("stairs") then
|
||||||
def.groups[group] = nil
|
nodedef = table.copy(nodedef)
|
||||||
end
|
if nodedef.description then
|
||||||
def.groups.immortal = 1
|
nodedef.description = "Indestructible " .. nodedef.description
|
||||||
def.floodable = false
|
end
|
||||||
def.buildable_to = false
|
nodedef.groups = {immortal = 1}
|
||||||
def.description = def.description and ("Indestructible " .. def.description)
|
minetest.register_node(":ctf_map:" .. name:split(":")[2], nodedef)
|
||||||
end
|
elseif name:find("wool") then
|
||||||
|
local color = name:split(":")[2]
|
||||||
local registered_nodes = table.copy(minetest.registered_nodes)
|
nodedef = table.copy(nodedef)
|
||||||
for name, def in pairs(registered_nodes) do
|
if nodedef.description then
|
||||||
local mod, nodename = name:match"(..-):(.+)"
|
nodedef.description = "Indestructible " .. nodedef.description
|
||||||
local prefix = mod_prefixes[mod]
|
end
|
||||||
if nodename and prefix and not (def.groups and def.groups.mortal) then
|
nodedef.groups = {immortal = 1}
|
||||||
-- HACK to preserve backwards compatibility
|
minetest.register_node(":ctf_map:wool_" .. color, nodedef)
|
||||||
local new_name = ":ctf_map:" .. prefix .. nodename
|
minetest.register_alias("ctf_map:" .. color, "ctf_map:wool_" .. color)
|
||||||
if def.drop == name then
|
|
||||||
def.drop = new_name
|
|
||||||
end
|
|
||||||
make_immortal(def)
|
|
||||||
minetest.register_node(new_name, def)
|
|
||||||
if mod == "wool" then
|
|
||||||
minetest.register_alias("ctf_map:" .. nodename, new_name)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,88 +13,105 @@ local function on_flood(pos, oldnode, newnode)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local torch_suffix = {[0] = "_ceiling", "", "_wall", "_wall", "_wall", "_wall"}
|
minetest.register_node("default:torch", {
|
||||||
function default.torch_on_place(itemstack, placer, pointed_thing)
|
description = "Torch",
|
||||||
local under = pointed_thing.under
|
drawtype = "mesh",
|
||||||
local node = minetest.get_node(under)
|
mesh = "torch_floor.obj",
|
||||||
local nodedef = minetest.registered_nodes[node.name]
|
inventory_image = "default_torch_on_floor.png",
|
||||||
if nodedef and nodedef.on_rightclick and
|
wield_image = "default_torch_on_floor.png",
|
||||||
not (placer and placer:is_player() and
|
tiles = {{
|
||||||
placer:get_player_control().sneak) then
|
name = "default_torch_on_floor_animated.png",
|
||||||
return nodedef.on_rightclick(under, node, placer, itemstack,
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
pointed_thing) or itemstack
|
}},
|
||||||
end
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
local above = pointed_thing.above
|
sunlight_propagates = true,
|
||||||
local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
|
walkable = false,
|
||||||
local name = itemstack:get_name()
|
liquids_pointable = false,
|
||||||
itemstack:set_name(name .. torch_suffix[wdir])
|
light_source = 12,
|
||||||
itemstack = minetest.item_place(itemstack, placer, pointed_thing, wdir)
|
groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1},
|
||||||
itemstack:set_name(name)
|
drop = "default:torch",
|
||||||
return itemstack
|
selection_box = {
|
||||||
end
|
type = "wallmounted",
|
||||||
|
wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
|
||||||
function default.register_torch(name, defs)
|
|
||||||
local def = defs.floor
|
|
||||||
def.drop = def.drop or name
|
|
||||||
def.on_place = def.on_place or default.torch_on_place
|
|
||||||
minetest.register_node(":" .. name, def)
|
|
||||||
local def_ceiling = table.copy(def)
|
|
||||||
for key, value in pairs(defs.ceiling) do
|
|
||||||
def_ceiling[key] = value
|
|
||||||
end
|
|
||||||
def_ceiling.groups.not_in_creative_inventory = 1
|
|
||||||
minetest.register_node(":" .. name .. "_ceiling", def_ceiling)
|
|
||||||
local def_wall = table.copy(def)
|
|
||||||
for key, value in pairs(defs.wall) do
|
|
||||||
def_wall[key] = value
|
|
||||||
end
|
|
||||||
def_wall.groups.not_in_creative_inventory = 1
|
|
||||||
minetest.register_node(":" .. name .. "_wall", def_wall)
|
|
||||||
end
|
|
||||||
|
|
||||||
default.torch = {
|
|
||||||
floor = {
|
|
||||||
description = "Torch",
|
|
||||||
drawtype = "mesh",
|
|
||||||
mesh = "torch_floor.obj",
|
|
||||||
inventory_image = "default_torch_on_floor.png",
|
|
||||||
wield_image = "default_torch_on_floor.png",
|
|
||||||
tiles = {{
|
|
||||||
name = "default_torch_on_floor_animated.png",
|
|
||||||
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
|
||||||
}},
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "wallmounted",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
walkable = false,
|
|
||||||
liquids_pointable = false,
|
|
||||||
light_source = 12,
|
|
||||||
groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1},
|
|
||||||
selection_box = {
|
|
||||||
type = "wallmounted",
|
|
||||||
wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
|
|
||||||
},
|
|
||||||
sounds = default.node_sound_wood_defaults(),
|
|
||||||
floodable = true,
|
|
||||||
on_flood = on_flood,
|
|
||||||
},
|
},
|
||||||
ceiling = {
|
sounds = default.node_sound_wood_defaults(),
|
||||||
mesh = "torch_ceiling.obj",
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
selection_box = {
|
local under = pointed_thing.under
|
||||||
type = "wallmounted",
|
local node = minetest.get_node(under)
|
||||||
wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8},
|
local def = minetest.registered_nodes[node.name]
|
||||||
},
|
if def and def.on_rightclick and
|
||||||
|
not (placer and placer:is_player() and
|
||||||
|
placer:get_player_control().sneak) then
|
||||||
|
return def.on_rightclick(under, node, placer, itemstack,
|
||||||
|
pointed_thing) or itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local above = pointed_thing.above
|
||||||
|
local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
|
||||||
|
local fakestack = itemstack
|
||||||
|
if wdir == 0 then
|
||||||
|
fakestack:set_name("default:torch_ceiling")
|
||||||
|
elseif wdir == 1 then
|
||||||
|
fakestack:set_name("default:torch")
|
||||||
|
else
|
||||||
|
fakestack:set_name("default:torch_wall")
|
||||||
|
end
|
||||||
|
|
||||||
|
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
|
||||||
|
itemstack:set_name("default:torch")
|
||||||
|
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
floodable = true,
|
||||||
|
on_flood = on_flood,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("default:torch_wall", {
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "torch_wall.obj",
|
||||||
|
tiles = {{
|
||||||
|
name = "default_torch_on_floor_animated.png",
|
||||||
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
|
}},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
light_source = 12,
|
||||||
|
groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1},
|
||||||
|
drop = "default:torch",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
|
||||||
},
|
},
|
||||||
wall = {
|
sounds = default.node_sound_wood_defaults(),
|
||||||
mesh = "torch_wall.obj",
|
floodable = true,
|
||||||
selection_box = {
|
on_flood = on_flood,
|
||||||
type = "wallmounted",
|
})
|
||||||
wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
|
|
||||||
},
|
minetest.register_node("default:torch_ceiling", {
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "torch_ceiling.obj",
|
||||||
|
tiles = {{
|
||||||
|
name = "default_torch_on_floor_animated.png",
|
||||||
|
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
|
||||||
|
}},
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
light_source = 12,
|
||||||
|
groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1},
|
||||||
|
drop = "default:torch",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8},
|
||||||
},
|
},
|
||||||
}
|
sounds = default.node_sound_wood_defaults(),
|
||||||
default.register_torch("default:torch", default.torch)
|
floodable = true,
|
||||||
|
on_flood = on_flood,
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
name = "default:3dtorch",
|
name = "default:3dtorch",
|
||||||
|
|
|
@ -15,7 +15,18 @@ ctf.register_on_attack(function(player, hitter,
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
local hname = hitter:get_player_name()
|
local hname = hitter:get_player_name()
|
||||||
|
|
||||||
if pname == hname then
|
local hp = player:get_hp() - damage
|
||||||
|
if hp <= 0 then
|
||||||
|
if potential_cowards[pname] then
|
||||||
|
player:hud_remove(potential_cowards[pname].hud or 0)
|
||||||
|
potential_cowards[pname] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if potential_cowards[hname] and potential_cowards[hname].puncher == pname then
|
||||||
|
hitter:hud_remove(potential_cowards[hname].hud or 0)
|
||||||
|
potential_cowards[hname] = nil
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,63 +49,55 @@ ctf.register_on_attack(function(player, hitter,
|
||||||
|
|
||||||
potential_cowards[pname].timer = 0
|
potential_cowards[pname].timer = 0
|
||||||
potential_cowards[pname].puncher = hname
|
potential_cowards[pname].puncher = hname
|
||||||
potential_cowards[pname].wielded_item = hitter:get_wielded_item()
|
|
||||||
potential_cowards[pname].toolcaps = tool_capabilities
|
potential_cowards[pname].toolcaps = tool_capabilities
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ctf.register_on_killedplayer(function(victim, killer, _, toolcaps)
|
|
||||||
if toolcaps.damage_groups.combat_log or toolcaps.damage_groups.suicide then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if victim ~= killer and potential_cowards[victim] then -- if player is killed then killer is already awarded
|
|
||||||
local player = minetest.get_player_by_name(victim)
|
|
||||||
if player then
|
|
||||||
player:hud_remove(potential_cowards[victim].hud or 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
potential_cowards[victim] = nil
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function handle_leave_or_die(pname, leave)
|
|
||||||
if potential_cowards[pname] then
|
|
||||||
local hname = potential_cowards[pname].puncher
|
|
||||||
|
|
||||||
if leave then
|
|
||||||
potential_cowards[pname].toolcaps.damage_groups.combat_log = 1
|
|
||||||
else
|
|
||||||
potential_cowards[pname].toolcaps.damage_groups.suicide = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, #ctf.registered_on_killedplayer do
|
|
||||||
ctf.registered_on_killedplayer[i](
|
|
||||||
pname,
|
|
||||||
hname,
|
|
||||||
potential_cowards[pname].wielded_item,
|
|
||||||
potential_cowards[pname].toolcaps
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for victim in pairs(potential_cowards) do
|
|
||||||
if potential_cowards[victim].puncher == pname then
|
|
||||||
local victimobj = minetest.get_player_by_name(victim)
|
|
||||||
|
|
||||||
if victimobj then
|
|
||||||
victimobj:hud_remove(potential_cowards[victim].hud or 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
potential_cowards[victim] = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player, reason)
|
minetest.register_on_dieplayer(function(player, reason)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
|
|
||||||
handle_leave_or_die(pname, false)
|
if reason.type == "node_damage" or reason.type == "drown" or reason.type == "fall" then
|
||||||
|
if potential_cowards[pname] then
|
||||||
|
local hname = potential_cowards[pname].puncher
|
||||||
|
local last_attacker = minetest.get_player_by_name(hname)
|
||||||
|
|
||||||
|
if not last_attacker then
|
||||||
|
player:hud_remove(potential_cowards[pname].hud or 0)
|
||||||
|
potential_cowards[pname] = nil
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
potential_cowards[pname].toolcaps.damage_groups.suicide = 1
|
||||||
|
|
||||||
|
for i = 1, #ctf.registered_on_killedplayer do
|
||||||
|
ctf.registered_on_killedplayer[i](
|
||||||
|
pname,
|
||||||
|
hname,
|
||||||
|
last_attacker:get_wielded_item(),
|
||||||
|
potential_cowards[pname].toolcaps
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
if potential_cowards[hname] and potential_cowards[hname].puncher == pname then
|
||||||
|
last_attacker:hud_remove(potential_cowards[hname].hud or 0)
|
||||||
|
potential_cowards[hname] = nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for victim in pairs(potential_cowards) do
|
||||||
|
if potential_cowards[victim].puncher == pname then
|
||||||
|
local victimobj = minetest.get_player_by_name(victim)
|
||||||
|
|
||||||
|
if victimobj then
|
||||||
|
victimobj:hud_remove(potential_cowards[victim].hud or 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
potential_cowards[victim] = nil
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if potential_cowards[pname] then
|
if potential_cowards[pname] then
|
||||||
player:hud_remove(potential_cowards[pname].hud or 0)
|
player:hud_remove(potential_cowards[pname].hud or 0)
|
||||||
|
@ -106,9 +109,22 @@ minetest.register_on_leaveplayer(function(player, timeout)
|
||||||
if timeout == true then return end
|
if timeout == true then return end
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
|
|
||||||
handle_leave_or_die(pname, true)
|
|
||||||
|
|
||||||
if potential_cowards[pname] then
|
if potential_cowards[pname] then
|
||||||
|
local last_attacker = minetest.get_player_by_name(potential_cowards[pname].puncher)
|
||||||
|
|
||||||
|
if not last_attacker then return end
|
||||||
|
|
||||||
|
potential_cowards[pname].toolcaps.damage_groups.combat_log = 1
|
||||||
|
|
||||||
|
for i = 1, #ctf.registered_on_killedplayer do
|
||||||
|
ctf.registered_on_killedplayer[i](
|
||||||
|
pname,
|
||||||
|
potential_cowards[pname].puncher,
|
||||||
|
last_attacker:get_wielded_item(),
|
||||||
|
potential_cowards[pname].toolcaps
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
local main, match = ctf_stats.player(pname)
|
local main, match = ctf_stats.player(pname)
|
||||||
|
|
||||||
if main and match then
|
if main and match then
|
||||||
|
|
Loading…
Reference in a new issue