fix bug
This commit is contained in:
parent
79b546d2f8
commit
9ae6d709e7
@ -1168,9 +1168,9 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus)
|
||||
end
|
||||
local hp = self.unitEntity:getHp()
|
||||
local x, y = self.baseObject:fastGetLocalPosition()
|
||||
local damage = num
|
||||
if num < 0 then -- 伤害
|
||||
local delayTime = 0
|
||||
local damage = num
|
||||
if shieldHpDiff < 0 then
|
||||
damage = damage - shieldHpDiff
|
||||
delayTime = BattleConst.EFFECT_NUMBER_DELAY
|
||||
@ -1200,13 +1200,13 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus)
|
||||
local hpPercent = self.unitEntity:getHpPercent()
|
||||
self.battleController:refreshHp(self.side, hp, hpPercent)
|
||||
if atker:getIsCentralizedAttack() then
|
||||
if self.currState == UNIT_STATE.IDLE then
|
||||
if damage < 0 and self.currState == UNIT_STATE.IDLE then
|
||||
self:playHurt()
|
||||
end
|
||||
else
|
||||
if self.unitEntity:getIsDead() then
|
||||
self:changeState(UNIT_STATE.DEAD)
|
||||
elseif self.currState == UNIT_STATE.IDLE then
|
||||
elseif damage < 0 and self.currState == UNIT_STATE.IDLE then
|
||||
self:playHurt()
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user