血量bug

This commit is contained in:
chenxi 2023-04-25 10:19:16 +08:00
parent d88e267558
commit a560ccf8a1

View File

@ -170,7 +170,13 @@ function BattleTeamEntity:getNormalAttackAddCount()
end
function BattleTeamEntity:addMaxHp(num)
local hpBefore = self.attr.hp
local currPercent = hpBefore * DEFAULT_FACTOR // self.attr.max_hp
self.attr.max_hp = self.attr.max_hp + self.baseAttr.max_hp * num // DEFAULT_FACTOR
self.attr.hp = currPercent*self.attr.max_hp//DEFAULT_FACTOR
if self.attr.hp <= 0 and hpBefore > 0 then
self.attr.hp = 1
end
end
function BattleTeamEntity:addLimit(name)