Skip to content

Commit

Permalink
Merge branch 'master' into streak
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqkz authored May 29, 2024
2 parents f77d978 + 2837285 commit 51b06de
Show file tree
Hide file tree
Showing 17 changed files with 252 additions and 67 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/build.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Luacheck
uses: lunarmodules/luacheck@master
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Note that this version may be slightly behind the git version, but it will be a
* If you use Visual Studio Code we recommend these extensions:
* https://marketplace.visualstudio.com/items?itemName=sumneko.lua
* https://marketplace.visualstudio.com/items?itemName=dwenegar.vscode-luacheck
* https://marketplace.visualstudio.com/items?itemName=GreenXenith.minetest-tools

## License

Expand Down
5 changes: 2 additions & 3 deletions mods/ctf/ctf_modebase/mode_vote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ function ctf_modebase.mode_vote.start_vote()
timer = minetest.after(VOTING_TIME, ctf_modebase.mode_vote.end_vote)
formspec_send_timer = minetest.after(2, send_formspec)
else
ctf_modebase.current_mode_matches = mode_defined_rounds
ctf_modebase.mode_on_next_match = new_mode
ctf_modebase.start_match_after_vote()
votes = {mode_defined_rounds}
ctf_modebase.mode_vote.end_vote()
end
end

Expand Down
28 changes: 15 additions & 13 deletions mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ minetest.register_chatcommand("top50", {
})

