miduo_client/Assets/ManagedResources/~Lua/Modules/RoleInfo/EquipTreasureData.lua

55 lines
2.0 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

require("misc.GSetClass")
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
local EquipTreasureData = GSetClass("EquipTreasureData")
EquipTreasureData.onCreate = function(self,_singleData)
self._lv = _singleData.lv
end
--等级
EquipTreasureData.__get__.lv = function(self)
--print(self.Location .. " ---- Location")
if self.equipType == 1 then
-- body
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.HunSoulPrint)
local isMing = HarmonyManager.IsInfo(self.upHeroDid)
--LogPink("self.upHeroDid "..self.upHeroDid.." "..tostring(isMing))
if temp_lv > 0 and isMing and temp_lv > self._lv then
local curlvEen = jewelConfig[self.id].Max[1]
local endLv = temp_lv > curlvEen and curlvEen or temp_lv
--LogPink(" curlvEen "..endLv)
return endLv
else
--LogPink(" curlvEen "..self._lv)
return self._lv
end
elseif self.equipType == 2 then
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.LingSoulPrint)
local isMing = HarmonyManager.IsInfo(self.upHeroDid)
--LogPink("self.upHeroDid "..self.upHeroDid.." "..tostring(isMing))
if temp_lv > 0 and isMing and temp_lv > self._lv then
local curlvEen = jewelConfig[self.id].Max[1]
-- --LogGreen("curlvEen "..curlvEen.." temp_lv "..temp_lv)
local endLv = temp_lv > curlvEen and curlvEen or temp_lv
-- LogPink(" curlvEen "..endLv)
return endLv
else
--LogPink(" curlvEen "..self._lv)
return self._lv
end
end
end
EquipTreasureData.__set__.lv = function(self, value)
-- print(this._lv, " - 属性访问器set lv", value)
self._lv = value
end
EquipTreasureData.__get__.oriLv= function (self)
-- body
return self._lv
end
return EquipTreasureData