diff --git a/mods/ctf/ctf_classes/medic.lua b/mods/ctf/ctf_classes/medic.lua index 7a198a5..de07c13 100644 --- a/mods/ctf/ctf_classes/medic.lua +++ b/mods/ctf/ctf_classes/medic.lua @@ -138,7 +138,7 @@ minetest.override_item("ctf_bandages:bandage", { local diggers = {} local DIG_COOLDOWN = 30 -local DIG_DIST_LIMIT = 50 +local DIG_DIST_LIMIT = 10 local DIG_SPEED = 0.1 local function isdiggable(name) @@ -171,7 +171,10 @@ local function remove_pillar(pos, pname) minetest.dig_node(pos) if player and diggers[pname] and type(diggers[pname]) ~= "table" then - if vector.distance(player:get_pos(), pos) <= DIG_DIST_LIMIT then + local distance = vector.subtract(player:get_pos(), pos) + -- Ignore vertical distance + distance.y = 0 + if vector.length(distance) <= DIG_DIST_LIMIT then pos.y = pos.y + 1 minetest.after(DIG_SPEED, remove_pillar, pos, pname) else diff --git a/mods/ctf/ctf_map/ctf_map_core/schem_map.lua b/mods/ctf/ctf_map/ctf_map_core/schem_map.lua index 2286a0c..e48cb18 100644 --- a/mods/ctf/ctf_map/ctf_map_core/schem_map.lua +++ b/mods/ctf/ctf_map/ctf_map_core/schem_map.lua @@ -277,15 +277,14 @@ local function select_map() end else -- Choose next map index, but don't select the same one again - if ctf_map.map then - idx = math.random(#ctf_map.available_maps - 1) + if ctf_map.map and #ctf_map.available_maps > 1 then + idx = math.random(1, #ctf_map.available_maps - 1) if idx >= ctf_map.map.idx then idx = idx + 1 end else - idx = math.random(#ctf_map.available_maps) + idx = math.random(1, #ctf_map.available_maps) end - ctf_map.next_idx = (idx % #ctf_map.available_maps) + 1 end return idx end diff --git a/mods/other/random_messages/init.lua b/mods/other/random_messages/init.lua index fa28205..78935f3 100644 --- a/mods/other/random_messages/init.lua +++ b/mods/other/random_messages/init.lua @@ -52,11 +52,11 @@ function random_messages.read_messages() "Use medkits to gradually restore your health.", "Moving or fighting while using medkits will interrupt the healing process.", "Knights have a slight damage bonus (up to 1.5 hp) when attacking with swords.", - "Gain more score by killing more than you die, by healing teammates as a medic, or by capturing the flag.", + "Gain more score by killing enemies, healing teammates as a medic, or by capturing the flag.", "You gain more score the better the opponent you defeat.", "Find weapons in chests or mine and use furnaces to make stronger swords.", "Players are immune to attack for 5 seconds after they respawn.", - "Access the pro section of the chest by achieving a 10k+ score and either killing 3 people for every 2 deaths and capture the flag 10 times or killing as many people as you die, capturing the flag on every 3rd attempt and at least 30 times.", + "Access the pro section of the chest by achieving a 10k+ score and either killing 3 people for every 2 deaths and capturing the flag 10 times or killing as many people as you die, capturing the flag on every 3rd attempt and at least 30 times.", "Use team doors (steel) to stop the enemy walking into your base.", "Craft 6 cobbles and 1 steel ingot together to make reinforced cobble.", "Sprint by pressing the fast key (E) when you have stamina.", @@ -80,6 +80,7 @@ function random_messages.read_messages() "Hitting your enemy does more damage than not hitting them.", "Press right mouse button or double-tap the screen to activate scope while wielding a sniper rifle.", "Medics can dig pillars by right clicking the base of one with their paxel.", + "Use `/help all` to see all available commands.", } end diff --git a/mods/other/sprint/init.lua b/mods/other/sprint/init.lua index 0737339..f3d7f16 100644 --- a/mods/other/sprint/init.lua +++ b/mods/other/sprint/init.lua @@ -36,6 +36,13 @@ local function setSprinting(player, info, sprinting) end end +ctf_match.register_on_new_match(function() + for pname in pairs(players) do + local player = minetest.get_player_by_name(pname) + players[player:get_player_name()].stamina = STAMINA_MAX + end +end) + minetest.register_globalstep(function(dtime) for name, info in pairs(players) do local player = minetest.get_player_by_name(name) diff --git a/mods/other/sprint/mod.conf b/mods/other/sprint/mod.conf index 995b058..e58b0f1 100644 --- a/mods/other/sprint/mod.conf +++ b/mods/other/sprint/mod.conf @@ -1,3 +1,3 @@ name = sprint -depends = medkits, physics +depends = medkits, physics, ctf_match optional_depends = hudbars