minetest.register_chatcommand("make_pro", {
description = "Make yourself or another player a pro",
description = "Make yourself or another player a pro (Will break target player's ranks)",
params = "[mode:technical modename] <playername>",
privs = {ctf_admin = true},
func = function(name, param)
Expand All @@ -271,16 +271,17 @@ minetest.register_chatcommand("make_pro", {
end

local old_ranks = mode_data.rankings:get(pname)
local note = ""
if not old_ranks then
return false, string.format("Player '%s' has no rankings!", pname)
note = string.format(" Note: Player '%s' had no rankings before that.", pname)
end

mode_data.rankings:add(pname, {score = 8000, kills = 7, deaths = 5, flag_captures = 5})
mode_data.rankings:set(pname, {score = 8000, kills = 7, deaths = 5, flag_captures = 5})

minetest.log("action", string.format(
"[ctf_admin] %s made player '%s' a pro in mode %s: %s", name, pname, mode_name, dump(old_ranks)
))
return true, string.format("Player '%s' is now a pro!", pname)
return true, string.format("Player '%s' is now a pro.%s", pname, note)
end
})

Expand All @@ -306,17 +307,17 @@ minetest.register_chatcommand("add_score", {
end

local old_ranks = mode_data.rankings:get(pname)
local note = ""
if not old_ranks then
return false, string.format("Player '%s' has no rankings!", pname)
note = string.format(" Note: Player '%s' had no rankings before that.", pname)
end

local old_score = old_ranks.score or 0
mode_data.rankings:set(pname, {score = old_score + score})
mode_data.rankings:add(pname, {score = score})

minetest.log("action", string.format(
"[ctf_admin] %s added %s score to player '%s' in mode %s", name, score, pname, mode_name
))
return true, string.format("Added %s score to player '%s'", score, pname)
return true, string.format("Added %s score to player '%s'.%s", score, pname, note)
end
})

Expand Down Expand Up @@ -353,29 +354,30 @@ minetest.register_chatcommand("transfer_rankings", {
end
end

local note = ""
if not src_exists then
return false, string.format("Source player '%s' has no rankings!", src)
end
if not dst_exists then
return false, string.format("Destination player '%s' has no rankings!", dst)
note = string.format(" Note: Destination player '%s' had no rankings.", dst)
end

if src == dst then
return false, "Source name and destination name cannot be the same!"
end

for mode_name, mode in pairs(ctf_modebase.modes) do
mode.rankings:add(dst, src_rankings[mode_name])
mode.rankings:set(dst, src_rankings[mode_name], true)
end

for _, mode in pairs(ctf_modebase.modes) do
mode.rankings:set(src, {}, true)
end

minetest.log("action", string.format(
"[ctf_admin] %s transferred rankings from '%s' to '%s': %s -> %s",
name, src, dst, dump(src_rankings), dump(dst_rankings)
"[ctf_admin] %s transferred rankings from '%s' to '%s': %s -> %s | %s",
name, src, dst, dump(src_rankings), dump(dst_rankings), note
))
return true, string.format("Rankings of '%s' have been transferred to '%s'", src, dst)
return true, string.format("Rankings of '%s' have been transferred to '%s'.%s", src, dst, note)
end
})
12 changes: 11 additions & 1 deletion mods/ctf/ctf_modebase/recent_rankings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ return {
rankings_teams = {}
end,
players = function() return rankings_players end,
teams = function() return rankings_teams end,
teams = function()
local out = {}

for k, v in pairs(rankings_teams) do
if not ctf_teams.team[k].not_playing then
out[k] = v
end
end

return out
end,
}

end
8 changes: 8 additions & 0 deletions mods/ctf/ctf_report/locale/ctf_report.es.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# textdomain: ctf_report
<msg>=<mensaje>
Report misconduct or bugs=Reportar falta de conducta o errores
Please add a message to your report.=Por favor añade un mensaje a tu reporte
If it's about (a) particular player(s), please also include their name(s).=Si trata sobre jugadores en específico, por favor incluye sus nombres.
If you're reporting a player,=Si estás reportando a un jugador,
you should also include a reason why (e.g. swearing, griefing, spawnkilling, etc.).=también debes de incluir el motivo (p.j., decir malas palabras, destrucción, matar tan rápido a un jugador que aparezca, etc.)
Report has been sent.=El reporte ha sido enviado.
79 changes: 73 additions & 6 deletions mods/ctf/ctf_teams/team_chest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,59 @@ local blacklist = {
"default:pick_stone",
}

--[[
local item_value = {
["grenades:poison"] = 5,
["grenades:frag"] = 6,
["grenades:smoke"] = 2,
["ctf_ranged:pistol_loaded"] = 2,
["ctf_ranged:pistol"] = 1,
["ctf_ranged:rifle"] = 4,
["ctf_ranged:rifle_loaded"] = 5,
["ctf_ranged:smg"] = 4,
["ctf_ranged:smg_loaded"] = 5,
["ctf_ranged:sniper_magnum"] = 8,
["ctf_ranged:sniper_magnum_loaded"] = 10,
["ctf_ranged:ammo"] = 4,
["default:diamond"] = 2.5,
["default:mese_crystal"] = 2,
["default:mese"] = 18,
["default:steel_ingot"] = 1,
["default:iron_lump"] = 1,
["default:sword_diamond"] = 16,
["default:sword_steel"] = 7,
["default:sword_mese"] = 13,
["default:pick_steel"] = 3,
["default:pick_mese"] = 6,
["default:pick_diamond"] = 7,
["default:axe_steel"] = 3,
["default:axe_mese"] = 6,
["default:axe_diamond"] = 7,
["default:shovel_steel"] = 2,
["default:shovel_mese"] = 3,
["default:shovel_diamond"] = 4,
["default:stick"] = 0.5,
["default:wood"] = 1,
["default:cobble"] = 1,
["ctf_map:reinforced_cobble"] = 3,
["ctf_map:damage_cobble"] = 3,
["ctf_map:unwalkable_cobble"] = 1,
["ctf_map:unwalkable_stone"] = 1,
["ctf_map:unwalkable_dirt"] = 1,
["default:steelblock"] = 2.5,
["default:bronzeblock"] = 2.5,
["default:obsidian_block"] = 3.5,
["ctf_map:spike"] = 2.5,
["default:apple"] = 1.5,
["ctf_healing:medkit"] = 6,
["ctf_healing:bandage"] = 6,
}
--]]





local function get_chest_access(name)
local current_mode = ctf_modebase:get_current_mode()
if not current_mode then return false, false end
Expand Down Expand Up @@ -246,13 +299,27 @@ for _, team in ipairs(ctf_teams.teamlist) do
end
end

function def.on_metadata_inventory_put(pos, listname, index, stack, player)
minetest.log("action", string.format("%s puts %s to team chest at %s",
player:get_player_name(),
stack:to_string(),
minetest.pos_to_string(pos)
))

function def.on_metadata_inventory_put(pos, listname, index, stack, player)
minetest.log("action", string.format("%s puts %s to team chest at %s",
player:get_player_name(),
stack:to_string(),
minetest.pos_to_string(pos)
))
local meta = stack:get_meta()
local dropped_by = meta:get_string("dropped_by")
local pname = player:get_player_name()
if dropped_by ~= pname and dropped_by ~= "" then
local cur_mode = ctf_modebase:get_current_mode()
if pname and cur_mode then
--local score = (item_value[stack:get_name()] or 0) * stack:get_count()
cur_mode.recent_rankings.add(pname, { score = 1 }, false)
end
end
meta:set_string("dropped_by", "")
local inv = minetest.get_inventory({ type="node", pos=pos })
inv:set_stack(listname, index, stack)
end

function def.on_metadata_inventory_take(pos, listname, index, stack, player)
minetest.log("action", string.format("%s takes %s from team chest at %s",
Expand Down
3 changes: 3 additions & 0 deletions mods/other/afkkick/locale/afkkick.es.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# textdomain: afkkick
Allow to AFK without being kicked=Permite estar inactivo sin ser sacado del juego
Warning, you have @1 seconds to move or be kicked=Advertencia, tienes @1 segundo(s) para moverte o ser sacado del juego
63 changes: 39 additions & 24 deletions mods/other/playertag/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,56 @@ playertag = {
TYPE_ENTITY = TYPE_ENTITY,
}

local function remove_entity_tag(player)
local tag = players[player:get_player_name()]
if tag then
if tag.entity then
tag.entity.object:remove()
tag.entity = nil
end

if tag.nametag_entity then
tag.nametag_entity.object:remove()
tag.nametag_entity = nil
end

if tag.symbol_entity then
tag.symbol_entity.object:remove()
tag.symbol_entity = nil
end
end
end

local function add_entity_tag(player, old_observers)
local pname = player:get_player_name()
local ppos = player:get_pos()

-- Hide fixed nametag
player:set_nametag_attributes({
color = {a = 0, r = 0, g = 0, b = 0}
})

local ent = minetest.add_entity(player:get_pos(), "playertag:tag")
remove_entity_tag(player)

local ent = minetest.add_entity(ppos, "playertag:tag")
local ent2 = false
local ent3 = false

if not ent then
minetest.after(1, add_entity_tag, player, old_observers)
return
end

if ent.set_observers then
ent2 = minetest.add_entity(player:get_pos(), "playertag:tag")
ent2 = minetest.add_entity(ppos, "playertag:tag")
ent2:set_observers(old_observers.nametag_entity or {})
ent2:set_properties({
nametag = player:get_player_name(),
nametag = pname,
nametag_color = "#EEFFFFDD",
nametag_bgcolor = "#0000002D"
})

ent3 = minetest.add_entity(player:get_pos(), "playertag:tag")
ent3 = minetest.add_entity(ppos, "playertag:tag")
ent3:set_observers(old_observers.symbol_entity or {})
ent3:set_properties({
collisionbox = { 0, 0, 0, 0, 0, 0 },
Expand All @@ -40,9 +70,9 @@ local function add_entity_tag(player, old_observers)

-- Build name from font texture
local texture = "npcf_tag_bg.png"
local x = math.floor(134 - ((player:get_player_name():len() * 11) / 2))
local x = math.floor(134 - ((pname:len() * 11) / 2))
local i = 0
player:get_player_name():gsub(".", function(char)
pname:gsub(".", function(char)
local n = "_"
if char:byte() > 96 and char:byte() < 123 or char:byte() > 47 and char:byte() < 58 or char == "-" then
n = char
Expand All @@ -64,24 +94,9 @@ local function add_entity_tag(player, old_observers)
end

-- Store
players[player:get_player_name()].entity = ent:get_luaentity()
players[player:get_player_name()].nametag_entity = ent2 and ent2:get_luaentity()
players[player:get_player_name()].symbol_entity = ent3 and ent3:get_luaentity()
end

local function remove_entity_tag(player)
local tag = players[player:get_player_name()]
if tag and tag.entity then
tag.entity.object:remove()

if tag.nametag_entity then
tag.nametag_entity.object:remove()
end

if tag.symbol_entity then
tag.symbol_entity.object:remove()
end
end
players[pname].entity = ent:get_luaentity()
players[pname].nametag_entity = ent2 and ent2:get_luaentity()
players[pname].symbol_entity = ent3 and ent3:get_luaentity()
end

local function update(player, settings)
Expand Down
34 changes: 34 additions & 0 deletions mods/other/random_messages/locale/random_messages.es.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# textdomain: random_messages

To talk to only your team, start your messages with /t. For example, /t Hello team!=Para hablar únicamente a tu equipo, comienza tus mensajes con /t. Por ejemplo, /t ¡Hola equipo!
Use apples to quickly restore your health.=Use manzanas para restaurar tu salud rápidamente
Moving or fighting can avoid an inactivity kick.=Moverse o pelear puede evitar ser sacado por inactividad
Gain more score by killing more than you die, by healing teammates with bandages, or by capturing the flag.=Gana más puntos por tener más asesinatos que muertes, dando vida a tus compañeros de equipo con vendajes, o capturando la bandera.
You gain more score the better the opponent you defeat.=Obtendrás mejor puntuación cuanto mejor sea el oponente que derrotes.
Find weapons in chests or mine and use furnaces to make stronger swords.=Encuentra armas en los cofres o mina y use hornos para crear espadas más fuertes.
Use team doors (steel) to stop the enemy walking into your base.=Use puertas del equipo (hierro) para prevenir al enemigo entrar a tu base.
Sprint by pressing the fast key (E) when you have stamina.=Corre presionando la tecla de rápido (E) cuando tengas resistencia.
Like CTF? Give feedback using /report, and consider donating at rubenwardy.com/donate=¿Te gusta CTF? De su opinión usando /report, y considere donar en rubenwardy.com/donate
Want to submit your own map? Visit https://github.com/MT-CTF/maps to get involved.=¿Quieres publicar tu propio mapa? Visita https://github.com/MT-CTF/maps para participar.
Using limited resources for building structures that don't strengthen your base's defences is discouraged.=Usar recursos limitados para construir estructuras que no fortalezcan las defensas de tu base no está aconsejado.
To report misbehaving players to moderators, please use /report <name> <action>=Para reportar jugadores que se porten mal a los moderadores, por favor use /report <nombre> <acción>
Swearing, trolling and being rude will not be tolerated and strict action will be taken.=Decir maldiciones, engañar y ser grosero no será tolerado y se tomarán medidas estrictas.
Trapping team mates on purpose is strictly against the rules and you will be kicked immediately.=Atrapar a tus compañeros de equipo a propósito está estrictamente en contra de las reglas y serás sacado fuera inmediatamente.
Help your team claim victory by storing extra weapons in the team chest, and never taking more than you need.=Ayuda a tu equipo reclamar la victoria guardando armas adicionales en el cofre del equipo, y nunca tomar más de lo que necesites.
Excessive spawn-killing is a direct violation of the rules - appropriate punishments will be given.=Matar a otros jugadores que acaban de aparecer excesivamente es una violación directa de las reglas - se darán los castigos necesarios.
Use /r to check your rank and other statistics.=Use /r para ver tu clasificación y otras estadísticas.
Use /r <playername> to check the rankings of another player.=Use /r <nombredejugador> para ver las clasificaciones de otro jugador.
Use bandages on team-mates to heal them by 3-4 HP if their health is below 15 HP.=Use vendajes en tus compañeros de equipo para darles 3-4 de vida si su salud está debajo de 15 de vida.
Use /m to add a team marker at pointed location, that's visible only to team-mates.=Use /m para añadir un marcador en la ubicación señalada, que es solamente visible para tus compañeros de equipo.
Use /summary (or /s) to check scores of the current match and the previous match.=Use /summary (o /s) para ver las puntuaciones de la partida actual y de la partida anterior.
Strengthen your team by capturing enemy flags.=Fortalece tu equipo capturando banderas enemigas.
Hitting your enemy does more damage than not hitting them.=Pegarle a tu enemigo hace más daño que no pegarle.
Use /top50 command to see the leaderboard.=Use /top50 para ver la tabla de clasificación.
Use /top50 <mode:technical modename> to see the leaderboard on another mode. For example: /top50 mode:nade_fight.=Use /top50 <modo:nombre de modo técnico> para ver la tabla de clasificación en otro modo. Por ejemplo: /top50 mode:nade_fight.
To check someone's rank on another mode use /r <mode:technical modename> <playername>. For example: /r mode:nade_fight randomplayer.=Para ver la clasificación de alguien en otro modo use /r <modo:nombre de modo técnico> <nombredejugador>. Por ejemplo: /r mode:nade_fight jugador
To check someone's team use /team player <player_name>.=Para ver a que equipo pertenece alguien use /team player <nombre_de_jugador>.
To check all team members use /team.=Para ver todos los miembros de tu equipo use /team.
You can capture multiple enemy flags at once!=¡Puedes capturar múltiples banderas enemigas al mismo tiempo!
Consider joining our Discord server at https://discord.gg/vcZTRPX=Considera unirte a nuestro servidor de Discord en https://discord.gg/vcZTRPX
You can press sneak while jumping, to jump up two blocks.=Puedes presionar sneak mientras brincas, para brincar dos bloques.
Use /donate <playername> <score> to reward a team-mate for their work.=Use /donate <nombredejugador> <puntos> para recompensar a un compañero del equipo por su trabajo.
Loading

0 comments on commit 51b06de

Please sign in to comment.