Skip to content
Snippets Groups Projects
Commit 5cfeda43 authored by dg's avatar dg
Browse files

resting/running is impossible if loosing air

git-svn-id: http://svn.net-core.org/repos/t-engine4@775 51575b47-30f0-44d4-a5cc-537603b46e54
parent b75a24ea
No related branches found
No related tags found
No related merge requests found
......@@ -330,6 +330,7 @@ function _M:restCheck()
if spotted then return false, ("hostile spotted (%s%s)"):format(spotted.actor.name, game.level.map:isOnScreen(spotted.x, spotted.y) and "" or " - offscreen") end
-- Check ressources, make sure they CAN go up, otherwise we will never stop
if self.air_regen < 0 then return false, "loosing breath!" end
if self:getMana() < self:getMaxMana() and self.mana_regen > 0 then return true end
if self:getStamina() < self:getMaxStamina() and self.stamina_regen > 0 then return true end
if self.life < self.max_life and self.life_regen> 0 then return true end
......@@ -343,6 +344,8 @@ function _M:runCheck()
local spotted = spotHostiles(self)
if spotted then return false, ("hostile spotted (%s%s)"):format(spotted.actor.name, game.level.map:isOnScreen(spotted.x, spotted.y) and "" or " - offscreen") end
if self.air_regen < 0 then return false, "loosing breath!" end
-- Notice any noticable terrain
local noticed = false
self:runScan(function(x, y)
......
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