diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua
index 558ca5e7..8d3419d1 100644
--- a/lua/app/global/global_const.lua
+++ b/lua/app/global/global_const.lua
@@ -500,6 +500,15 @@ GConst.ENTITY_TYPE = {
GConst.MATCH_HP_NAME = {
[0] = "hp",
+ [1] = "hp",
+ [2] = "hp",
+ [3] = "hp",
+ [4] = "hp",
+ [5] = "hp",
+}
+
+-- 英雄颜色属性生命值
+GConst.MATCH_HP_FIX_NAME = {
[1] = "attr_hp_red",
[2] = "attr_hp_yellow",
[3] = "attr_hp_green",
diff --git a/lua/app/module/hero/hero_const.lua b/lua/app/module/hero/hero_const.lua
index d9d11d88..0fbdfbc7 100644
--- a/lua/app/module/hero/hero_const.lua
+++ b/lua/app/module/hero/hero_const.lua
@@ -52,7 +52,7 @@ HeroConst.ATTR_SHOW_ARMOR = {
}
-- 皮肤
HeroConst.ATTR_SHOW_SKIN = {
- GConst.MATCH_HP_NAME, -- 生命
+ GConst.MATCH_HP_FIX_NAME, -- 生命
GConst.MATCH_ATTACK_NAME, -- 攻击
GConst.MATCH_NORMAL_HURT_NAME, -- 普攻增伤
GConst.MATCH_SKILL_HURT_NAME, -- 技能增伤
diff --git a/lua/app/ui/hero/cell/attr_cell.lua b/lua/app/ui/hero/cell/attr_cell.lua
index 7dcc893d..940c165c 100644
--- a/lua/app/ui/hero/cell/attr_cell.lua
+++ b/lua/app/ui/hero/cell/attr_cell.lua
@@ -15,7 +15,7 @@ function AttrCell:refresh(heroEntity, nodeType, attrType)
self.nodeType = nodeType
self.attrName = attrType[self.heroEntity:getMatchType()]
- if attrType == GConst.MATCH_HP_NAME then
+ if attrType == GConst.MATCH_HP_NAME or attrType == GConst.MATCH_HP_FIX_NAME then
self:showHp()
elseif attrType == GConst.MATCH_ATTACK_NAME then
self:showAtk()
diff --git a/lua/app/ui/hero/skin_info_comp.lua b/lua/app/ui/hero/skin_info_comp.lua
index 77f5d938..245cb9f8 100644
--- a/lua/app/ui/hero/skin_info_comp.lua
+++ b/lua/app/ui/hero/skin_info_comp.lua
@@ -100,9 +100,9 @@ function SkinInfoComp:refreshSelectSkin(selectId)
imgIcon:setSprite(GConst.ATLAS_PATH.COMMON, "common_dec_5")
txTitle:setText(""..I18N:getGlobalText(I18N.GlobalConst.ATTR_ATK).."")
showValue = curAttr[index].num // PERCENT_FACTOR .. "%"
- elseif curAttr[index].type == GConst.MATCH_HP_NAME[self.heroEntity:getMatchType()] then
+ elseif curAttr[index].type == GConst.MATCH_HP_FIX_NAME[self.heroEntity:getMatchType()] then
-- 生命
- table.insert(showAttrType, GConst.MATCH_HP_NAME[self.heroEntity:getMatchType()])
+ table.insert(showAttrType, GConst.MATCH_HP_FIX_NAME[self.heroEntity:getMatchType()])
imgIcon:setSprite(GConst.ATLAS_PATH.COMMON, "common_dec_4")
txTitle:setText(""..I18N:getGlobalText(I18N.GlobalConst.ATTR_HP).."")
showValue = curAttr[index].num // DEFAULT_FACTOR
diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua
index 6f46a9bf..8c465302 100644
--- a/lua/app/userdata/hero/hero_entity.lua
+++ b/lua/app/userdata/hero/hero_entity.lua
@@ -329,7 +329,7 @@ function HeroEntity:getAtk()
end
function HeroEntity:getHp()
- local hpName = GConst.MATCH_HP_NAME[self:getMatchType()]
+ local hpName = ATTR_NAME.HP
local hpAddName = GConst.MATCH_HP_ADD_NAME[self:getMatchType()]
return self:getTotalAttrValue(hpName) + self:getTotalAttrValue(hpAddName)
end
diff --git a/lua/app/userdata/skin/skin_data.lua b/lua/app/userdata/skin/skin_data.lua
index b44204da..8703a03a 100644
--- a/lua/app/userdata/skin/skin_data.lua
+++ b/lua/app/userdata/skin/skin_data.lua
@@ -142,7 +142,7 @@ end
-- 英雄是否拥有某属性
function SkinData:hasAttr(heroId, attrType)
- if table.containValue(GConst.MATCH_HP_NAME, attrType) then
+ if table.containValue(GConst.MATCH_HP_FIX_NAME, attrType) then
return self:getHp(heroId) > 0
end
if table.containValue(GConst.MATCH_ATTACK_NAME, attrType) then
@@ -179,7 +179,7 @@ end
-- 获取基础生命值
function SkinData:getBaseHp(heroId)
local result = table.find(self:getOwnAllAttr(heroId), function(value)
- return table.containValue(GConst.MATCH_HP_NAME, value.type)
+ return table.containValue(GConst.MATCH_HP_FIX_NAME, value.type)
end)
return result and result.num or 0
end