diff --git a/SETTINGS.lua b/SETTINGS.lua index 7da6305..287dc5e 100644 --- a/SETTINGS.lua +++ b/SETTINGS.lua @@ -15,7 +15,7 @@ murder_settings = {} murder_settings.loading_time = 10 -- The time between the end of the match and the respawn at the hub. -murder_settings.celebration_time = 5 +murder_settings.celebration_time = 7 -- What's going to appear in most of the lines printed by murder. murder_settings.prefix = "Murder > " diff --git a/_arena_lib/arena_callbacks.lua b/_arena_lib/arena_callbacks.lua index fed6cf8..9e174ab 100644 --- a/_arena_lib/arena_callbacks.lua +++ b/_arena_lib/arena_callbacks.lua @@ -41,12 +41,15 @@ end) -arena_lib.on_celebration("murder", function(arena) +arena_lib.on_celebration("murder", function(arena, winner_name) murder.log(arena, "- celebration started -") + winner_name = murder.T("@1 won!", winner_name) for pl_name, _ in pairs(arena.players) do arena.roles[pl_name].on_end(arena, pl_name) end + + arena_lib.HUD_send_msg_all("broadcast", arena, winner_name, murder_settings.celebration_time) end) diff --git a/_roles/cop/cop_items.lua b/_roles/detective/detective_items.lua similarity index 89% rename from _roles/cop/cop_items.lua rename to _roles/detective/detective_items.lua index fb615c4..f89eea0 100644 --- a/_roles/cop/cop_items.lua +++ b/_roles/detective/detective_items.lua @@ -8,10 +8,10 @@ minetest.register_craftitem("murder:gun", { local pl_name = player:get_player_name() if not murder.is_player_playing(pl_name) then return end local arena = arena_lib.get_arena_by_player(pl_name) - local cop_props = arena.roles[pl_name].properties + local detective_props = arena.roles[pl_name].properties local reload_delay = 2 - if cop_props.can_shoot then + if detective_props.can_shoot then local ray, pos_head, shoot_dir = murder.look_raycast(player, 100) local particle_shot = { pos = pos_head, @@ -44,8 +44,8 @@ minetest.register_craftitem("murder:gun", { minetest.sound_play("murder_gun_shoot", {pos = player:get_pos(), to_player = pl_name}) - cop_props.can_shoot = false - minetest.after(reload_delay, function() cop_props.can_shoot = true end) + detective_props.can_shoot = false + minetest.after(reload_delay, function() detective_props.can_shoot = true end) else minetest.sound_play("murder_empty_gun", {pos = player:get_pos(), to_player = pl_name}) end diff --git a/_roles/cop/cop_role.lua b/_roles/detective/detective_role.lua similarity index 81% rename from _roles/cop/cop_role.lua rename to _roles/detective/detective_role.lua index cbe2a39..61a9d93 100644 --- a/_roles/cop/cop_role.lua +++ b/_roles/detective/detective_role.lua @@ -1,17 +1,17 @@ -murder.register_role("Cop", { +murder.register_role("Detective", { default = true, - name = "Cop", - hotbar_description = "Kill the murderer, but if you kill another cop you'll die!", + name = "Detective", + hotbar_description = "Kill the murderer, if you kill another detective you'll die!", items = {"murder:gun"}, - sound = "cop-role", + sound = "detective-role", on_kill = function(arena, pl_name, killed_pl_name) local killed_role = arena.roles[killed_pl_name] - -- If the player killed another cop. - if killed_role.name == "Cop" then + -- If the player killed another detective. + if killed_role.name == "Detective" then local player_inv = minetest.get_player_by_name(pl_name):get_inventory() - murder.print_msg(pl_name, murder.T("You killed another cop (@1)!", killed_pl_name)) + murder.print_msg(pl_name, murder.T("You killed another detective (@1)!", killed_pl_name)) murder.eliminate_role(pl_name) minetest.after(0, function() player_inv:remove_item("main", "murder:gun") end) elseif killed_role.name == "Murderer" then @@ -37,7 +37,7 @@ murder.register_role("Cop", { -- Adding a 4s lasting waypoint to the death place if the player's -- been killed by another role. - if killer_role.name ~= "Cop" then + if killer_role.name ~= "Detective" then for other_pl_name, _ in pairs(arena.players) do local death_waypoint = { hud_elem_type = "image_waypoint", @@ -59,4 +59,4 @@ murder.register_role("Cop", { -dofile(minetest.get_modpath("murder") .. "/_roles/cop/cop_items.lua") +dofile(minetest.get_modpath("murder") .. "/_roles/detective/detective_items.lua") diff --git a/_roles/murderer/murderer_role.lua b/_roles/murderer/murderer_role.lua index c5c2993..68c85d3 100644 --- a/_roles/murderer/murderer_role.lua +++ b/_roles/murderer/murderer_role.lua @@ -4,7 +4,7 @@ murder.register_role("Murderer", { items = {"murder:knife", "murder:blinder", "murder:skin_shuffler", "murder:locator"}, sound = "murderer-role", properties = { - kill_delay = 10, + kill_delay = 20, can_kill = true, thrown_knife = nil, thrown_knives_count = 0, diff --git a/init.lua b/init.lua index 92fb4df..6402ee5 100644 --- a/init.lua +++ b/init.lua @@ -32,7 +32,7 @@ dofile(minetest.get_modpath("murder") .. "/_debug/logs.lua") dofile(minetest.get_modpath("murder") .. "/_arena_lib/arena_callbacks.lua") dofile(minetest.get_modpath("murder") .. "/_arena_lib/arena_utils.lua") dofile(minetest.get_modpath("murder") .. "/_roles/roles_registration.lua") -dofile(minetest.get_modpath("murder") .. "/_roles/cop/cop_role.lua") +dofile(minetest.get_modpath("murder") .. "/_roles/detective/detective_role.lua") dofile(minetest.get_modpath("murder") .. "/_roles/murderer/murderer_role.lua") dofile(minetest.get_modpath("murder") .. "/chatcmdbuilder.lua") dofile(minetest.get_modpath("murder") .. "/commands.lua") diff --git a/locale/murder.it.tr b/locale/murder.it.tr index bc15d11..c994c65 100644 --- a/locale/murder.it.tr +++ b/locale/murder.it.tr @@ -13,7 +13,7 @@ The match will start in @1 seconds!=La partita inizierà tra @1 secondi! @1 (@2) killed @3 (@4)!=@1 (@2) ha ucciso @3 (@4)! Read your items description to learn their utility=Leggi la descrizione degli oggetti per scoprirne l'utilità The @1 team=Il team @1 - +@1 won!=@1 ha vinto! # Murderer @@ -26,12 +26,12 @@ Shuffles all players skins!=Rimescola le skin dei giocatori! Blinds everyone for @1s!=Acceca tutti per @1s! -# Cop +# Detective -Cop=Poliziotto -Kill the murderer, but if you kill another cop you'll die!=Uccidi l'assassino, se uccidi un altro poliziotto morirai! +Detective=Detective +Kill the murderer, if you kill another detective you'll die!=Uccidi l'assassino, se uccidi un altro detective morirai! Shoot and kill!=Spara e uccidi! -You killed another cop (@1)!=Hai ucciso un altro poliziotto (@1)! +You killed another detective (@1)!=Hai ucciso un altro detective (@1)! # Commands messages diff --git a/locale/template.txt b/locale/template.txt index 0ca2560..eb5ba69 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -13,6 +13,7 @@ The match will start in @1 seconds!= @1 (@2) killed @3 (@4)!= Read your items description to learn their utility= The @1 team= +@1 won!= # Murderer @@ -26,12 +27,12 @@ Shuffles all players skins!= Blinds everyone for @1s!= -# Cop +# Detective -Cop= -Kill the murderer, but if you kill another cop you'll die!= +Detective= +Kill the murderer, if you kill another detective you'll die!= Shoot and kill!= -You killed another cop (@1)!= +You killed another detective (@1)!= # Commands messages diff --git a/textures/HUD_target.png b/textures/HUD_target.png index 5edbf17..9835f02 100644 Binary files a/textures/HUD_target.png and b/textures/HUD_target.png differ