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