Skip to content
Snippets Groups Projects
Commit 383f212d authored by dg's avatar dg
Browse files

Precognition doesnt break at the first damage

git-svn-id: http://svn.net-core.org/repos/t-engine4@6278 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2b4614c9
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,12 @@ function _M:takeHit(value, src, death_note)
self.life = self.life - value
self.changed = true
if self.life <= self.die_at then
if self:hasEffect(self.EFF_PRECOGNITION) then
game.log("%s dies during precognition, ending the effect!", self.name:capitalize())
self:removeEffect(self.EFF_PRECOGNITION)
return false, 0
end
if self:knowTalent(self.T_CAUTERIZE) and self:triggerTalent(self.T_CAUTERIZE, nil, value) then
return false, 0
else
......@@ -39,10 +45,5 @@ function _M:takeHit(value, src, death_note)
return self:die(src, death_note), value
end
end
if self:hasEffect(self.EFF_PRECOGNITION) then
game.log("%s dies during precognition, ending the effect!", self.name:capitalize())
self:removeEffect(self.EFF_PRECOGNITION)
return false, 0
end
return false, value
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment