miduo_client/Assets/ManagedResources/~Lua/Modules/Hero/HeroData.lua

82 lines
2.7 KiB
Lua
Raw Normal View History

2020-12-17 10:41:00 +08:00
require("misc.GSetClass")
local HeroData = GSetClass("Person")
HeroData.onCreate = function(self,_msgHeroData, isFindHandBook)
self._lv = _msgHeroData.level
self._equipIdList = _msgHeroData.equipIdList
self._especialEquipLevel = self.especialEquipLevel
-- self._breakId = _msgHeroData.
end
--等级
HeroData.__get__.lv = function(self)
-- print(this._lv, " - 属性访问器get lv")
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv)
if temp_lv > 0 and HarmonyManager.IsInfo(self.dynamicId) then
local curlvEen = HeroManager.heroLvEnd[self.id]
--print(curlvEen," "..self.heroConfig.ReadingName)
local endLv = temp_lv > curlvEen and curlvEen or temp_lv
return endLv
elseif HarmonyManager.hongmengTablet>= 330 and HarmonyManager:IsEnvoy(self.dynamicId) then
-- body
--self._lv = HarmonyManager.hongmengTablet
return HarmonyManager.hongmengTablet
else
return self._lv
end
end
HeroData.__set__.lv = function(self, value)
-- print(this._lv, " - 属性访问器set lv", value)
self._lv = value
end
--装备
HeroData.__get__.equipIdList = function(self)
local equipStar = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddEquip)
--LogPink("self._equipIdList "..#self._equipIdList )
if #self._equipIdList > 0 then
self.harmonyGongMing = false
return self._equipIdList
elseif equipStar > 0 and HarmonyManager.IsInfo(self.dynamicId) then
local curEquipIdList = {}
local curEquipConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipConfig,"Star",equipStar)
for i = 1, #curEquipConfigs do
table.insert(curEquipIdList,curEquipConfigs[i].Id)
end
self.harmonyGongMing = true
return curEquipIdList
else
self.harmonyGongMing = false
return self._equipIdList
end
end
HeroData.__set__.equipIdList = function(self, value)
self._equipIdList = value
end
--法宝
HeroData.__get__.especialEquipLevel = function(self)
local Equip = HarmonyManager.GetSingleAdditions(HarmonyAddType.FaBao)
--LogPink("self._equipIdList "..#self._equipIdList )
if Equip > 0 and HarmonyManager.IsInfo(self.dynamicId) then
--print(curlvEen," "..self.heroConfig.ReadingName)
local endLv = Equip > self._lv and Equip or self._lv
self.harmonyGongMing = true
return endLv
else
self.harmonyGongMing = false
return self._lv
end
end
HeroData.__set__.especialEquipLevel = function(self, value)
self._especialEquipLevel = value
end
HeroData.__get__.oriLv= function (self)
-- body
return self._lv
end
return HeroData