Merge branch 'dev_20230919' of http://git.juzugame.com/b6-client/b6-lua into dev_20230919

This commit is contained in:
xiekaidong 2023-09-19 15:03:41 +08:00
commit 883d745149
6 changed files with 42 additions and 32 deletions

View File

@ -10,6 +10,7 @@ end
function AttrCell:refresh(heroEntity, nodeType, attrType)
self.heroEntity = heroEntity
self.runesEntity = self.heroEntity:getRunes()
self.nodeType = nodeType
self.attrName = attrType[self.heroEntity:getMatchType()]
@ -62,7 +63,7 @@ function AttrCell:showHp()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getHp(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -96,7 +97,7 @@ function AttrCell:showAtk()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getAttack(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -120,7 +121,7 @@ function AttrCell:showNormalHurt()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getNormalHurt(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -144,7 +145,7 @@ function AttrCell:showSkillHurt()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getSkillHurt(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -165,7 +166,7 @@ function AttrCell:showCrit()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getCritPercent(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -186,7 +187,7 @@ function AttrCell:showCritAtk()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getCritHurtPercent(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -213,7 +214,7 @@ function AttrCell:showNormalHurtp()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getNormalHurtPercent(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -240,7 +241,7 @@ function AttrCell:showSkillHurtp()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getSkillHurtPercent(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
@ -261,7 +262,7 @@ function AttrCell:showCured()
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
value = value + DataManager.SkinData:getHealPercent(self.heroEntity)
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
value = value + self.heroEntity:getRunes():getAttrValue(self.attrName)
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
end
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))

View File

@ -41,7 +41,8 @@ function AttrNodeCell:isShowAttr(heroEntity, node, attr)
return DataManager.SkinData:hasAttr(heroEntity, attr[heroEntity:getMatchType()])
end
if node == GConst.HeroConst.ATTR_SHOW_RUNES then
return heroEntity:getRunes():hasAttr(attr[heroEntity:getMatchType()])
local runesEntity = heroEntity:getRunes()
return runesEntity and runesEntity:hasAttr(attr[heroEntity:getMatchType()]) or false
end
return true

View File

@ -66,8 +66,8 @@ function HeroAttrUI:isShowAttr(node)
return #DataManager.SkinData:getOwnAllAttr(self.heroEntity) > 0
end
if node == GConst.HeroConst.ATTR_SHOW_RUNES then
local all = self.heroEntity:getRunes():getAllAttr()
return all and #all > 0
local runesEntity = self.heroEntity:getRunes()
return runesEntity and runesEntity:getAllAttr() and #runesEntity:getAllAttr() > 0 or false
end
return true

View File

@ -190,7 +190,6 @@ function RunesInfoComp:refreshRunes()
local imgLock = map["img_lock"]
local lock = map["lock"]
local txLock = map["tx_lock"]
obj:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR).enabled = false
if ModuleManager.RunesManager:isInAutoQuenching() and index <= DataManager.RunesData:getLevelConfig()[self.tempLevel].grid or DataManager.RunesData:isUnlock(index) then
lock:setActive(false)

View File

@ -205,16 +205,21 @@ end
function HeroEntity:updateRunesAttr()
self.runesAttr = {}
local hp = self:getRunes():getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getMatchType()])
local atk = self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()])
local normalHurt = self:getRunes():getAttrValue(GConst.MATCH_NORMAL_HURT_NAME[self:getMatchType()])
local skillHurt = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURT_NAME[self:getMatchType()])
local critPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_NAME[self:getMatchType()])
local critHurtPer = self:getRunes():getAttrValue(GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()])
local normalHurtPer = self:getRunes():getAttrValue(GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()], true)
local skillHurtPer = self:getRunes():getAttrValue(GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()], true)
local healPer = self:getRunes():getAttrValue(GConst.MATCH_CURED_NAME[self:getMatchType()])
local allHurtp = self:getRunes():getAttrValue(GConst.MATCH_ALL_HURTP_NAME[self:getMatchType()])
local runesEntity = self:getRunes()
if runesEntity == nil then
return
end
local hp = runesEntity:getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getMatchType()])
local atk = runesEntity:getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()])
local normalHurt = runesEntity:getAttrValue(GConst.MATCH_NORMAL_HURT_NAME[self:getMatchType()])
local skillHurt = runesEntity:getAttrValue(GConst.MATCH_SKILL_HURT_NAME[self:getMatchType()])
local critPer = runesEntity:getAttrValue(GConst.MATCH_CRIT_NAME[self:getMatchType()])
local critHurtPer = runesEntity:getAttrValue(GConst.MATCH_CRIT_TIME_NAME[self:getMatchType()])
local normalHurtPer = runesEntity:getAttrValue(GConst.MATCH_NORMAL_HURTP_NAME[self:getMatchType()], true)
local skillHurtPer = runesEntity:getAttrValue(GConst.MATCH_SKILL_HURTP_NAME[self:getMatchType()], true)
local healPer = runesEntity:getAttrValue(GConst.MATCH_CURED_NAME[self:getMatchType()])
local allHurtp = runesEntity:getAttrValue(GConst.MATCH_ALL_HURTP_NAME[self:getMatchType()])
self.runesAttr[GConst.MATCH_HP_NAME[self:getMatchType()]] = hp
self.runesAttr[GConst.MATCH_ATTACK_NAME[self:getMatchType()]] = atk
@ -556,7 +561,12 @@ function HeroEntity:getTotalBaseHp()
end
end
result = result + DataManager.SkinData:getBaseHp(self)
result = result + self:getRunes():getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getMatchType()], true)
local runesEntity = self:getRunes()
if runesEntity then
result = result + runesEntity:getAttrValue(GConst.MATCH_HP_FIX_NAME[self:getMatchType()], true)
end
return result
end
@ -574,8 +584,11 @@ function HeroEntity:getTotalBaseAtk()
end
-- logStr = logStr .. "\nSKIN" .. DataManager.SkinData:getBaseAttack(self)
result = result + DataManager.SkinData:getBaseAttack(self)
local runesEntity = self:getRunes()
if runesEntity then
-- logStr = logStr .. "\nRUNES" .. self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()], true)
result = result + self:getRunes():getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()], true)
result = result + runesEntity:getAttrValue(GConst.MATCH_ATTACK_NAME[self:getMatchType()], true)
end
-- Logger.logHighlight(logStr)
return result
end
@ -612,11 +625,7 @@ function HeroEntity:setRunes(runesEntity)
end
function HeroEntity:getRunes()
if self.runesEntity then
return self.runesEntity
end
return DataManager.RunesData:getRunes(self:getCfgId())
end
return HeroEntity

View File

@ -12,7 +12,7 @@ end
function RunesEntity:updateGrids(grids)
self.grids = grids or GConst.EMPTY_TABLE
self:getHeroEntity():onRunesAttrChange()
self:getHeroEntity():setRunes(self)
self:setDirty()
end