This commit is contained in:
Fang 2023-07-28 16:10:57 +08:00
parent 3cd7442a8e
commit 228bf96ecf

View File

@ -8,13 +8,13 @@ function HeroEntity:ctor(cfgId, lv, collectionLevel)
self.data.collectionLevel = collectionLevel self.data.collectionLevel = collectionLevel
self.config = ConfigManager:getConfig("hero")[self.cfgId] self.config = ConfigManager:getConfig("hero")[self.cfgId]
self.beginLv = self.config.begin_lv -- 初始等级 self.beginLv = self.config.begin_lv -- 初始等级
end
function HeroEntity:initAttr()
self.baseAttrOriginal = {} self.baseAttrOriginal = {}
self.equipAttr = {} self.equipAttr = {}
self.allAttr = {} self.allAttr = {}
end
function HeroEntity:initAttr()
self:setTotalAttrValue(ATTR_NAME.HP, 0) self:setTotalAttrValue(ATTR_NAME.HP, 0)
self:setTotalAttrValue(ATTR_NAME.ATK, 0) self:setTotalAttrValue(ATTR_NAME.ATK, 0)
self:setTotalAttrValue(ATTR_NAME.ATK_RED, 0) self:setTotalAttrValue(ATTR_NAME.ATK_RED, 0)
@ -168,7 +168,7 @@ function HeroEntity:addTotalAttrValue(name, add)
end end
function HeroEntity:getTotalAttrValue(name) function HeroEntity:getTotalAttrValue(name)
if self.allAttr == nil then if #table.keys(self.allAttr) == 0 then
self:initAttr() self:initAttr()
end end
if not self.allAttr[name] then if not self.allAttr[name] then