local function getPropName(tbl)
local ret = ""
local key = tbl[1] or "" --取得属性英文KEY
local value = tbl[2] or 0 --取得属性值
local _tbl = prop_name_tbl[key] --根据英文KEY查找中文名称
local name_tbl = {"PowerRate","MagicRate","SCRate","TCRate","ACRate","MACRate"}
if _tbl and value > 0 then
ret = _tbl[1]
if is_include(tbl[1], name_tbl) then
if _tbl[2] ~= "nil" then --nil=不加属性值
ret = ret..(value * 100 - 100).._tbl[2] --属性值计算
end
elseif _tbl[2] ~= "nil" then --nil=不加属性值
ret = ret..value.._tbl[2]
end
if _tbl[2] == "+" then --联名属性
ret = _tbl[1].._tbl[2]..(prop_hash_tbl["Max"..key] or 0)
end
ret = hintHelper.text(ret, 0xFF00FFFF,1)..hintHelper.set(60, nil, 20, nil)
end
return ret
end
自己根据自己版本的实际情况去修改
补充内容 (2020-5-6 15:44):
function is_include(value, tab)--检查函数是否在表中
for k,v in ipairs(tab) do
if v == value then
return true
end
end
return false
end |