diff --git a/mods/ctf/ctf_modebase/mode_vote.lua b/mods/ctf/ctf_modebase/mode_vote.lua index 95c994394b..60c5dd0f93 100644 --- a/mods/ctf/ctf_modebase/mode_vote.lua +++ b/mods/ctf/ctf_modebase/mode_vote.lua @@ -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 diff --git a/mods/ctf/ctf_modebase/ranking_commands.lua b/mods/ctf/ctf_modebase/ranking_commands.lua index ee628b3b54..5d45f54e75 100644 --- a/mods/ctf/ctf_modebase/ranking_commands.lua +++ b/mods/ctf/ctf_modebase/ranking_commands.lua @@ -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] ", privs = {ctf_admin = true}, func = function(name, param) @@ -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 }) @@ -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 }) @@ -353,11 +354,12 @@ 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 @@ -365,7 +367,7 @@ minetest.register_chatcommand("transfer_rankings", { 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 @@ -373,9 +375,9 @@ minetest.register_chatcommand("transfer_rankings", { 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 }) diff --git a/mods/ctf/ctf_modebase/recent_rankings.lua b/mods/ctf/ctf_modebase/recent_rankings.lua index 98548d0ed6..42ea7fb07c 100644 --- a/mods/ctf/ctf_modebase/recent_rankings.lua +++ b/mods/ctf/ctf_modebase/recent_rankings.lua @@ -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 diff --git a/mods/ctf/ctf_report/locale/ctf_report.es.tr b/mods/ctf/ctf_report/locale/ctf_report.es.tr index c9f708bbee..58f2591c73 100644 --- a/mods/ctf/ctf_report/locale/ctf_report.es.tr +++ b/mods/ctf/ctf_report/locale/ctf_report.es.tr @@ -2,7 +2,7 @@ = 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 especifico, por favor incluye sus nombres. +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 que un jugador aparezca, etc.) +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. diff --git a/mods/ctf/ctf_teams/team_chest.lua b/mods/ctf/ctf_teams/team_chest.lua index 1b08885ae0..49aba0450f 100644 --- a/mods/ctf/ctf_teams/team_chest.lua +++ b/mods/ctf/ctf_teams/team_chest.lua @@ -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 @@ -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", diff --git a/mods/other/playertag/init.lua b/mods/other/playertag/init.lua index e477a82af7..5f8aed89d6 100644 --- a/mods/other/playertag/init.lua +++ b/mods/other/playertag/init.lua @@ -15,12 +15,14 @@ local function add_entity_tag(player, old_observers) color = {a = 0, r = 0, g = 0, b = 0} }) - local ent = minetest.add_entity(player:get_pos(), "playertag:tag") + local ppos = player:get_pos() + + local ent = minetest.add_entity(ppos, "playertag:tag") local ent2 = false local ent3 = false 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(), @@ -28,7 +30,7 @@ local function add_entity_tag(player, old_observers) 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 }, @@ -152,9 +154,17 @@ minetest.register_entity("playertag:tag", { physical = false, makes_footstep_sound = false, backface_culling = false, - static_save = false, + static_save = true, pointable = false, on_punch = function() return true end, + on_detach = function(self, parent) + self.object:remove() + end, + on_deactivate = function(self, removal) + if not removal then + self.object:remove() + end + end, }) minetest.register_on_joinplayer(function(player) diff --git a/mods/other/random_messages/locale/random_messages.es.tr b/mods/other/random_messages/locale/random_messages.es.tr index a8681fabbb..befba2123f 100644 --- a/mods/other/random_messages/locale/random_messages.es.tr +++ b/mods/other/random_messages/locale/random_messages.es.tr @@ -10,15 +10,15 @@ Use team doors (steel) to stop the enemy walking into your base.=Use puertas del 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 limitades para construir estructuras que no fortalezcan las defensas de tu base no esta aconsejado. +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 =Para reportar jugadores que se porten mal a los moderadores, por favor use /report 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 esta estrictamente en contra de las reglas y serás sacado fuera inmediatamente. +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 to check the rankings of another player.=Use /r 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 esta debajo de 15 de vida. +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. @@ -26,9 +26,9 @@ Hitting your enemy does more damage than not hitting them.=Pegarle a tu enemigo Use /top50 command to see the leaderboard.=Use /top50 para ver la tabla de clasificación. Use /top50 to see the leaderboard on another mode. For example: /top50 mode:nade_fight.=Use /top50 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 . For example: /r mode:nade_fight randomplayer.=Para ver la clasificación de alguien en otro modo use /r . Por ejemplo: /r mode:nade_fight jugador -To check someone's team use /team player .=Para ver a que equipo pertenecé alguien use /team player . +To check someone's team use /team player .=Para ver a que equipo pertenece alguien use /team player . 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 multiples banderas enemigas al mismo tiempo! +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 to reward a team-mate for their work.=Use /donate para recompensar a un compañero del equipo por su trabajo. diff --git a/mods/pvp/dropondie/init.lua b/mods/pvp/dropondie/init.lua index c9135e44a8..ef2acd2a08 100644 --- a/mods/pvp/dropondie/init.lua +++ b/mods/pvp/dropondie/init.lua @@ -1,7 +1,14 @@ dropondie = {} -local function drop_list(pos, inv, list) +local function drop_list(pos, inv, list, player) for _, item in ipairs(inv:get_list(list)) do + if minetest.registered_items[item:get_name()].stack_max == 1 then + local pname = player:get_player_name() + if pname ~= "" then + local meta = item:get_meta() + meta:set_string("dropped_by", pname) + end + end local obj = minetest.add_item(pos, item) if obj then @@ -21,7 +28,7 @@ function dropondie.drop_all(player) local pos = player:get_pos() pos.y = math.floor(pos.y + 0.5) - drop_list(pos, player:get_inventory(), "main") + drop_list(pos, player:get_inventory(), "main", player) end if ctf_core.settings.server_mode ~= "mapedit" then