+ Added setting to assign a custom importance to each armor material
+ Added a message telling a player his/her killer's HP + Added missing translationmaster
parent
ada2a950a5
commit
acb80a54d1
15
SETTINGS.lua
15
SETTINGS.lua
|
@ -88,3 +88,18 @@ skywars_settings.nodes_per_tick = 20
|
||||||
|
|
||||||
|
|
||||||
skywars_settings.remove_armors_on_join = true
|
skywars_settings.remove_armors_on_join = true
|
||||||
|
|
||||||
|
-- The armors importances that are used by the auto equip system:
|
||||||
|
-- when a player takes an armor from a chest, if it has a greater
|
||||||
|
-- importance that the already equipped one the latter gets replaced.
|
||||||
|
-- If the armor name contains one of this materials then the
|
||||||
|
-- corresponding importance will be associated with it.
|
||||||
|
skywars_settings.armors_importances = {
|
||||||
|
["cactus"] = 0,
|
||||||
|
["wood"] = 1,
|
||||||
|
["gold"] = 2,
|
||||||
|
["bronze"] = 3,
|
||||||
|
["steel"] = 4,
|
||||||
|
["mithril"] = 5,
|
||||||
|
["diamond"] = 6
|
||||||
|
}
|
|
@ -85,8 +85,10 @@ arena_lib.on_death("skywars", function(arena, pl_name, reason)
|
||||||
if reason.type == "punch" then
|
if reason.type == "punch" then
|
||||||
if reason.object and reason.object:is_player() then
|
if reason.object and reason.object:is_player() then
|
||||||
local killer = reason.object:get_player_name()
|
local killer = reason.object:get_player_name()
|
||||||
|
local killer_health = reason.object:get_hp()
|
||||||
|
|
||||||
arena_lib.send_message_players_in_arena(arena, skywars_settings.prefix .. skywars.T("@1 was killed by @2", pl_name, killer))
|
arena_lib.send_message_players_in_arena(arena, skywars_settings.prefix .. skywars.T("@1 was killed by @2", pl_name, killer))
|
||||||
|
skywars.print_msg(pl_name, skywars.T("@1 killed you with @2 HPs", killer, killer_health))
|
||||||
skywars.increment_players_killed(killer)
|
skywars.increment_players_killed(killer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,6 +36,9 @@ minetest.register_on_player_inventory_action(function(player, action, inventory,
|
||||||
if equipped_armor then
|
if equipped_armor then
|
||||||
local armor_importance = get_armor_importance(armor_name)
|
local armor_importance = get_armor_importance(armor_name)
|
||||||
local weared_armor_importance = get_armor_importance(equipped_armor)
|
local weared_armor_importance = get_armor_importance(equipped_armor)
|
||||||
|
|
||||||
|
if not armor_importance or not weared_armor_importance then return end
|
||||||
|
|
||||||
-- Returning if the just taken armor is worse or as good as the equipped one.
|
-- Returning if the just taken armor is worse or as good as the equipped one.
|
||||||
if armor_importance <= weared_armor_importance then return end
|
if armor_importance <= weared_armor_importance then return end
|
||||||
end
|
end
|
||||||
|
@ -51,14 +54,9 @@ end)
|
||||||
|
|
||||||
|
|
||||||
function get_armor_importance(armor_name)
|
function get_armor_importance(armor_name)
|
||||||
local importance
|
for material, importance in pairs(skywars_settings.armors_importances) do
|
||||||
|
if armor_name:match(material) then
|
||||||
if (armor_name:match("wood")) then importance = 1
|
return importance
|
||||||
elseif (armor_name:match("gold")) then importance = 2
|
end
|
||||||
elseif (armor_name:match("bronze")) then importance = 3
|
|
||||||
elseif (armor_name:match("steel")) then importance = 4
|
|
||||||
elseif (armor_name:match("diamond")) then importance = 5
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return importance
|
|
||||||
end
|
end
|
|
@ -27,7 +27,6 @@ You didn't set the chests!=Non hai impostato le chest!
|
||||||
You didn't set the map corners!=Non hai impostato gli angoli della mappa!
|
You didn't set the map corners!=Non hai impostato gli angoli della mappa!
|
||||||
@1 must be disabled!=@1 deve essere disabilitata!
|
@1 must be disabled!=@1 deve essere disabilitata!
|
||||||
@1 must be enabled!=@1 deve essere abilitata!
|
@1 must be enabled!=@1 deve essere abilitata!
|
||||||
@1 was killed by @2=@1 è stato ucciso da @2
|
|
||||||
@1 already exists!=@1 esiste già!
|
@1 already exists!=@1 esiste già!
|
||||||
@1 added to @2!=@1 aggiunto a @2
|
@1 added to @2!=@1 aggiunto a @2
|
||||||
@1 removed from @2!=@1 rimosso da @2!
|
@1 removed from @2!=@1 rimosso da @2!
|
||||||
|
@ -44,4 +43,6 @@ x@1 @2 added to @3!=x@1 @2 aggiunto a @3!
|
||||||
@1 kits have been copied to @2!=I kit di @1 sono stati copiati in @2!
|
@1 kits have been copied to @2!=I kit di @1 sono stati copiati in @2!
|
||||||
Nobody=Nessuno
|
Nobody=Nessuno
|
||||||
Nobody must be in the editor!=Nessuno deve essere nell'editor!
|
Nobody must be in the editor!=Nessuno deve essere nell'editor!
|
||||||
Time is out, the match is over!=Tempo terminato, la partita è finita!
|
Time is out, the match is over!=Tempo terminato, la partita è finita!
|
||||||
|
@1 was killed by @2=@1 è stato ucciso da @2
|
||||||
|
@1 killed you with @2 HPs=@1 ti ha ucciso con @2 HP
|
|
@ -27,7 +27,6 @@ You didn't set the chests!=
|
||||||
You didn't set the map corners!=
|
You didn't set the map corners!=
|
||||||
@1 must be disabled!=
|
@1 must be disabled!=
|
||||||
@1 must be enabled!=
|
@1 must be enabled!=
|
||||||
@1 was killed by @2=
|
|
||||||
@1 already exists!=
|
@1 already exists!=
|
||||||
@1 added to @2!=
|
@1 added to @2!=
|
||||||
@1 removed from @2!=
|
@1 removed from @2!=
|
||||||
|
@ -44,4 +43,6 @@ x@1 @2 added to @3!=
|
||||||
@1 kits have been copied to @2!=
|
@1 kits have been copied to @2!=
|
||||||
Nobody=
|
Nobody=
|
||||||
Nobody must be in the editor!=
|
Nobody must be in the editor!=
|
||||||
Time is out, the match is over!=
|
Time is out, the match is over!=
|
||||||
|
@1 was killed by @2=
|
||||||
|
@1 killed you with @2 HPs=
|
Loading…
Reference in New Issue