--以下为20220511版增加
--输出物品自定义属性 function itemInfo.getState中调用
function itemInfo.getAttInfo(dbitem)
local function showAtt(id)
local tmp = ""
local Att = 0
local value = 0
if id == 1 then
Att = dbitem:getAtt()
value = dbitem:getValue()
elseif id == 2 then
Att = dbitem:getAtt1()
value = dbitem:getValue1()
elseif id == 3 then
Att = dbitem:getAtt2()
value = dbitem:getValue2()
elseif id == 4 then
Att = dbitem:getAtt3()
value = dbitem:getValue3()
elseif id == 5 then
Att = dbitem:getAtt4()
value = dbitem:getValue4()
elseif id == 6 then
Att = dbitem:getAtt5()
value = dbitem:getValue5()
--20221225增加
elseif id == 7 then
Att = dbitem:getAtt6()
value = dbitem:getValue6()
elseif id == 8 then
Att = dbitem:getAtt7()
value = dbitem:getValue7()
elseif id == 9 then
Att = dbitem:getAtt8()
value = dbitem:getValue8()
elseif id == 10 then
Att = dbitem:getAtt9()
value = dbitem:getValue9()
--20221225结束
end
if Att > 0 then
local _tbl = const.Att_tbl[Att]--取自定义属性名
if _tbl then
--20221225增加
if (Att == 57) or (Att == 58) then value = value / 100 end
--20221225结束
if (Att == 81) or (Att == 83) or (Att == 85) or (Att == 93) then value = value / 10 end
if value > 0 then
if (Att == 89) or(Att == 94) or (Att == 99) or ((Att >= 179) and (Att <= 187)) or ((Att >= 190) and (Att <= 192)) or
(Att == 238) or (Att == 239) or
--20230902增加
((Att >= 318) and (Att <= 323)) or (Att == 331) or (Att == 332)
--20230902结束
--20230518修改
--or (Att == 300)
--20230518结束
then--部分属性不需显点数 20230320版修改
tmp = _tbl[1]
else
tmp = _tbl[1]..value
end
if _tbl[2] ~= "nil" then tmp = tmp.._tbl[2] end
tmp = tmp.."\\"
end
end
end
return tmp
end
local ret = ""
ret = ret..showAtt(1)--属性解析
ret = ret..showAtt(2)--属性1解析
ret = ret..showAtt(3)--属性2解析
ret = ret..showAtt(4)--属性3解析
ret = ret..showAtt(5)--属性4解析
ret = ret..showAtt(6)--属性5解析
--20221225增加
ret = ret..showAtt(7)--属性6解析
ret = ret..showAtt(8)--属性7解析
ret = ret..showAtt(9)--属性8解析
ret = ret..showAtt(10)--属性9解析