This commit is contained in:
philipmi 2021-03-15 09:47:38 +01:00
commit 62e0fe449e
5 changed files with 211 additions and 7 deletions

View file

@ -29,12 +29,12 @@ end, true)
local sword_special_timer = {}
local SWORD_SPECIAL_COOLDOWN = 40
local SWORD_SPECIAL_COOLDOWN = 20
local function sword_special_timer_func(pname, timeleft)
sword_special_timer[pname] = timeleft
if timeleft - 10 >= 0 then
minetest.after(10, sword_special_timer_func, pname, timeleft - 10)
if timeleft - 2 >= 0 then
minetest.after(2, sword_special_timer_func, pname, timeleft - 2)
else
sword_special_timer[pname] = nil
end
@ -57,8 +57,8 @@ minetest.register_tool("ctf_classes:sword_bronze", {
local pname = placer:get_player_name()
if not pointed_thing then return end
if sword_special_timer[pname] then
minetest.chat_send_player(pname, "You can't place a marker yet (>"..sword_special_timer[pname].."s left)")
if sword_special_timer[pname] and placer:get_player_control().sneak then
minetest.chat_send_player(pname, "You have to wait "..sword_special_timer[pname].."s to place marker again")
if pointed_thing.type == "node" then
return minetest.item_place(itemstack, placer, pointed_thing)
@ -102,8 +102,8 @@ minetest.register_tool("ctf_classes:sword_bronze", {
-- Check if player is sneaking before placing marker
if not placer:get_player_control().sneak then return end
sword_special_timer[pname] = 20
sword_special_timer_func(pname, 20)
sword_special_timer[pname] = 4
sword_special_timer_func(pname, 4)
minetest.registered_chatcommands["m"].func(pname, "placed with sword")
end,

View file

@ -424,6 +424,25 @@ do
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",