diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 11264134..e732e494 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1016,6 +1016,13 @@ function BattleUnitComp:updateNormalAttack(dt) end end +function BattleUnitComp:addMaxHp(percent) + self.unitEntity:addMaxHp(percent) + local hpPercent = self.unitEntity:getHpPercent() + local hp = self.unitEntity:getHp() + self.battleController:refreshHp(self.side, hp, hpPercent) +end + function BattleUnitComp:addBuff(buffEffect) self.team:addBuff(buffEffect) end diff --git a/lua/app/module/battle/helper/battle_buff_handle.lua b/lua/app/module/battle/helper/battle_buff_handle.lua index 90967341..74e9b46c 100644 --- a/lua/app/module/battle/helper/battle_buff_handle.lua +++ b/lua/app/module/battle/helper/battle_buff_handle.lua @@ -71,7 +71,7 @@ BattleBuffHandle.addAttribute = { target.unitEntity:addAttr(ATTR_NAME.NORMAL_ATTACK_COUNT, num, false) end, [BUFF_NAME.HPP_ADD] = function(target, num) - target.unitEntity:addMaxHp(num) + target:addMaxHp(num) end, }