Модуль:ArmorStats: различия между версиями

мНет описания правки
мНет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 36: Строка 36:
local itemData = findDataById(dataCache, id)
local itemData = findDataById(dataCache, id)


-- Получаем защитные значения из coefficients, если они присутствуют
-- Получаем защитные значения из armor, если они присутствуют
local coefficients = itemData and itemData.coefficients
local armor = itemData and itemData.Armor and itemData.Armor.modifiers and itemData.Armor.modifiers.coefficients
local protBlunt = formatPercentage(coefficients and coefficients.Blunt)
local protBlunt = formatPercentage(armor and armor.Blunt)
local protSlash = formatPercentage(coefficients and coefficients.Slash)
local protSlash = formatPercentage(armor and armor.Slash)
local protPiercing = formatPercentage(coefficients and coefficients.Piercing)
local protPiercing = formatPercentage(armor and armor.Piercing)
local protHeat = formatPercentage(coefficients and coefficients.Heat)
local protHeat = formatPercentage(armor and armor.Heat)
local protRadiation = formatPercentage(coefficients and coefficients.Radiation)
local protRadiation = formatPercentage(armor and armor.Radiation)
local protCaustic = formatPercentage(coefficients and coefficients.Caustic)
local protCaustic = formatPercentage(armor and armor.Caustic)
local protExplosion = formatPercentage(itemData and itemData.ExplosionResistance and itemData.ExplosionResistance.damageCoefficient)
local protExplosion = formatPercentage(itemData and itemData.ExplosionResistance and itemData.ExplosionResistance.damageCoefficient)