增加最大血量

This commit is contained in:
chenxi 2023-04-25 11:58:16 +08:00
parent 53475739c0
commit 01a5bf9e16
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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,
}