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

55 lines
2.0 KiB
Lua
Raw Normal View History

2021-04-20 13:58:00 +08:00
require("misc.GSetClass")
2020-12-17 10:41:00 +08:00
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
local EquipTreasureData = GSetClass("EquipTreasureData")
EquipTreasureData.onCreate = function(self,_singleData)
self._lv = _singleData.lv
2021-01-15 10:26:56 +08:00
2020-12-17 10:41:00 +08:00
end
--等级
EquipTreasureData.__get__.lv = function(self)
2021-01-15 10:26:56 +08:00
--print(self.Location .. " ---- Location")
if self.equipType == 1 then
2020-12-17 10:41:00 +08:00
-- body
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.HunSoulPrint)
local isMing = HarmonyManager.IsInfo(self.upHeroDid)
2021-01-15 10:26:56 +08:00
--LogPink("self.upHeroDid "..self.upHeroDid.." "..tostring(isMing))
2021-01-20 13:52:53 +08:00
if temp_lv > 0 and isMing and temp_lv > self._lv then
2020-12-17 10:41:00 +08:00
local curlvEen = jewelConfig[self.id].Max[1]
local endLv = temp_lv > curlvEen and curlvEen or temp_lv
2021-01-15 10:26:56 +08:00
--LogPink(" curlvEen "..endLv)
2020-12-17 10:41:00 +08:00
return endLv
else
2021-01-15 10:26:56 +08:00
--LogPink(" curlvEen "..self._lv)
2020-12-17 10:41:00 +08:00
return self._lv
end
2021-01-15 10:26:56 +08:00
elseif self.equipType == 2 then
2020-12-17 10:41:00 +08:00
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.LingSoulPrint)
local isMing = HarmonyManager.IsInfo(self.upHeroDid)
2021-01-15 10:26:56 +08:00
--LogPink("self.upHeroDid "..self.upHeroDid.." "..tostring(isMing))
2021-01-20 13:52:53 +08:00
if temp_lv > 0 and isMing and temp_lv > self._lv then
2020-12-17 10:41:00 +08:00
local curlvEen = jewelConfig[self.id].Max[1]
-- --LogGreen("curlvEen "..curlvEen.." temp_lv "..temp_lv)
2020-12-17 10:41:00 +08:00
local endLv = temp_lv > curlvEen and curlvEen or temp_lv
2021-01-15 10:26:56 +08:00
-- LogPink(" curlvEen "..endLv)
2020-12-17 10:41:00 +08:00
return endLv
else
2021-01-15 10:26:56 +08:00
--LogPink(" curlvEen "..self._lv)
2020-12-17 10:41:00 +08:00
return self._lv
end
end
end
EquipTreasureData.__set__.lv = function(self, value)
-- print(this._lv, " - 属性访问器set lv", value)
self._lv = value
end
2021-01-18 17:43:11 +08:00
EquipTreasureData.__get__.oriLv= function (self)
-- body
return self._lv
end
2020-12-17 10:41:00 +08:00
return EquipTreasureData