3d_armor: update

This commit is contained in:
MoNTE48 2021-06-28 10:42:15 +02:00
parent 10f902de93
commit eaddf0c3d1
3 changed files with 29 additions and 13 deletions

View File

@ -1,15 +1,17 @@
armor = {}
local translator = minetest.get_translator
armor.S = translator and translator("3d_armor") or intllib.make_gettext_pair()
local S = translator and translator("3d_armor") or intllib.make_gettext_pair()
if translator and not minetest.is_singleplayer() then
local lang = minetest.settings:get("language")
if lang and lang == "ru" then
armor.S = intllib.make_gettext_pair()
S = intllib.make_gettext_pair()
end
end
armor.S = S
local ARMOR_LEVEL_MULTIPLIER = 1
local ARMOR_HEAL_MULTIPLIER = 1
local enable_damage = minetest.settings:get_bool("enable_damage")
@ -50,6 +52,19 @@ armor.register_armor = function(_, name, def)
if def.desc_color then
def.description = def.desc_color .. def.description
end
local group = def.groups
local protect
for _, element in pairs(armor.elements) do
protect = group["armor_" .. element]
if protect ~= nil then
break
end
end
def._doc_items_longdesc = S("Protect: @1%, Healing: @2%",
protect or 0, group.armor_heal or 0)
minetest.register_tool(name, def)
end

View File

@ -11,33 +11,33 @@ armor:register_armor("3d_armor:helmet_leather", {
armor:register_armor("3d_armor:helmet_steel", {
description = S"Steel Helmet",
inventory_image = "3d_armor_inv_helmet_steel.png",
groups = {armor_head = 10, armor_heal = 5, armor_use = 250}
groups = {armor_head = 5, armor_heal = 5, armor_use = 250}
})
armor:register_armor("3d_armor:helmet_gold", {
description = S"Golden Helmet",
inventory_image = "3d_armor_inv_helmet_gold.png",
groups = {armor_head = 15, armor_heal = 10, armor_use = 500}
groups = {armor_head = 5, armor_heal = 10, armor_use = 500}
})
armor:register_armor("3d_armor:helmet_diamond", {
description = S"Diamond Helmet",
inventory_image = "3d_armor_inv_helmet_diamond.png",
groups = {armor_head = 20, armor_heal = 15, armor_use = 750}
groups = {armor_head = 10, armor_heal = 15, armor_use = 750}
})
armor:register_armor("3d_armor:helmet_emerald", {
description = S"Emerald Helmet",
desc_color = default.colors.emerald,
inventory_image = "3d_armor_inv_helmet_emerald.png",
groups = {armor_head = 20, armor_heal = 15, armor_use = 1000}
groups = {armor_head = 20, armor_heal = 20, armor_use = 1000}
})
armor:register_armor("3d_armor:helmet_ruby", {
description = S"Ruby Helmet",
desc_color = default.colors.ruby,
inventory_image = "3d_armor_inv_helmet_ruby.png",
groups = {armor_head = 15, armor_heal = 20}
groups = {armor_head = 15, armor_heal = 10}
})
armor:register_armor("3d_armor:helmet_chain", {
@ -89,7 +89,7 @@ armor:register_armor("3d_armor:chestplate_ruby", {
description = S"Ruby Chestplate",
desc_color = default.colors.ruby,
inventory_image = "3d_armor_inv_chestplate_ruby.png",
groups = {armor_torso = 25, armor_heal = 15}
groups = {armor_torso = 25, armor_heal = 10}
})
armor:register_armor("3d_armor:chestplate_chain", {
@ -135,7 +135,7 @@ armor:register_armor("3d_armor:leggings_ruby", {
description = S"Ruby Leggings",
desc_color = default.colors.ruby,
inventory_image = "3d_armor_inv_leggings_ruby.png",
groups = {armor_legs = 20, armor_heal = 15}
groups = {armor_legs = 20, armor_heal = 10}
})
armor:register_armor("3d_armor:leggings_chain", {
@ -155,19 +155,19 @@ armor:register_armor("3d_armor:boots_leather", {
armor:register_armor("3d_armor:boots_steel", {
description = S"Steel Boots",
inventory_image = "3d_armor_inv_boots_steel.png",
groups = {armor_feet = 10, armor_heal = 5, armor_use = 250}
groups = {armor_feet = 5, armor_heal = 5, armor_use = 250}
})
armor:register_armor("3d_armor:boots_gold", {
description = S"Golden Boots",
inventory_image = "3d_armor_inv_boots_gold.png",
groups = {armor_feet = 15, armor_heal = 10, armor_use = 500}
groups = {armor_feet = 5, armor_heal = 10, armor_use = 500}
})
armor:register_armor("3d_armor:boots_diamond", {
description = S"Diamond Boots",
inventory_image = "3d_armor_inv_boots_diamond.png",
groups = {armor_feet = 20, armor_heal = 15, armor_use = 750}
groups = {armor_feet = 10, armor_heal = 15, armor_use = 750}
})
armor:register_armor("3d_armor:boots_emerald", {
@ -181,7 +181,7 @@ armor:register_armor("3d_armor:boots_ruby", {
description = S"Ruby Boots",
desc_color = default.colors.ruby,
inventory_image = "3d_armor_inv_boots_ruby.png",
groups = {armor_feet = 15, armor_heal = 15}
groups = {armor_feet = 15, armor_heal = 10}
})
armor:register_armor("3d_armor:boots_chain", {

View File

@ -1,5 +1,6 @@
# textdomain: 3d_armor
Your @1 got destroyed!=Ваша броня "@1" была сломана!
Protect: @1%, Healing: @2%=Защита: @1%, Отражение урона: @2%
Leather Helmet=Кожаный Шлем
Steel Helmet=Стальной Шлем
Golden Helmet=Золотой Шлем