feat: add revival support
This commit is contained in:
parent
c6b04006da
commit
b7a0ec7c7b
2 changed files with 18 additions and 2 deletions
|
@ -31,6 +31,13 @@ function Hero:die()
|
|||
end
|
||||
end
|
||||
|
||||
function Hero:revive()
|
||||
if (self.isKo) then
|
||||
self:changeAnimation("idle")
|
||||
self.isKo = false
|
||||
end
|
||||
end
|
||||
|
||||
function Hero:setAsKo()
|
||||
self:changeAnimation("ko")
|
||||
self.isKo = true
|
||||
|
|
|
@ -40,11 +40,20 @@ function FighterParent:setPP(value, relative)
|
|||
end
|
||||
|
||||
function FighterParent:applyDeath()
|
||||
if ((not self.abstract:isAlive()) and self.isAlive) then
|
||||
self:die()
|
||||
if (self.abstract:isAlive() ~= self.isAlive ) then
|
||||
if (self.abstract:isAlive()) then
|
||||
self:revive()
|
||||
else
|
||||
self:die()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function FighterParent:revive()
|
||||
self.isAlive = true
|
||||
self.actor:revive()
|
||||
end
|
||||
|
||||
function FighterParent:die()
|
||||
self.isAlive = false
|
||||
self.actor:die()
|
||||
|
|
Loading…
Reference in a new issue