Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 31: Строка 31:
     local itemData = findDataById(dataCache, id)
     local itemData = findDataById(dataCache, id)


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