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

111 lines
3.9 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 HeroData = GSetClass("Person")
HeroData.onCreate = function(self,_msgHeroData, isFindHandBook)
self._id = _msgHeroData.heroId
self._lv = _msgHeroData.level
self._Did = _msgHeroData.id
self._equipIdList = _msgHeroData.equipIdList
self._talismanList = self.especialEquipLevel
self._star = _msgHeroData.star
-- self._breakId = _msgHeroData.
end
--等级
HeroData.__get__.lv = function(self)
-- print(this._lv, " - 属性访问器get lv")
local temp_lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv)
local endLv = 0
if temp_lv > 0 and HarmonyManager.IsInfo(self.dynamicId) then
--LogGreen(tostring(HeroManager.IsElevenStar(self.star)))
--print(self._id.." "..HarmonyManager.hongmengAdditions[1].heroTid..self.heroConfig.ReadingName)
if HeroManager.IsTenTalent(self._id) and HarmonyManager.hongmengAdditions[1].heroTid == 0 then
-- bodys
endLv = HarmonyManager.hongmengAdditions[1].value
--print(endLv," "..self.heroConfig.ReadingName)
else
local curlvEen = HeroManager.heroLvEnd[self.id]
--
endLv = temp_lv > curlvEen and curlvEen or temp_lv
end
return endLv
elseif HarmonyManager.hongmengAdditions[1] and HarmonyManager:IsEnvoy(self.dynamicId) then
if HarmonyManager.hongmengAdditions[1].heroTid == 0 then
-- body
return HarmonyManager.hongmengAdditions[1].value
else
return self._lv
end
-- body
--self._lv = 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 "..equipStar )
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__.talismanList = function(self)
-- EquipTalismana
--LogPink("法宝1 `````````` ")
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig,self._id)
--LogPink("法宝2 `````````` "..self._id)
if heroConfig and not heroConfig.EquipTalismana then
self.harmonyGongMing = false
-- LogPink("法宝3 `````````` "..self._talismanList)
return 0
end
local Equip = HarmonyManager.GetSingleAdditions(HarmonyAddType.FaBao)
if Equip > 0 and HarmonyManager.IsInfo(self.dynamicId) then
--print(curlvEen," "..self.heroConfig.ReadingName)
local endLv = Equip > self._talismanList and Equip or self._talismanList
self.harmonyGongMing = true
--LogPink("法宝4 `````````` "..endLv)
return endLv
else
self.harmonyGongMing = false
--LogPink("法宝5 `````````` "..self._talismanList)
return self._talismanList
end
end
HeroData.__set__.talismanList = function(self, value)
self._talismanList = value
end
HeroData.__get__.oriLv= function (self)
-- body
return self._lv
end
return HeroData